From f5d220cccd1aeec4502e0f7aea09093009f8b988 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 23 Apr 2025 23:30:20 +0300 Subject: [PATCH 1/2] doc/rl2505: mention addition of `goSum` to `buildGoModule` --- doc/release-notes/rl-2505.section.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 346319db23ab..eff151f88b18 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -149,6 +149,8 @@ - `buildGoPackage` has been removed. Use `buildGoModule` instead. See the [Go section in the nixpkgs manual](https://nixos.org/manual/nixpkgs/unstable/#sec-language-go) for details. +- `buildGoModule` now supports a `goSum` attribute (`null` by default) to optionally provide a path to `go.sum` and correctly enabling rebuilds when the file changes. + - top-level `playwright` now refers to the github Microsoft/playwright package instead of the python tester launcher. You can still refer to the python launcher via `python3Packages.toPythonApplication python3Packages.playwright` From 5761f0acc7c6294d4d8d9e376cb2b4e2e7ea929b Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 26 Apr 2025 18:12:32 +0300 Subject: [PATCH 2/2] docs: update Go section after the addition of `goSum` attribute --- doc/languages-frameworks/go.section.md | 7 +++++++ doc/redirects.json | 3 +++ 2 files changed, 10 insertions(+) diff --git a/doc/languages-frameworks/go.section.md b/doc/languages-frameworks/go.section.md index c23dba3d0cc1..172bf2ca8f37 100644 --- a/doc/languages-frameworks/go.section.md +++ b/doc/languages-frameworks/go.section.md @@ -188,6 +188,13 @@ Whether the build result should be allowed to contain references to the Go tool Defaults to `false` +### `goSum` {#var-go-goSum} + +Specifies the contents of the `go.sum` file and triggers rebuilds when it changes. This helps combat inconsistent dependency errors on `go.sum` changes. + +Defaults to `null` + + ## Overriding `goModules` {#buildGoModule-goModules-override} Overriding `.goModules` by calling `goModules.overrideAttrs` is unsupported. Still, it is possible to override the `vendorHash` (`goModules`'s `outputHash`) and the `pre`/`post` hooks for both the build and patch phases of the primary and `goModules` derivation. diff --git a/doc/redirects.json b/doc/redirects.json index 627b4137281d..4884e193a656 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -434,6 +434,9 @@ "var-meta-teams": [ "index.html#var-meta-teams" ], + "var-go-goSum": [ + "index.html#var-go-goSum" + ], "variables-specifying-dependencies": [ "index.html#variables-specifying-dependencies" ],