-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: breakage with go version command and GOFLAGS environment variable #41264
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
Comments
Thanks for opening this issue! This behavior stems from a check implemented here, when either the Basically, when Edit: I guess the certain way to get Go to print its own version would be |
I can write a p/r for gitea to make that work, but if you go this route, this behavior should probably be documented in the go 1.15 release notes some how. I'm sure I'm not the only person who will hit it. :-) |
I'm not the most qualified person to say which way this should be handled eg. a better error message, or documenting the two go version 'modes' in a clear way. Maybe @mvdan will have some more context since he worked more recently on implementing these checks. |
This seems like an unintended regression; I'll take a look in the morning. |
Thanks much. :-) |
@bcmills is there a way for
If it's not possible to separate the two cases, then I'll just send a revert CL which we can backport to 1.15.x. |
@mvdan, you could iterate over go/src/cmd/go/internal/work/init.go Lines 273 to 287 in 2556eb7
That would reduce the false-positives, at the cost of some (rare) false-negatives: if the user ran |
Do you reckon that's worth it versus a revert, given the slight inconsistency and unlikely false negatives? It would be a pretty tiny patch if we're OK with exporting |
I think either approach is fairly low-risk, given that |
Change https://golang.org/cl/254157 mentions this issue: |
Do we think this is enough of a regression to warrant backporting to 1.15.x? I personally think not, because it seems pretty rare and also fairly easy to work around. But if anyone else feels strongly about it, it wouldn't be a lot of effort to backport. |
I would like to see it back ported if it isn't a lot of work, otherwise I will have to backport it myself in Gentoo's go packages since we set GOFLAGS=-v by default in our builds. |
@gopherbot please consider this for backport to 1.15, it's a regression. |
Backport issue(s) opened: #41464 (for 1.15). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Thanks @williamh, that seems like enough reason to me. I've opened a backport issue and CL. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
What did you see instead?
I found this because it breaks build systems for go packages that use "go version" to check the version of go they are using, for example: https://github.com/go-gitea/gitea
The text was updated successfully, but these errors were encountered: