bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Reproducibility?

Open luser opened this issue 5 years ago • 4 comments

What specific issues are you seeing around reproducibility? The Debian folks have spent a ton of time on these issues and have a nice set of docs on ways to work around sources of nondeterminism in builds. Given that older versions of rustc are what they are it'd be great to find a way to at least have reproducible results from this project.

luser avatar Feb 25 '20 13:02 luser

I don't know whether this process is reproducible since I have only run it once, but it might be. I would be interested to find out.

The note about reproducibility in the readme is just to say rustc is not yet in a state where we could get this bootstrap chain to converge with Mozilla's chain.

I don't plan to spend much more time working on this but I would happily accept PRs that achieve better reproducibility or convergence.

dtolnay avatar Feb 25 '20 19:02 dtolnay

Totally understood! If you or someone else have binaries laying around from running the scripts here a simple first thing to try would be to compare them against the official rustc release binaries using diffoscope which was built for precisely this purpose. It has nice format-specific diff output so it's often easy to see what the problems are.

luser avatar Feb 25 '20 19:02 luser

Exciting news — I ran a second bootstrap today, and rustc 1.41.0 is an exact match to my previous bootstrap. It is the first version for which the hashes match the previous chain; 1.40.0 and earlier do not match.

I think this means the answer is this setup as of recently does result in reproducible binaries, at least within the same host environment.

Here is a tgz containing the resulting /build/rustc-1.41.0/build/x86_64-unknown-linux-gnu/stage2/bin/rustc and /build/rustc-1.41.0/build/x86_64-unknown-linux-gnu/stage2/lib/librustc_driver-049f0aaf254e8547.so in case anyone wants to look at a diffoscope vs their own chain: https://github.com/dtolnay/bootstrap/raw/429054cfbcb5892bab93a407fb93f07138673840/bootstrap-1.41.0.tar.gz

dtolnay avatar Feb 26 '20 03:02 dtolnay

Hello! Reproducible builds are possible when using LLVM 7 and up. I could build all the Rusts versions from the bootstrapped 1.29 to 1.49 reproducibly, building the artifacts twice on the same environment. This is using GNU Guix and this commit: https://git.savannah.gnu.org/cgit/guix.git/commit/?h=core-updates&id=df93fc21a48047988b032ead90b0869491c834c8. I hope that helps :-).

Apteryks avatar Feb 05 '21 15:02 Apteryks