Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: tools/go.mod has invalid Go version 1.22 #4241

Closed
jpmcb opened this issue Jul 15, 2024 · 3 comments
Closed

Bug: tools/go.mod has invalid Go version 1.22 #4241

jpmcb opened this issue Jul 15, 2024 · 3 comments
Labels
kind/bug Something isn't working

Comments

@jpmcb
Copy link

jpmcb commented Jul 15, 2024

Describe the bug

When attempting to build and verify artifacts using make all for the first time, there is a toolchain problem:

❯ make all
# Update root go modules
go mod tidy && go mod verify
all modules verified
cd tools; go mod tidy && go mod verify; cd ../
go: downloading go1.22 (darwin/arm64)
go: download go1.22 for darwin/arm64: toolchain not available
cd tools; GOBIN=/Users/jpmcb/workspace/ossf-scorecard/tools/bin go install github.com/golang/mock/mockgen
go: downloading go1.22 (darwin/arm64)
go: download go1.22 for darwin/arm64: toolchain not available
make: *** [/Users/jpmcb/workspace/ossf-scorecard/tools/bin/mockgen] Error 1

Primarily download go1.22 for darwin/arm64: toolchain not available in the tools Go module:

go 1.22

"1.22" is not a valid Go version and is not recognized by the toolchain as a valid version to download:

golang/go#65568

Making this change fixed the problem and I was able to build:

- go 1.22
+ go 1.22.0

Reproduction steps
Steps to reproduce the behavior:

  1. Freshly clone the repo
  2. Run make all
  3. Notice failure in the tools directory

Expected behavior

Should be able to clone repo and make all without toolchain failures or needing to make go.mod changes

@jpmcb jpmcb added the kind/bug Something isn't working label Jul 15, 2024
@jpmcb
Copy link
Author

jpmcb commented Jul 15, 2024

Seems there was a change after Go 1.21 that prefers the X.Y.Z directive format: golang/go#62278 (comment) since X.Y versions of Go are generally not downloadable or captureable by the automatic toolchain upgrading mechanisms.

spencerschrock added a commit that referenced this issue Jul 16, 2024
This happened to be needed for this PR, but will also address another
issue. Fixes #4241

Signed-off-by: Spencer Schrock <sschrock@google.com>
@spencerschrock
Copy link
Contributor

Thanks for the report. Our CI (and likely all of the maintainer dev environments) is setup in a way that Go 1.22.x is already available, so I hadn't run into this.

Merging #4240 required me to take care of this anyway, but let me know if the issue persists after merged.

@jpmcb
Copy link
Author

jpmcb commented Jul 16, 2024

Fixed! Thanks @spencerschrock !! 🫡

@jpmcb jpmcb closed this as completed Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants