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

cmd/go: breakage with go version command and GOFLAGS environment variable [1.15 backport] #41464

Closed
gopherbot opened this issue Sep 17, 2020 · 7 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@mvdan requested issue #41264 to be considered for backport to the next 1.15 minor release.

@gopherbot please consider this for backport to 1.15, it's a regression.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Sep 17, 2020
@gopherbot gopherbot added this to the Go1.15.3 milestone Sep 17, 2020
@mvdan mvdan self-assigned this Sep 17, 2020
@mvdan
Copy link
Member

mvdan commented Sep 17, 2020

@andybons @dmitshur I assume I need approval from someone for this backport, as per https://github.com/golang/go/wiki/MinorReleases.

@mvdan
Copy link
Member

mvdan commented Sep 17, 2020

CL, since the bot seems to not pick it up: https://go-review.googlesource.com/c/go/+/255498

@gopherbot
Copy link
Author

Change https://golang.org/cl/255498 mentions this issue: [release-branch.go1.15] cmd/go: relax version's error on unexpected flags

@cagedmantis
Copy link
Contributor

Approved because this is a serious issue without a workaround.

@cagedmantis cagedmantis added the CherryPickApproved Used during the release process for point releases label Sep 24, 2020
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Sep 24, 2020
@mvdan
Copy link
Member

mvdan commented Sep 25, 2020

@cagedmantis can I merge the backport CL, then? Or should someone else do it?

@dmitshur
Copy link
Contributor

dmitshur commented Sep 25, 2020

@mvdan From https://golang.org/wiki/MinorReleases:

Gerrit is configured to only allow release managers to submit to release branches,

Submitting the CL is a step that release managers are responsible for. We’ll get to it as soon as we can.

@gopherbot
Copy link
Author

Closed by merging 8841790 to release-branch.go1.15.

gopherbot pushed a commit that referenced this issue Oct 7, 2020
…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í <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit de0957d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/255498
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
claucece pushed a commit to claucece/go that referenced this issue Oct 22, 2020
…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í <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit de0957d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/255498
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
@golang golang locked and limited conversation to collaborators Oct 7, 2021
@rsc rsc unassigned mvdan Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

4 participants