-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Deploy jars differ when compiled with the same toolchain on different platforms #17316
Comments
We have also been surprised to see this indirect leak of platform information into @cushon Would you accept a PR adding a flag that makes it so that |
I found an internal bug from 2016 asking why bazel/src/tools/singlejar/output_jar.cc Lines 104 to 106 in 05bcb51
I think we should try just changing the default behaviour to use the build target. Let me do some testing and see anything is relying on the current behaviour. |
If set, and build stamping is enabled, it is used as the `build.target` property instead of the output path. #17316 PiperOrigin-RevId: 506932307 Change-Id: I06a710445ab79e98fc3794b7eb81a9abd61dce69
#17316 PiperOrigin-RevId: 508700297 Change-Id: Iced40505b32aa4e6aa32fa969ef0c75224f2e5bc
This is fixed by cc4af3e |
If set, and build stamping is enabled, it is used as the `build.target` property instead of the output path. #17316 PiperOrigin-RevId: 506932307 Change-Id: I06a710445ab79e98fc3794b7eb81a9abd61dce69
#17316 PiperOrigin-RevId: 508700297 Change-Id: Iced40505b32aa4e6aa32fa969ef0c75224f2e5bc
Description of the bug:
When building a deploy_jar target, Bazel will helpfully add a
build-data.properties
file. This contains some useful information, but part of the data is abuild.target
which contains a path to the output file and not (as the name would suggest) the target being built.This means that jars built with the same version of the same java toolchain but on different platforms will differ, but only because of this file. This reduces our ability to have stable cross-platform builds.
I discovered this while attempting to add a test for
rules_jvm_external
to ensure that all prebuilt outputs are up-to-date. While the artifacts are most assuredly okay, the test failed since I work on macOS and the builds happen on Linux.What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Create a simple
java_binary
target and compile it on Linux and macOS using the same version of the same java toolchain (eg. remote_jdk11). Compare the shasums. They should be identical. They are not.Which operating system are you running Bazel on?
macOS and Linux
What is the output of
bazel info release
?release 6.0.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: