-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: breakage with go version command and GOFLAGS environment variable [1.15 backport] #41464
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
@andybons @dmitshur I assume I need approval from someone for this backport, as per https://github.com/golang/go/wiki/MinorReleases. |
CL, since the bot seems to not pick it up: https://go-review.googlesource.com/c/go/+/255498 |
Change https://golang.org/cl/255498 mentions this issue: |
Approved because this is a serious issue without a workaround. |
@cagedmantis can I merge the backport CL, then? Or should someone else do it? |
@mvdan From https://golang.org/wiki/MinorReleases:
Submitting the CL is a step that release managers are responsible for. We’ll get to it as soon as we can. |
Closed by merging 8841790 to release-branch.go1.15. |
…lags In https://golang.org/cl/221397 we made commands like "go version -v" error, since both of the command's flags only make sense when arguments follow them. Without arguments, the command only reports Go's own version, and the flags are most likely a mistake. However, the script below is entirely reasonable: export GOFLAGS=-v # make all Go commands verbose go version go build After the previous CL, "go version" would error. Instead, only error if the flag was passed explicitly, and not via GOFLAGS. The patch does mean that we won't error on "GOFLAGS=-v go version -v", but that very unlikely false negative is okay. The error is only meant to help the user not misuse the flags, anyway - it's not a critical error of any sort. To reuse inGOFLAGS, we move it to the base package and export it there, since it's where the rest of the GOFLAGS funcs are. Fixes #41464. Change-Id: I74003dd25d94bacf9ac507b5cad778fd65233321 Reviewed-on: https://go-review.googlesource.com/c/go/+/254157 Trust: Daniel Martí <[email protected]> Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> (cherry picked from commit de0957d) Reviewed-on: https://go-review.googlesource.com/c/go/+/255498 Trust: Bryan C. Mills <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]>
…lags In https://golang.org/cl/221397 we made commands like "go version -v" error, since both of the command's flags only make sense when arguments follow them. Without arguments, the command only reports Go's own version, and the flags are most likely a mistake. However, the script below is entirely reasonable: export GOFLAGS=-v # make all Go commands verbose go version go build After the previous CL, "go version" would error. Instead, only error if the flag was passed explicitly, and not via GOFLAGS. The patch does mean that we won't error on "GOFLAGS=-v go version -v", but that very unlikely false negative is okay. The error is only meant to help the user not misuse the flags, anyway - it's not a critical error of any sort. To reuse inGOFLAGS, we move it to the base package and export it there, since it's where the rest of the GOFLAGS funcs are. Fixes golang#41464. Change-Id: I74003dd25d94bacf9ac507b5cad778fd65233321 Reviewed-on: https://go-review.googlesource.com/c/go/+/254157 Trust: Daniel Martí <[email protected]> Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> (cherry picked from commit de0957d) Reviewed-on: https://go-review.googlesource.com/c/go/+/255498 Trust: Bryan C. Mills <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]>
@mvdan requested issue #41264 to be considered for backport to the next 1.15 minor release.
The text was updated successfully, but these errors were encountered: