-
Notifications
You must be signed in to change notification settings - Fork 171
Improved reproducible builds #806
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
Conversation
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.
Pull Request Overview
This PR implements reproducible builds for the rbuilder project by standardizing the build environment and removing version-specific constraints. The changes introduce a Docker-based reproducible build system and add CI workflows to verify build reproducibility across different machines.
Key Changes:
- Removed hardcoded Rust version constraint to allow more flexible toolchain management
- Added Docker-based reproducible build infrastructure with controlled environment variables
- Implemented CI workflow to test and verify build reproducibility across different Ubuntu versions
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| rust-toolchain.toml | Removed hardcoded Rust version constraint |
| docker/Dockerfile.reproducible | New Dockerfile for reproducible builds with snapshot repositories and controlled build environment |
| crates/rbuilder/Cargo.toml | Added jemalloc-unprefixed feature flag for memory allocator configuration |
| Makefile | Added RBUILDER_OPERATOR_FEATURES variable, JEMALLOC_OVERRIDE environment variable, and fixed .PHONE typo to .PHONY |
| .github/workflows/reprotest.yml | New workflow to test build reproducibility by comparing binaries built on different machines |
| .github/workflows/release.yaml | Updated release workflow to use Docker-based reproducible builds instead of direct compilation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/reprotest.yml
Outdated
| echo "Machine 2 hashes:" | ||
| cat machine-2/checksums.sha256 | ||
| if [ cmp -s machine-1/checksums.sha256 machine-2/checksums.sha256 ]; then |
Copilot
AI
Nov 7, 2025
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.
The conditional statement syntax is incorrect. The cmp -s command should not be inside [ ] brackets. Use if cmp -s directly or use diff -q with proper conditional syntax.
| if [ cmp -s machine-1/checksums.sha256 machine-2/checksums.sha256 ]; then | |
| if cmp -s machine-1/checksums.sha256 machine-2/checksums.sha256; then |
Signed-off-by: bakhtin <a@bakhtin.net>
| @@ -1,4 +1,3 @@ | |||
| [toolchain] | |||
| channel = "stable" | |||
| version = "1.88.0" | |||
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.
version is not recognized as the valid option and ignored: https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file
| - name: Install rust | ||
| run: | | ||
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
| - name: Build reproducible binary with Docker | ||
| run: | | ||
| RUST_TOOLCHAIN=$(rustc --version | cut -d' ' -f2) |
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.
If rust is installed only for latest version, would it be better to just pin the version here instead of installing toolchain?
Same for release.yaml.
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.
I install rust toolchain just to parse rust-toolchain.yml file and pull the correct Docker/Rust image. rust-toolchain may contain something like stable or a numerical version of Rust. So it is hard to directly parse the file without (some) rust toolchain installed
| cmake | ||
| WORKDIR /build | ||
| COPY . . | ||
| RUN SOURCE_DATE=1730000000 make build && make build-deb |
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 use last commit timestamp as SOURCE_DATE?
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.
It may not even be a git tree (e.g., if downloaded as a tar archive from GH) so I don't want to rely on it
📝 Summary
💡 Motivation and Context
✅ I have completed the following steps:
make lintmake test