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: include GOROOT in linkActionID hash #22475

Closed
rsc opened this issue Oct 28, 2017 · 2 comments
Closed

cmd/go: include GOROOT in linkActionID hash #22475

rsc opened this issue Oct 28, 2017 · 2 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. release-blocker
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Oct 28, 2017

Going to comment out the use of GOROOT in the linkActionID hash to try to make progress on CL 73216. We need to figure out what to do about GOROOT and the linker. all.bash gets a bit fussy when GOROOT changes unexpectedly.

The more general problem is that if you build a distribution with GOROOT=/usr/local/go and then move it to /home/gopher/go and run it from there, cmd/go will decide (correctly) that all the commands are stale, because it knows that if they were rebuilt from their current sources and location they would come out different - they'd use GOROOT=/home/gopher/go instead of /usr/local/go.

There are two uses of GOROOT in the result. The first is @crawshaw's recent GOROOT override, which I think is probably wrong in some way (#22155), but the second is the source file names. I think we do want binaries built with Go from /home/gopher/go to report that Printf is in /home/gopher/go/src/fmt/print.go in their debug information. We could decide to just say "go" instead of "/home/gopher/go" I suppose.

The go command doesn't check cmd/* for staleness in ordinary builds. This only really affects a few tests during run.bash. So maybe we should fix the tests and not worry about the general case.

This issue is to track deciding what to do and uncommenting the GOROOT code in linkActionID.

@rsc rsc added this to the Go1.10 milestone Oct 28, 2017
@crawshaw
Copy link
Member

I agree that we want debug information to report /home/gopher/go/src/fmt/print.go, so that sophisticated debug tools can work with the source.

@ianlancetaylor ianlancetaylor added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. release-blocker labels Dec 6, 2017
@gopherbot
Copy link

Change https://golang.org/cl/86835 mentions this issue: cmd/link: set runtime.GOROOT default during link

@golang golang locked and limited conversation to collaborators Jan 9, 2019
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants