Reproducible builds


Reproducible builds, also known as deterministic compilation, is a process of compiling software which ensures the resulting binary code can be reproduced. Source code compiled using deterministic compilation will always output the same binary.
Reproducible builds can act as part of a chain of trust; the source code can be signed, and deterministic compilation can prove that the binary was compiled from trusted source code.

Methods

For the compilation process to be deterministic, the input to the compiler must be the same, regardless of the build environment used. This typically involves normalizing variables that may change, such as order of input files, timestamps, locales, and paths.
Additionally, the compilers must not introduce non-determinism themselves. This sometimes happens when using hash tables with a random hash seed value. It can also happen when using the address of variables because that varies from address space layout randomization.
Build systems, such as Bazel and Gitian, can be used to automate deterministic build processes.

History

One of the older projects to promote reproducible builds is the Bitcoin project with Gitian. Later, in 2013, the Tor project started using Gitian for their reproducible builds. Then Debian: by July 2017 more than 90% of the packages in the repository have been proven to build reproducibly.
In November 2018, the Reproducible Builds project joined the Software Freedom Conservancy.
F-droid uses reproducible builds to provide a guarantee that the distributed APKs use the claimed free source code.