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

Tool binaries (like builder) are not reproducible and break the cache #2951

Closed
adobke opened this issue Sep 15, 2021 · 0 comments · Fixed by #2952
Closed

Tool binaries (like builder) are not reproducible and break the cache #2951

adobke opened this issue Sep 15, 2021 · 0 comments · Fixed by #2952

Comments

@adobke
Copy link
Contributor

adobke commented Sep 15, 2021

What version of rules_go are you using?

v0.28.0

What version of gazelle are you using?

v0.22.3

What version of Bazel are you using?

4.0.0

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

Linux, x86

Any other potentially useful information about your toolchain?

N/A

What did you do?

Between two workspaces, the builder tool is not reproducible as it includes the full goroot in the binary. This is evident when comparing the execution logs (https://docs.bazel.build/versions/main/remote-execution-caching-debug.html). Because the builder binary can be different in different workspaces, we may lose the ability to make use of remote caching. This case of non-reproducibility was already fixed in go_binary rules.

Reproduce very quickly like so:

git clone https://github.com/bazelbuild/rules_go.git rules_go1
cd rules_go1
bazel build @go_sdk//:builder
sha256sum bazel-bin/external/go_sdk/builder
# <first hash>  bazel-bin/external/go_sdk/builder

git clone https://github.com/bazelbuild/rules_go.git rules_go2
cd rules_go2
bazel build @go_sdk//:builder
sha256sum bazel-bin/external/go_sdk/builder
# <second hash>  bazel-bin/external/go_sdk/builder

What did you expect to see?

These binaries should have the same hash and should be identical

What did you see instead?

They are not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant