-
Notifications
You must be signed in to change notification settings - Fork 18k
dl/internal/version: consider to unset GOTOOLCHAIN #64665
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
That's an interesting way for these behaviors to intersect. But also it seems unexpected to me that gotip, whose version is something like
And https://go.dev/doc/toolchain#select says:
Maybe I'm overlooking something, but it seems like unexpected cmd/go behavior (with some similarity to #63357). CC @bcmills. Edit: Thanks to Bryan's reply below, I realize now that I missed the paragraph above:
And that the same baseline behavior of starting with <name> applies in the <name>+auto case too, even though it's not emphasized in its paragraph as much.
Note that doing this would get in the way of another aspect of how these |
It is expected that setting an explicit variable in the (This is in contrast with, say, the It isn't obvious to me what the |
A (lazy?) approach would be to error in this case and thus require the user to be more specific. |
The interaction with gotip & GOTOOLCHAIN=go1.21.5+auto is quite surprising. It shoud've picked up go1.22 dev version. For go1.X.Y wrappers, the issue here is user's GOTOOLCHAIN setting coming from
Other than go command line tool developers, how often a go user would be interested in testing the toolchain switch behavior (how go1.X.Y interacts with |
Today I faced the same issue, and
@prattmic Can you tell me more about the approach you are suggesting? Most part of go commands is designed to work without human interaction and this wrapper is designed to be interchangeable with 'go', it's unclear to me how this should be surfaced. Is there a way to tell whether |
see #34208 for identifying the source of settings |
@hyangah My suggestion was to error on conflict. Something like:
I don't know if this is a good idea, it just came to mind from Bryan's comment "I don't think I can confidently infer what the user intends to happen". Thus, we refuse to infer at all. |
I think the vast majority of users will either leave And The confusing combination, I think, is That said, maybe we should log something to |
FWIW, I think the instructions in that doc are still the best way to manage the minimum Go installation, and I don't think we should suggest setting something like But we also don't currently have a |
I think there's a good argument for gotip to force GOTOOLCHAIN=local as it runs the go binary it picks. The versioned go commands cannot do this, because we expect a sequence of upgrades as execs happen in the most complex auto-upgrade cases. |
I've updated my default go using
go env -w GOTOOLCHAIN=go1.21.5+auto
.After that, the instruction in managing go installation does not work any more.
Same for other version wrappers.
The easiest fix may be to set GOTOOLCHAIN=local or GOTOOLCHAIN= when these wrapper binaries invoke
go
.Alternatively, we can deprecate the current "managing go installation" doc, and recommend to use
GOTOOLCHAIN
to switch the version instead.The text was updated successfully, but these errors were encountered: