Commit Graph

103 Commits

Author SHA1 Message Date
Matt Sturgeon
cea24fefd1 buildGoModule: supported structuredAttrs with subPackages (#519903) 2026-07-04 01:49:49 +00:00
Ross Smyth
f52e868a2e buildGoModule: supported structuredAttrs with subPackages 2026-05-13 16:52:04 -04:00
Stefan Frijters
a05078ee87 buildGoModule: expand excludedPackages for structuredAttrs 2026-03-16 00:49:45 +01:00
Ben Siraphob
c7e10647ea treewide: fix typos 2026-01-13 14:45:11 -05:00
Stefan Frijters
83549e3ad2 buildGoModule: fix GOFLAGS for structuredAttrs 2025-12-14 12:52:50 +01:00
nixpkgs-ci[bot]
39f48e45c5 Merge staging-next into staging 2025-10-31 18:07:11 +00:00
Pol Dellaiera
474f62e914 build-support/go: clarify vendorHash
So programs doesn't need dependencies (e.g., issue2md), that
doesn't mean the dependencies are in the source tree.
2025-10-31 13:13:25 +01:00
Luna Nova
08aadbf8d4 go: position independent executables by default
Followup to setting --enable-default-pie for our gcc,
we teach go to build PIE by default when supported.
2025-10-07 20:27:45 -07:00
Luna Nova
97a43a6db4 go: teach internal linker to use correct ELF interpreter
Teaches go's internal linker to use the GO_LDSO env var as the path for the dynamic linker, instead of defaulting to an FHS /lib path.
GO_LDSO is automatically set to the appropriate value by checking $NIX_CC/nix-support/dynamic-linker
External linking is set as the default for cross compile situations
where CGO is supported.
Teaching go to correctly handle cross
in the internal linker is hard, and our system linker already knows
how to find the right ELF interpreter.
For cross situations where CGO is not supported we assume either non-ELF
binaries or static binaries will be produced.
2025-10-07 17:32:25 -07:00
Paul Meyer
c68db54e93 buildGoModule: remove unused argument defaults (#441838) 2025-10-06 13:59:00 +00:00
Michael Daniels
9a30ebc9cb go: document policy for toolchain/builder upgrades on stable release 2025-10-06 09:00:28 -04:00
nixpkgs-ci[bot]
d158bb26b3 Merge master into staging-next 2025-09-21 18:05:23 +00:00
Yueh-Shun Li
3c9b0f85a4 buildGoModule: remove compatibility layer for directly specified CGO_ENABLED 2025-09-11 02:15:29 +08:00
Yueh-Shun Li
de854a65f2 buildGoModule: remove unused argument defaults 2025-09-11 01:47:31 +08:00
Yueh-Shun Li
1fa17f4fa3 buildGoModule: reference allowGoReference from finalAttrs 2025-09-11 01:35:52 +08:00
nixpkgs-ci[bot]
e849ba637a Merge staging-next into staging 2025-08-29 00:17:30 +00:00
Philip Taron
ad1cab4997 buildGoModule: warn for passthru.overrideModAttrs lost after overriding (#434546) 2025-08-28 14:29:12 -07:00
Yueh-Shun Li
8c54246b3d buildGoModule: warn for passthru.overrideModAttrs lost after overriding 2025-08-29 03:10:57 +08:00
K900
92c54de171 Merge remote-tracking branch 'origin/staging-next' into staging 2025-08-28 12:55:20 +03:00
Ben Siraphob
2f77d9aa7c pkgs: fix README typos 2025-08-27 11:46:28 -07:00
Paul Meyer
cf4e81e3bc buildGoModule: add buildTestBinaries option, add tests (#427334) 2025-08-12 10:14:14 +02:00
Paul Meyer
1d2563835a buildGoModule: add test for buildTestBinaries
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-07-29 11:38:36 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Paul Meyer
21c8967f1c buildGoModule: add buildTestBinaries option
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-07-21 20:18:56 +02:00
Paul Meyer
dff25816ad go/policy: some clarification
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-06-02 10:37:41 +02:00
Tristan Ross
902d4f604f buildGoModule: add goSum attribute to make goModules rebuild (#399532) 2025-04-22 11:11:44 -07:00
Paul Meyer
3ab4d2791d go: write down toolchain/builder upgrade policy
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-04-02 09:56:33 +02:00
Pol Dellaiera
fa65f09a8f build-support/go: reformat with nixfmt-rfc-style 2025-03-16 09:26:36 +01:00
Pol Dellaiera
362e56fc56 build-support/go: remove unused parameters 2025-03-16 09:26:15 +01:00
Pol Dellaiera
db40ae162d build-support/go: replace git with gitMinimal 2025-03-16 09:25:15 +01:00
Pol Dellaiera
8646ca52f3 build-support/go: support finalAttrs through lib.extendMkDerivation 2025-03-16 09:22:41 +01:00
K900
936f4e016d Merge remote-tracking branch 'origin/staging-next' into staging 2025-01-02 19:21:56 +03:00
Paul Meyer
524a505874 buildGoModule: remove some unnecessary quotes (#370005) 2025-01-02 08:56:45 +01:00
Gabriel Nützi
3b0d5f365e buildGoModule: remove some unnecessary quotes 2025-01-01 18:27:45 +01:00
K900
7661b4ac55 Merge remote-tracking branch 'origin/staging-next' into staging 2024-12-19 12:47:54 +03:00
github-actions[bot]
6a83ff87ac Merge master into staging-next 2024-12-19 00:15:19 +00:00
Yueh-Shun Li
3b1ec755ca buildGoModule: instruct users to specify CGO_ENABLED as env.CGO_ENABLED
Tell users to specify environment variables via `env`.

Rename the `var-go-CGO_ENABLED` documentation title
from `CGO_ENABLED` to `env.CGO_ENABLED`
and move the paragraphs under the `ssec-go-environment`.
2024-12-18 23:20:17 +08:00
Yueh-Shun Li
44876c6004 buildGoModule: pass environment variables with the env attribute
This help Go modules support __structuredAttrs = true.

This commit doesn't touch GOFLAGS, which will be handled in subequent
changes.
2024-12-18 23:16:41 +08:00
Yueh-Shun Li
22c6ae979e buildGoModule: Use environment variable GOOS and GOARCH directly 2024-11-29 11:55:37 +08:00
Yueh-Shun Li
b9efad374e buildGoModule: handle ldflags and tags __structuredAttrs-agnostically 2024-11-29 11:55:36 +08:00
Martin Weinelt
9b1b10369d Merge remote-tracking branch 'origin/staging-next' into staging
Conflicts:
- pkgs/development/python-modules/pytest-codspeed/default.nix
2024-11-28 17:11:16 +01:00
Yueh-Shun Li
7542b942a4 buildGoModule: no longer filter out vendorSha256 2024-11-28 00:11:33 +08:00
github-actions[bot]
40a26e9ba0 Merge staging-next into staging 2024-11-19 18:04:59 +00:00
Paul Meyer
41d7136253 buildGoModule: remove goPackagePath warning
As buildGoPackage was removed, it is unlikely for attributes of
buildGoModule to get mixed up with those of buildGoPackage.

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2024-11-18 14:36:08 +01:00
Paul Meyer
4ad10975ec buildGoPackage: remove
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2024-11-18 07:51:19 +01:00
Paul Meyer
36223da9c1 buildGoModule: remove buildFlags/buildFlagsArray
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2024-11-08 09:16:33 +01:00
piegames
68927918d0 treewide: Fix indentation in strings
The indentation stripping semantics of strings are fairly bad and have a
few gotchas where the resulting string has not the intended indentation.
This commit fixes most if not all such instances in Nixpkgs.

I tried to strive a balance between keeping the diff small and
reformatting/refactoring the code to look better. In general,
reformatting should be left to Nixfmt.

Note that this causes a lot of rebuilds by design. All changes need to
be thoroughly vetted and reviewed for correctness. There is no automatic
way to prove correctness.

List of files to fix generated by running
https://gerrit.lix.systems/c/lix/+/2092 on Nixpkgs and looking at the
warnings.
2024-10-22 21:36:42 +02:00
Jörg Thalheim
a808f823bb Merge branch 'master' into docs/improve-go-builder 2024-10-12 13:16:51 +02:00
Gabriel Nützi
9a6d7cc9f7 module.nix aktualisieren
Co-authored-by: Wael Nasreddine <wael.nasreddine@gmail.com>
2024-10-11 12:00:13 +02:00
Yueh-Shun Li
e31ace5cd4 buildGoModule: use lib.toExtension
Use toExtension from Nixpkgs library instead of the one defined locally.
2024-09-14 21:47:59 +08:00