-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: "go test" seems to now require git due to -buildvcs #51723
Comments
Another theory: |
I suppose if git is not found we should proceed without the vcs info. Either way, we should set -buildvcs=false during builds in go test that will be thrown away, same as we set -ldflags=-w. |
It's required in general by |
@ocket8888 This issue is about
I'd agree with that. I've also narrowed down the cause to a
|
Explicitly disable buildvcs for build and test on FreeBSD. See golang/go#51723 and golang/go#51748.
@gopherbot, please backport to Go 1.18. Invoking |
Backport issue(s) opened: #51767 (for 1.18). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Explicitly disable buildvcs for build and test on FreeBSD. See golang/go#51723 and golang/go#51748.
Change https://go.dev/cl/393894 mentions this issue: |
Change https://go.dev/cl/393878 mentions this issue: |
…t requires git due to -buildvcs" backport - golang/go#51767 - golang/go#51723 > @bcmills requested issue #51723 to be considered for backport to the next 1.18 minor release. > > @gopherbot, please backport to Go 1.18. Invoking git for each go test of a package main is surprising and wastes users' time and battery power.
…ving "go test requires git due to -buildvcs" backport - golang/go#51767 - golang/go#51723 > @bcmills requested issue #51723 to be considered for backport to the next 1.18 minor release. > > @gopherbot, please backport to Go 1.18. Invoking git for each go test of a package main is surprising and wastes users' time and battery power.
… requires git due to -buildvcs" backport - golang/go#51767 - golang/go#51723 > @bcmills requested issue #51723 to be considered for backport to the next 1.18 minor release. > > @gopherbot, please backport to Go 1.18. Invoking git for each go test of a package main is surprising and wastes users' time and battery power.
…inaries Invoking a VCS tool requires that the VCS tool be installed, and also adds latency to build commands. Unfortunately, we had been mistakenly loading VCS metadata for tests of "main" packages. Users almost never care about versioning for test binaries, because 'go test' runs the test in the source tree and test binaries are only rarely used outside of 'go test'. So the user already knows exactly which version the test is built against, because the source code is right there — it's not worth the overhead to stamp. Fixes #51767. Updates #51723. Change-Id: I96f191c5a765f5183e5e10b6dfb75a0381c99814 Reviewed-on: https://go-review.googlesource.com/c/go/+/393894 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Trust: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 67f6b8c) Reviewed-on: https://go-review.googlesource.com/c/go/+/393878 Reviewed-by: Cherry Mui <cherryyz@google.com>
Is this issue still there? I am on latest go version: Yet, I am still getting:
I tried providing -buildvcs=false in following command, in that case as well I am getting above errors and below kafka errors: Errors of kafka:
|
Yes of course, Go 1.18.1 hasn't been released yet.
That's something different, but it's missing important lines from the output to know what's wrong. You should open a new issue with the complete output. |
@mvdan adding -buildvcs=false is not working for me [I am getting same errors the one you posted in thread], am i missing anything in the command? I am running this command inside a docker container. |
Are you on Go 1.18? Are you sure you've added it to the command that failed? If you have |
… requires git due to -buildvcs" backport - golang/go#51767 - golang/go#51723 > @bcmills requested issue #51723 to be considered for backport to the next 1.18 minor release. > > @gopherbot, please backport to Go 1.18. Invoking git for each go test of a package main is surprising and wastes users' time and battery power.
I have a CI job that runs
go test ./...
in a git clone, but inside a Docker image wheregit
isn't installed. This worked fine in Go 1.17.x, but breaks with 1.18 unless I add-buildvcs=false
.Reproducer:
Output:
I tried to reproduce this with a dummy module and no dependencies, even creating a dummy git repository, but all of that worked. So I imagine it has something to do with the dependencies. Note that the dependencies here are all downloaded from GOPROXY, so no VCS is needed.
cc @bcmills @matloob
The text was updated successfully, but these errors were encountered: