fix(pacmak): go 1.16 requires running "go mod download" explicitly#2616
Merged
fix(pacmak): go 1.16 requires running "go mod download" explicitly#2616
Conversation
Starting go 1.16, `go build` does not download modules and updates go.sum automatically. To that end, we now execute this before we execute `go build` during pacmak. Additionally, set `GOSUMDB` to `off` in order to reduce the chance for eventual consistency issues when new modules are published. Fixes #2615
Collaborator
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
iliapolo
approved these changes
Feb 28, 2021
This was referenced Mar 9, 2021
This was referenced Mar 16, 2021
Closed
Closed
This was referenced Mar 17, 2021
Closed
Closed
Closed
mergify bot
pushed a commit
that referenced
this pull request
Feb 25, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starting go 1.16,
go builddoes not download modules and updates go.sum automatically. To that end, we now execute this before we executego buildduring pacmak.Additionally, set
GOSUMDBtooffin order to reduce the chance for eventual consistency issues when new modules are published.Fixes #2615
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.