-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Add reproducible build verification to bootstrap #144669
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: master
Are you sure you want to change the base?
Conversation
This change introduces a new `--reproducible` flag and `build.reproducible` config option that performs a verification of build reproducibility by: 1. Building the compiler twice in separate directories 2. Comparing critical artifacts (binaries, shared libraries, RLIBs) 3. Reporting any differences found Key features: - Can be enabled via CLI flag or config file - Generates a detailed HTML report with `--html` flag - Only runs for actual build commands (not help/other commands) - Focuses on comparing critical compiler artifacts - Provides clear success/failure output The verification helps ensure the compiler produces identical outputs across builds, which is important for security and deterministic builds. Signed-off-by: Sunil Dora <[email protected]>
The job Click to see the possible cause of the failure (guessed by this bot)
|
Hi, thanks for the PR. I don't think that we want to check reproducibility in this way. Definitely not in Python; we want to avoid modifications to the Python code in bootstrap, instead we want to eventually remove that code (once we finally get to it). I think that the reproducibility check shouldn't live inside bootstrap, because for the reproducibility check it will be necessary to invoke bootstrap multiple times. Also in bootstrap (the Rust part) itself we aggressively cache build steps, so running something twice is not at all trivial. I think that it would make sense to create a reproducibility checker as a separate (Rust) tool living inside of Please also examine the discussion in #139793, where we talked about the CI aspects of checking reproducibility of rustc builds. |
# Optionally, you can generate a detailed HTML report using the CLI: | ||
# ./x.py build --reproducible --html report.html | ||
# The report is saved to the specified path, and a copy is placed in the Rust source directory. | ||
#build.reproducible = false |
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.
Maybe call this test-reproducible
instead? This option doesn't change anything that causes the build to be reproducible when it otherwise would not be.
|
||
differences.extend(compare_shared_libraries(dir1, dir2)) | ||
|
||
differences.extend(compare_rlibs(dir1, dir2)) |
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.
Diffing all files in the sysroot would be better, right?
This change introduces a new
--reproducible
flag andbuild.reproducible
config option that performs a verification of build reproducibility by:Key features:
--html
flagThe verification helps ensure the compiler produces identical outputs across builds, which is important for security and deterministic builds.