From f049947b5f6469687c68330dc7016f4fc4a3688c Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Sat, 30 Sep 2023 14:15:02 +0000 Subject: [PATCH] buildGoModule: deprecate vendorSha256 attribute --- doc/languages-frameworks/go.section.md | 2 +- nixos/doc/manual/release-notes/rl-2311.section.md | 2 ++ pkgs/build-support/go/module.nix | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/languages-frameworks/go.section.md b/doc/languages-frameworks/go.section.md index 7fd38a7d21c549..7abcb59f6b1e01 100644 --- a/doc/languages-frameworks/go.section.md +++ b/doc/languages-frameworks/go.section.md @@ -20,7 +20,7 @@ In the following is an example expression using `buildGoModule`, the following a To obtain the actual hash, set `vendorHash = lib.fakeSha256;` and run the build ([more details here](#sec-source-hashes)). - `proxyVendor`: Fetches (go mod download) and proxies the vendor directory. This is useful if your code depends on c code and go mod tidy does not include the needed sources to build or if any dependency has case-insensitive conflicts which will produce platform-dependent `vendorHash` checksums. -- `modPostBuild`: Shell commands to run after the build of the goModules executes `go mod vendor`, and before calculating fixed output derivation's `vendorHash` (or `vendorSha256`). Note that if you change this attribute, you need to update `vendorHash` (or `vendorSha256`) attribute. +- `modPostBuild`: Shell commands to run after the build of the goModules executes `go mod vendor`, and before calculating fixed output derivation's `vendorHash`. Note that if you change this attribute, you need to update `vendorHash` attribute. ```nix pet = buildGoModule rec { diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index 3d9ff866242ee5..6b3bbd0fa87875 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -383,6 +383,8 @@ The module update takes care of the new config syntax and the data itself (user - `fusuma` now enables the following plugins: [appmatcher](https://github.com/iberianpig/fusuma-plugin-appmatcher), [keypress](https://github.com/iberianpig/fusuma-plugin-keypress), [sendkey](https://github.com/iberianpig/fusuma-plugin-sendkey), [tap](https://github.com/iberianpig/fusuma-plugin-tap) and [wmctrl](https://github.com/iberianpig/fusuma-plugin-wmctrl). +- The argument `vendorSha256` of `buildGoModule` is deprecated. Use `vendorHash` instead. ([\#258204](https://github.com/NixOS/nixpkgs/pull/258204)) + ## Nixpkgs internals {#sec-release-23.11-nixpkgs-internals} - The use of `sourceRoot = "source";`, `sourceRoot = "source/subdir";`, and similar lines in package derivations using the default `unpackPhase` is deprecated as it requires `unpackPhase` to always produce a directory named "source". Use `sourceRoot = src.name`, `sourceRoot = "${src.name}/subdir";`, or `setSourceRoot = "sourceRoot=$(echo */subdir)";` or similar instead. diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index 09b43063fb96ab..d0fd8928c91ab8 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -297,6 +297,7 @@ let } // meta; }); in +lib.warnIf (args' ? vendorSha256) "`vendorSha256` is deprecated. Use `vendorHash` instead" lib.warnIf (buildFlags != "" || buildFlagsArray != "") "Use the `ldflags` and/or `tags` attributes instead of `buildFlags`/`buildFlagsArray`" package