Skip to content

Added determinism inspection workflow #3346

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

UebelAndre
Copy link
Collaborator

@UebelAndre UebelAndre commented Mar 15, 2025

This change adds a github workflow that generates a report of whether or not rules_rust is deterministic on a particular platform.

How it works:
The workflow checks out main of rules_rust and builds //... back to back from two different directories. Each output within the output_user_root directory is hashed for each checkout and compared. Any hash which is not identical indicates a non-deterministic output.

The workflow is currently configured to run on Linux, MacOS, and Windows.

@UebelAndre UebelAndre force-pushed the prog branch 14 times, most recently from 223d1d6 to 3203b14 Compare March 18, 2025 01:32
@UebelAndre
Copy link
Collaborator Author

UebelAndre commented Mar 20, 2025

The windows side of this is running into bazelbuild/bazel#19710

And I ended up needing to switch the --output_user_root from D:/r to C:/r

@UebelAndre UebelAndre force-pushed the prog branch 8 times, most recently from 91b060b to 24616b6 Compare March 24, 2025 14:29
@UebelAndre UebelAndre marked this pull request as ready for review March 24, 2025 14:34
@UebelAndre UebelAndre enabled auto-merge March 24, 2025 14:34
@UebelAndre
Copy link
Collaborator Author

UebelAndre commented Mar 24, 2025

Results show targets are not deterministic 😞

this is something we’ll have to fix over time

https://github.com/bazelbuild/rules_rust/actions/runs/14020126362

@UebelAndre UebelAndre requested a review from illicitonion March 29, 2025 01:12
@bitemyapp
Copy link

bitemyapp commented Apr 16, 2025

@UebelAndre I'm very interested in this. I have a need for determinism, are you using incremental=false? I have a vague recollection that reproducible builds generally require that the build not be incremental. To clarify, that's just about making the per-crate builds not be incremental, it shouldn't do any harm to the bazel build graph incrementality.

@UebelAndre
Copy link
Collaborator Author

@UebelAndre I'm very interested in this. I have a need for determinism, are you using incremental=false? I have a vague recollection that reproducible builds generally require that the build not be incremental. To clarify, that's just about making the per-crate builds not be incremental, it shouldn't do any harm to the bazel build graph incrementality.

Does incremental=false (the cargo setting?) actually have any impact here? Actions will be run in a sandbox and thus would never be incremental, right?

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 this pull request may close these issues.

2 participants