-
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
Breaking change: runtime/debug.ReadBuildInfo no longer populates BuildInfo.Main in 1.18 #51831
Comments
This is CL 339170 and working as intended. |
@michaelmatloob @seankhliao I'm rather surprised by this otherwise undocumented change in behaviour, I would expect at least some mention of this in the release notes. @ianlancetaylor can we amend the notes to help other folks from tripping over this change? Could you also please confirm that my understanding below is correct? I am not sure I fully understand the consequences of this change. For future readers who stumble upon this: It looks like as part of the workspaces feature, some
to
produces the expected output:
Note the presence of |
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?
https://pkg.go.dev/runtime/debug#ReadBuildInfo no longer sets the
Main
field on https://pkg.go.dev/runtime/debug#BuildInfo. We usedebug.ReadBuildInfo
to make it so that code from https://github.com/bufbuild/buf/tree/main/private can only be imported by projects in github.com/bufbuild - our version of "organization-private". We do this via https://github.com/bufbuild/buf/blob/main/private/usage/usage.go. See bufbuild/homebrew-buf#8What did you expect to see?
A value for the
Main.Path
field offoo
.In 1.17.8 this is:
What did you see instead?
In 1.18 this is:
Formatting differences are expected based on the work in https://github.com/golang/go/commits/master/src/runtime/debug/mod.go, but no longer producing the
Main
field is a breaking change. I've verified that no fields are set as well, and that this is not just formatting, by specifically printingbuildInfo.Main.Path
from the code above (which is empty).The text was updated successfully, but these errors were encountered: