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

Go: run with minimum version, not maximum #25036

Closed
rarkins opened this issue Oct 4, 2023 · 2 comments
Closed

Go: run with minimum version, not maximum #25036

rarkins opened this issue Oct 4, 2023 · 2 comments
Labels
manager:gomod Go Modules priority-1-critical A bad bug or work that is holding up a lot of other important features or fixes type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Oct 4, 2023

Describe the proposed change(s).

Due to a change in Go behavior (see golang/go#62409), Go 1.21 now "upgrades" the Go directive in go.mod if we run go x commands with a newer Go version than is already there.

We should instead try to use the exact version of Go to stop this "accidental" upgrading.

Example commit from reproduction: renovate-reproductions/24994@5ee6ce9 (#1)

@rarkins rarkins added type:feature Feature (new functionality) priority-1-critical A bad bug or work that is holding up a lot of other important features or fixes manager:gomod Go Modules status:ready labels Oct 4, 2023
@rarkins
Copy link
Collaborator Author

rarkins commented Oct 4, 2023

This is not as simple as it seems. When I ran that same PR with 1.20 it errored:

         "stderr": "github.com/tuihub/librarian/internal/lib/libmq imports\n\tgithub.com/ThreeDotsLabs/watermill imports\n\tlog/slog: package log/slog is not in GOROOT (/opt/containerbase/tools/golang/1.20.8/src/log/slog)\nnote: imported by a module that requires go 1.21\n",

@MuZhou233 maybe Go only upgraded to 1.21 because it needed to and that's why you couldn't easily reproduce either?

@rarkins
Copy link
Collaborator Author

rarkins commented Oct 4, 2023

I've found that Go does not update the Go mod directive unless it's necessary

@rarkins rarkins closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:gomod Go Modules priority-1-critical A bad bug or work that is holding up a lot of other important features or fixes type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

1 participant