-
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: module info (from runtime/debug.modinfo) dropped from final binary if unused #28753
Comments
It looks like the linker is stripping out the debug information for some reason: if I modify the program to access it at run-time, then
|
Yeah, it's definitely being pruned out for some reason. An explicit
|
@ianlancetaylor, @randall77, @josharian, @jayconrod, @heschik: It is unused, but defined in package |
I guess https://golang.org/cl/157097 removed the only use of the variable, allowing it to be eliminated? |
Maybe, but @hyangah filed this issue back in November, and that commit only landed this week. I guess it was fixed incidentally and then regressed again! |
Change https://golang.org/cl/158357 mentions this issue: |
Dependency on submodule (in the same repo) sometimes doesn't appear in the debug modinfo.
Tested with Go built from the tip today
How to reproduce:
I expected the module github.com/hyangah/modtest7/hello is listed as a dependency, but it didn't appear.
go build -x -v output
I suspect this is related to #28083.
The text was updated successfully, but these errors were encountered: