-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
Suppress goroot path in tool builds #2952
Conversation
a5c4191
to
6b9b36c
Compare
Simple fix, simple test. This change LGTM. Very interesting find! I am very curious on how you came about and got down to troubleshooting this issue. There is a missing link somewhere between the I know the Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Minor nitpick regarding gofmt
The goroot is encoded in the output binary, but the goroot is different in different workspaces. As a result tool binaries (such as builder) are not reproducible. Bazel will have cache misses for build involving builder even if the resulting output from the build is repoducible. Similar go_binary builds, suppress the goroot path.
6b9b36c
to
c960c88
Compare
Indeed one minor change in the binary seems to end up making the hex dumps totally diverge. The tool that was useful here was to compare the output of
Confirmed, changing to a random string seemed to make not difference (e.g. all tests pass) |
Thank you! Merging |
The goroot is encoded in the output binary, but the goroot is different
in different workspaces. As a result tool binaries (such as builder) are
not reproducible. Bazel will have cache misses for build involving
builder even if the resulting output from the build is reproducible.
Similar to go_binary builds, suppress the goroot path in go_tool_binary
output so that the result in reproducible.
What type of PR is this?
What does this PR do? Why is it needed?
Like go_binary output, ensure go_tool_binary output is reproducible
Which issues(s) does this PR fix?
Fixes #2951