Skip to content

buildGoModule: Deprecate vendorSha256 with throw#299169

Merged
wegank merged 1 commit intoNixOS:masterfrom
ShamrockLee:go-module-vendorsha256
Mar 28, 2024
Merged

buildGoModule: Deprecate vendorSha256 with throw#299169
wegank merged 1 commit intoNixOS:masterfrom
ShamrockLee:go-module-vendorsha256

Conversation

@ShamrockLee
Copy link
Contributor

Description of changes

Ignore vendorSha256 when vendorHash is specified.

Throw when vendorHash isn't specified:

  • "buildGoModule: Expect vendorHash instead of vendorSha256" when vendorSha256 is specified.
  • "buildGoModule: vendorHash is missing" otherwise.

If merged, vendorSha256 is mostly ignored and is no longer an alias to vendorHash, making future development easier.

This is a "hard" deprecation of vendorSha256, following the "soft" deprecation during Nixpkgs 23.11 (#225371). Remaining usage in vendorSha256 in Nixpkgs has been cleaned up before the release of Nixpkgs 23.11 (#254879, #256514, #256643).

Things done

  • Built on platform(s)
    • x86_64-linux (No rebuild.)
    • 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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 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 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. labels Mar 26, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 26, 2024
@ShamrockLee ShamrockLee force-pushed the go-module-vendorsha256 branch from 7321714 to 49d3b85 Compare March 26, 2024 13:17
@ShamrockLee ShamrockLee force-pushed the go-module-vendorsha256 branch 4 times, most recently from 8e860a8 to a85295e Compare March 26, 2024 22:56
@ShamrockLee ShamrockLee requested a review from zowoq March 27, 2024 03:02
Ignore vendorSha256 when vendorHash is specified.

Throw when vendorHash isn't specified:
- "buildGoModule: Expect vendorHash instead of vendorSha256" when
  vendorSha256 is specified.
- "buildGoModule: vendorHash is missing" otherwise.

`goModules.outputHashAlgo` is specified as null when vendorHash is not
empty, "sha256" otherwise.

Co-authored-by: zowoq <59103226+zowoq@users.noreply.github.com>
@ShamrockLee ShamrockLee force-pushed the go-module-vendorsha256 branch from 87e95f9 to c9da94b Compare March 27, 2024 03:20
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Mar 27, 2024
@wegank wegank added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Mar 27, 2024
@wegank wegank merged commit cb00e17 into NixOS:master Mar 28, 2024
@ShamrockLee ShamrockLee deleted the go-module-vendorsha256 branch April 27, 2024 17:10
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. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants