Commit Graph

787 Commits

Author SHA1 Message Date
zowoq
658b348ba2 go_1_24: 1.24.10 -> 1.24.11
Changelog: https://go.dev/doc/devel/release#go1.24
2025-12-03 08:01:36 +10:00
Leon Klingele
1160854ac7 go_1_25: 1.25.4 -> 1.25.5 2025-12-02 18:01:23 +01:00
Luna Nova
ce37d84094 go: revert default PIE changes
Reverts default PIE patch for go.
Does not reintroduce usages of removed "pie" hardening flag.

I've made a right mess 😿; we have to back go default PIE out late.

building with -race was just reported broken, there isn't time to investigate.
fixing is a mass rebuild.

People are using nixpkgs' go outside of nix derivations to produce
executables to copy into containers. buildGoModule currently sets
buildmode=exe when CGO_ENABLED=0 but this does nothing to maintain the
existing interface for external users.

We are fortunate that backing out the go PIE change in this manner
does not reintroduce breakage of pkgsMusl.rclone etc
that previously occurred when buildmode=pie *wasn't* set.
The gcc `--enable-default-pie` approach turns out to not cause problems
when mixed with a non-PIE go externally linked build. Historical issues
were due to our linker wrapper being less smart about enabling PIE.

Default PIE for go should be revisited post branch off.

Fixes: #456953
Fixes: #461539
2025-11-14 07:32:04 -08:00
Paul Meyer
1edaf6d179 go: only apply PIE by default when CGO is enabled (#458867) 2025-11-08 12:25:02 +00:00
Luna Nova
4d1d61c75c go: set buildmode=exe when CGO_ENABLED=0
To avoid breaking previous documented[^1] behavior of CGO_ENABLED=0
producing fully static binaries we set buildmode=exe. Sadly go
does not support static-pie binaries so this means these packages
lose ASLR.

This is likely to be revisited after branch-off, as
go packages in the main package set with CGO_ENABLED=0 not having
ASLR is not good security posture in the long term and makes
go packages inconsistent with other languages.

[1]: See #var-go-CGO_ENABLED

Fixes: #456953
Fixes: 08aadbf8d4
2025-11-06 08:00:41 -08:00
nixpkgs-ci[bot]
d0b93a6015 Merge staging-next into staging 2025-11-06 11:20:17 +00:00
Wolfgang Walther
9728ef4d54 Merge branch 'master' into staging-next 2025-11-06 12:15:27 +01:00
zowoq
01607ddca8 go_1_24: 1.24.9 -> 1.24.10
Changelog: https://go.dev/doc/devel/release#go1.24
2025-11-06 14:33:33 +10:00
Leon Klingele
5cb4fe3fef go_1_25: 1.25.3 -> 1.25.4 2025-11-06 05:24:59 +01:00
Luna Nova
7e415ae008 go.tests: test skopeo and ashens exe types 2025-11-05 14:23:40 -08:00
Luna Nova
e73b7bfc68 go: move tests to separate file for sharing between versions 2025-11-05 07:16:12 -08:00
nixpkgs-ci[bot]
f38ce7a3f7 Merge staging-next into staging 2025-10-14 08:48:06 +00:00
K900
ac05cbcaa7 Merge remote-tracking branch 'origin/master' into staging-next 2025-10-14 11:45:17 +03:00
zowoq
ef91ac861d go_1_24: 1.24.8 -> 1.24.9
Changelog: https://go.dev/doc/devel/release#go1.24
2025-10-14 09:15:52 +10:00
Leon Klingele
b80587454a go_1_25: 1.25.2 -> 1.25.3 2025-10-13 23:29:44 +02:00
Randy Eckenrode
7da765f439 go: use default SDK on Darwin (14.4) 2025-10-09 18:23:29 -04:00
Philip Taron
fdc93627c6 go: restrict default pie patch to known good GOARCH (#449995) 2025-10-09 10:11:01 -07:00
Luna Nova
7b3a342260 go: restrict default pie patch to known good GOARCH
Blanket application of the patch was insufficiently pessimistic.
The original plan from discussion in matrix
was that BuildModeSupported("gc", "pie", goos, goarch)
should let us know if default pie would work, however
it seems that in some cases BuildModeSupported can return
true but pie will fail anyway.

Let's make an allowlist of GOARCH values so we aren't
breaking any value that has not been tested.

Co-authored-by: Philip Taron <philip.taron@gmail.com>
2025-10-09 08:52:47 -07:00
nixpkgs-ci[bot]
59dd715c71 Merge staging-next into staging 2025-10-08 18:06:40 +00:00
K900
32ccd680ad Merge remote-tracking branch 'origin/master' into staging-next 2025-10-08 15:57:19 +03:00
zowoq
b997b9093d go_1_25: 1.25.1 -> 1.25.2
Changelog: https://go.dev/doc/devel/release#go1.25
(cherry picked from commit c27d4b0b74)
2025-10-08 09:46:30 +02:00
Paul Meyer
db84ed7e8b go_1_25: 1.25.1 -> 1.25.2 (#449724) 2025-10-08 08:49:48 +02:00
Luna Nova
dbb57d8d86 go: only enable PIE by default when building for GOARCH matching target
We rely on teaching go to use the correct ELF interpreter
for PIE in a way that can't work for packages that 
go off and do their own GOARCH=something cross builds
without touching nixpkgs cross machinery,
so update the default pie patch to bake targetPlatform's
GOARCH and only activate for it.

tailscale works as a testcase for this as it cross compiles
many arches in tstest/archtest/qemu_test.go
2025-10-07 20:27:45 -07: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
zowoq
d100301784 go_1_24: 1.24.7 -> 1.24.8
Changelog: https://go.dev/doc/devel/release#go1.24
2025-10-08 09:54:44 +10:00
zowoq
c27d4b0b74 go_1_25: 1.25.1 -> 1.25.2
Changelog: https://go.dev/doc/devel/release#go1.25
2025-10-08 09:53:43 +10:00
nixpkgs-ci[bot]
3cf2f09936 Merge staging-next into staging 2025-09-16 12:07:49 +00:00
OPNA2608
68fcc59457 go_1_25: Disable CGO for powerpc64-linux target 2025-09-13 16:31:07 +02:00
OPNA2608
748b5d1121 go_1_24: Disable CGO for powerpc64-linux target 2025-09-13 16:30:21 +02:00
nixpkgs-ci[bot]
67ad8e434f Merge staging-next into staging 2025-09-08 12:07:59 +00:00
zowoq
8fd5914085 go_1_24: 1.24.6 -> 1.24.7
Changelog: https://go.dev/doc/devel/release#go1.24
2025-09-08 16:11:16 +10:00
zowoq
3c0099c8b9 Reapply "go_1_25: 1.25.0 -> 1.25.1"
This reverts commit e84ec1a23c.
2025-09-08 16:07:30 +10:00
K900
e84ec1a23c Revert "go_1_25: 1.25.0 -> 1.25.1"
This reverts commit f68798a02e.

This is a world rebuild now, so we need to land this in the next cycle.
2025-09-08 08:43:13 +03:00
nixpkgs-ci[bot]
a0966d7a77 Merge master into staging-next 2025-09-08 00:17:21 +00:00
C4 Patino
f68798a02e go_1_25: 1.25.0 -> 1.25.1 2025-09-07 13:26:13 -05:00
Paul Meyer
f4d727e4ff go_1_23,buildGo123Module: remove
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-08-21 08:50:41 +02:00
nixpkgs-ci[bot]
d060c7e4de Merge master into staging-next 2025-08-13 12:07:08 +00:00
Alvaro Aleman
eae238e32a go_1_25: 1.25rc3 -> 1.25.0 2025-08-12 19:52:39 -04:00
nixpkgs-ci[bot]
6fa945bccb Merge staging-next into staging 2025-08-07 12:08:02 +00:00
Paul Meyer
da0daef575 go_1_25: 1.25rc2 -> 1.25rc3 (#431616) 2025-08-07 08:55:59 +02:00
zowoq
623b61ac92 go_1_24: 1.24.5 -> 1.24.6
Changelog: https://go.dev/doc/devel/release#go1.24
2025-08-07 09:06:45 +10:00
zowoq
b889ceecae go_1_25: 1.25rc2 -> 1.25rc3 2025-08-07 09:05:08 +10:00
zowoq
84fb6b5757 go_1_23: 1.23.11 -> 1.23.12
Changelog: https://go.dev/doc/devel/release#go1.23.12
2025-08-07 09:04:19 +10:00
Ross Smyth
d2ac4dfa61 go: isWindows -> isMinGW 2025-08-01 17:55:09 -04:00
zowoq
1905dad0b5 go: add freebsd to binary bootstrap platforms
follow up from 8a6b6167bb
2025-07-31 14:02:24 +10:00
mivorasu
ee0866bddd treewide: conform descriptions to the standards 2025-07-28 04:39:00 +00:00
Wolfgang Walther
535b720589 Merge branch 'master' into staging-next 2025-07-24 14:27:50 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
nixpkgs-ci[bot]
baa230e9a1 Merge master into staging-next 2025-07-21 12:07:36 +00:00