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: add (and default to) -buildvcs=auto [1.18 backport] #51798

Closed
gopherbot opened this issue Mar 18, 2022 · 4 comments
Closed

cmd/go: add (and default to) -buildvcs=auto [1.18 backport] #51798

gopherbot opened this issue Mar 18, 2022 · 4 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge GoCommand cmd/go
Milestone

Comments

@gopherbot
Copy link
Contributor

@bcmills requested issue #51748 to be considered for backport to the next 1.18 minor release.

@gopherbot, please backport to Go 1.18. This will fix a usability regression for go build.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Mar 18, 2022
@gopherbot gopherbot added this to the Go1.18.1 milestone Mar 18, 2022
@toothrot toothrot added the GoCommand cmd/go label Mar 23, 2022
@bcmills bcmills added the CherryPickApproved Used during the release process for point releases label Apr 7, 2022
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Apr 7, 2022
@dmitshur dmitshur modified the milestones: Go1.18.1, Go1.18.2 Apr 12, 2022
@dmitshur
Copy link
Contributor

Now that this is approved and upstream issue is fixed, I took a look at creating a backport CL, and found there are a couple of conflicts involving load.PackageOpts.LoadVCS and Package.IsTestOnly. @bcmills Would you like to create the backport CL and resolve those conflicts? Thanks.

@dmitshur
Copy link
Contributor

Whoops, the release-branch.go1.18 branch I tested with was out of date—it's just the trivial alldocs.go conflict, so I'll make the backport CL.

@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/400454 mentions this issue: [release-branch.go1.18] cmd/go: allow '-buildvcs=auto' and treat it as the default

@gopherbot
Copy link
Contributor Author

Closed by merging 24fcbb9 to release-branch.go1.18.

gopherbot pushed a commit that referenced this issue Apr 20, 2022
…s the default

When we added VCS stamping in the Go 1.18 release, we defaulted to
-buildvcs=true, on the theory that most folks will actually want VCS
information stamped.

We also made -buildvcs=true error out if a VCS directory is found and
no VCS tool is available, on the theory that a user who builds with
'-buildvcs=true' will be very surprised if the VCS metadata is
silently missing.

However, that causes a problem for CI environments that don't have the
appropriate VCS tool installed. (And we know that's a common situation
because we're in that situation ourselves — see #46693!)

The new '-buildvcs=auto' setting provides a middle ground: it stamps
VCS information by default when the tool is present (and reports
explicit errors if the tool errors out), but omits the metadata
when the tool isn't present at all.

Updates #51748.
Updates #51999.
Fixes #51798.

Change-Id: Iebc955c2af0abca9b7517f62ca48b1d944eb2df4
Reviewed-on: https://go-review.googlesource.com/c/go/+/398855
Run-TryBot: Bryan Mills <[email protected]>
Reviewed-by: Russ Cox <[email protected]>
Reviewed-by: Michael Matloob <[email protected]>
Auto-Submit: Bryan Mills <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
(cherry picked from commit 4569fe6)
Reviewed-on: https://go-review.googlesource.com/c/go/+/400454
Run-TryBot: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
dmage added a commit to quay/quay-ci-app that referenced this issue Apr 21, 2022
Dockerfile fails with golang-1.18. It needs git until [1] is fixed.
There are two options to fix it:

1. use 1.17 until -buildvcs=auto is added
2. add -buildvcs=false

This PR uses the first option.

[1]: golang/go#51798
@golang golang locked and limited conversation to collaborators Apr 20, 2023
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 GoCommand cmd/go
Projects
None yet
Development

No branches or pull requests

4 participants