Skip to content

buildGoModule: access ldflags and tags __structuredAttrs-agnostically#360037

Merged
ShamrockLee merged 2 commits intoNixOS:stagingfrom
ShamrockLee:build-go-module-ldflags
Dec 18, 2024
Merged

buildGoModule: access ldflags and tags __structuredAttrs-agnostically#360037
ShamrockLee merged 2 commits intoNixOS:stagingfrom
ShamrockLee:build-go-module-ldflags

Conversation

@ShamrockLee
Copy link
Contributor

Adjust how ldflags and tags attributes form corresponding flags to make it compatible to __structuredAttrs = true.

This change also simplifies how GOOS and GOARCH are accessed during the build.

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 the 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. label Nov 29, 2024
@ShamrockLee
Copy link
Contributor Author

@ofborg build aliae
@ofborg build alist

Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just looked, didn't build anything.

LGTM

@ofborg ofborg bot added 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: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. labels Nov 29, 2024
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Dec 1, 2024
@ShamrockLee
Copy link
Contributor Author

The OfBorg builds of aliae and alist on Darwin platforms failed due to timeout. The builds on Linux are successful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. 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: 2501-5000 This PR causes many rebuilds on Linux and should 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.

3 participants