-
Notifications
You must be signed in to change notification settings - Fork 492
cargo_build_script is non determnistic when compiling cc_libraries #3481
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
base: main
Are you sure you want to change the base?
Conversation
46e0423
to
e5e18d2
Compare
right now this example demonstrates that DEBUG in CC_libraries built with build.rs is non deterministic. If you want to see the LTO symbols be non deterministic I think you have to setup a cross compilation which I haven't setup yet. |
Thanks for putting this together! I don't quite see the same thing when I run it - I see:
I've tried this on both macOS and Ubuntu 20.04 - what platform are you running on? Maybe you have a docker image you can point me at? And possibly share the diffoscope output? |
shucks... it works on ubuntu 22.04 for me and osx 15.5
|
@illicitonion I see debug symbols changing in the ring library. I think to get the lto symbols to change it has to be setup in cross compilation mode |
|
||
# Define the build command with flags (modify this to add/change flags) | ||
# Example: BUILD_CMD="bazel build --noremote_accept_cached --verbose_failures --sandbox_debug" | ||
BUILD_CMD="bazel build --noremote_accept_cached --@rules_rust//rust/settings:lto=thin" |
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.
This should build the target for you locally if you don't want to use the shell script:
cd examples/ring_example
bazel build --noremote_accept_cached --@rules_rust//rust/settings:lto=thin @crates//:ring
run:
cd examples/ring_example
./test_deterministic.sh