-
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: Since 1.18.1, go run always uses -buildvcs=false #52338
Comments
|
@bcmills I ask you reconsider for the following context/reasons:
|
I'm in the same boat as @mgabeler-lee-6rs I believe. I'm using this interface as part of a web API which dumps version info on errors to aid in debugging. As of go1.18.1, this stopped working with While I definitely agree that The docs seem to support my confusion (from https://pkg.go.dev/cmd/go, emphasis mine):
It's entirely likely that I'm misunderstanding how |
I am also having a lot of trouble getting
The documentation for BuildInfo is laughably sparse, and there is no indication how to add entries to Settings nor how to modulate the version strings embedded in the executable for the main program. Maybe all of that info comes from what should be obvious places to those more familiar with go's package system than I am, but I have had no luck getting |
Let's say you require a package in go.mod...
And then you run it with go run...
Let's say we want to use This is a situation where -buildvcs=true with go run makes sense. |
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?
Attempting to extract VCS info from
debug.ReadBuildInfo()
when running undergo run
.go mod init example
main.go
git add . && git commit -m 'example'
go run .
What did you expect to see?
With go 1.18.0, I get:
What did you see instead?
With go 1.18.1:
Even worse,
-buildvcs=auto
is not recognized:Even even worse,
-buildvcs=true
is ignored:The text was updated successfully, but these errors were encountered: