Skip to content

go, buildGoModule: default to 1.24 - #381448

Merged
katexochen merged 1 commit into
NixOS:stagingfrom
katexochen:go/default-to-1.24
Feb 17, 2025
Merged

katexochen merged 1 commit into
NixOS:stagingfrom
katexochen:go/default-to-1.24

Conversation

@katexochen

@katexochen katexochen commented Feb 12, 2025 •

Copy link
Copy Markdown
Member

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions Bot added 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Feb 12, 2025
@nix-owners
nix-owners Bot requested review from bjornfor and prusnak February 12, 2025 13:24
@katexochen
katexochen requested a review from a team February 12, 2025 13:46
@katexochen katexochen added the 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. label Feb 12, 2025
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 14, 2025
@katexochen
katexochen requested a review from zowoq February 14, 2025 17:49
@zowoq

zowoq commented Feb 14, 2025

Copy link
Copy Markdown
Contributor

I usually prefer to wait for .1 but if you're happy to deal with any issues that turn up I don't object to merging.

@katexochen

Copy link
Copy Markdown
Member Author

I usually prefer to wait for .1 but if you're happy to deal with any issues that turn up I don't object to merging.

We should decide and document a process here, I'm tired of having the same discussions on every release (not with you @zowoq, in general). We have packages in need of the newer Go version (see #382567) and some candidates that frequently break on update. We should try to align here so the process is clear to everyone and we have less friction during maintenance. I'll try write something up. :)

@github-actions github-actions Bot removed the 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. label Feb 17, 2025
@katexochen katexochen added the 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. label Feb 17, 2025
@github-actions github-actions Bot removed the 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. label Feb 17, 2025
@RSWilli

RSWilli commented Feb 17, 2025

Copy link
Copy Markdown

some candidates that frequently break on update

@katexochen doesn't go's "promise of compatibility" prevent exactly this? I'm curious about the cases where a go update can break a package build.

@katexochen

katexochen commented Feb 17, 2025 •

Copy link
Copy Markdown
Member Author

@katexochen doesn't go's "promise of compatibility" prevent exactly this? I'm curious about the cases where a go update can break a package build.

@RSWilli some projects rely on Go internals that are not part of the compatibility guarantee. Search for buildGo122Module in nixpkgs and switch it to buildGo124Module and you'll find some examples.

@RSWilli

RSWilli commented Feb 17, 2025

Copy link
Copy Markdown

Search for buildGo122Module in nixpkgs and switch it to buildGo124Module and you'll find some examples.

Okay but those already have a pinned go version, doesn't this PR only affect modules that require the latest golang version? I guess packages that require a specific go version and don't use it could be considered a packaging error instead of a "go update blocked because it broke package XYZ".

@katexochen

katexochen commented Feb 17, 2025 •

Copy link
Copy Markdown
Member Author

Okay but those already have a pinned go version, doesn't this PR only affect modules that require the latest golang version? I guess packages that require a specific go version and don't use it could be considered a packaging error instead of a "go update blocked because it broke package XYZ".

See my previous comment. We (as in the Go team) need to write down how we do things and what package maintainers and toolchain users can expect.

Also, there is no hard blocker merging this PR, just some considerations regarding potential fallout.

@katexochen
katexochen merged commit 56c61e8 into NixOS:staging Feb 17, 2025
@katexochen
katexochen deleted the go/default-to-1.24 branch February 17, 2025 15:52
@KSJ2000

KSJ2000 commented Feb 19, 2025

Copy link
Copy Markdown
Contributor

A change with go 1.24: the ldflags have changed a bit.
It now says -s implies -w.
That might be needed to be accounted for in the buildGoModule which defaults to having both -s and -w

@katexochen

katexochen commented Feb 19, 2025 •

Copy link
Copy Markdown
Member Author

A change with go 1.24: the ldflags have changed a bit. It now says -s implies -w.

That was already stated in the Go 1.22 changelog: https://tip.golang.org/doc/go1.22#linker

That might be needed to be accounted for in the buildGoModule which defaults to having both -s and -w

And this is wrong. buildGoModule doesn't set -w nor -s, but many packages do. Setting -s -w where -s would be enough does no harm.

Also see #346380.

@Shawn8901 Shawn8901 mentioned this pull request Mar 10, 2025
3 of 13 tasks
@GraysonTinker GraysonTinker mentioned this pull request Oct 4, 2026
2 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants