How to reproduce official rustc builds for Linux?

Hello!

I am trying to build Firefox/Tor Browser on Debian Jessie.
I can do that with the official rustc binaries, but I cannot with a rustc compiled by me (the build never ends, seems there is a deadlock in rustc).

So, I would like to try to compile rustc in the same environment as the official builds (same distro, same version, same configuration, etc...), but I cannot these information.
Does anyone know them?

We compile our toolchain to ensure byte-by-byte reproducibility (sometimes we need to add patches), and we run Linux builds on Debian Jessie to use an old glibc version, and extend the compatibility of the binaries we produce.

Thanks in advance!

https://github.com/rust-lang/rust/tree/master/src/ci contains all scripts used by CI. The builds happen on CentOS 7 to build with an old glibc version. You will need to modify it a bit to use the PGO profiles from the reproducible-artifacts component distributed with the official build I think to get byte-by-byte reproducibility.

Do you know where it gets stuck? And would you mind opening an issue for this?

3 Likes

Great, thank you very much!

I see, thanks for the heads up!

For the moment I'm not interested in verifying the official builds.
My plan is to use the same environment to get a (hopefully) working rustc and then switch components one by one (e.g., CentOS's compiler with the GCC we build), and see when things start breaking.

I know the phase of the Firefox build at which the build breaks (it's on gkrust-shared).
It doesn't contain much code, its lib.rs is mostly only extern crate something;
So, I think it's a sort of linking phase?

I can open an issue for sure, if people are willing to guide me on how to provide useful information :smile:.
But I'd do that when I can find what breaks the builds exactly, so that I will be able to provide more information.

We were build without --set rust.jemalloc.
Adding it solves the problem.

However, I've been trying only with 1.60 (to match Mozilla's toolchain).
I will try with the latest rustc sources before opening an issue.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.