Skip to content

Commit 0dbfb03

Browse files
authored
fix(jsii-pacmak): remove GOSUMDB=off from Go target (#5044)
The `GOSUMDB=off` environment variable was added in #2616 back in February 2021 as a workaround to reduce eventual consistency issues when newly published Go modules were not yet available in the Go checksum database. At the time, this was a pragmatic fix to avoid transient failures during `go mod download`. However, disabling the checksum database prevents the Go toolchain from using `sum.golang.org` which is required for newer features like automatic toolchain management via the `go` directive in `go.mod`. Specifically, `GOSUMDB=off` breaks the ability of `go work use` and related commands to download and verify the correct Go runtime version automatically. This is an increasingly important feature as the Go ecosystem moves towards self-managing toolchains. Beyond the functional issue, the Go module ecosystem has matured significantly since 2021. The checksum database is stable and eventual consistency is no longer a practical concern for published modules. Keeping `GOSUMDB=off` is both an unnecessary security trade-off (skipping module integrity verification) and now actively prevents useful toolchain features from working. This change removes the `GOSUMDB=off` setting from the `go()` helper function in jsii-pacmak, restoring default Go behavior. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
1 parent ccf63a2 commit 0dbfb03

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • packages/jsii-pacmak/lib/targets

packages/jsii-pacmak/lib/targets/go.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,6 @@ async function go(command: string, args: string[], options: { cwd: string }) {
271271
const { cwd } = options;
272272
return subprocess('go', [command, ...args], {
273273
cwd,
274-
env: {
275-
// disable the use of sumdb to reduce eventual consistency issues when new modules are published
276-
GOSUMDB: 'off',
277-
},
274+
env: {},
278275
});
279276
}

0 commit comments

Comments
 (0)