←back to thread

766 points bertman | 2 comments | | HN request time: 0.001s | source
Show context
geocrasher ◴[] No.43484909[source]

What is the significance of a reproducible build, and how is it different than a normal distribution?

replies(6): >>43484958 #>>43485126 #>>43487595 #>>43488312 #>>43489545 #>>43492115 #
csense ◴[] No.43487595[source]

Reproducible: If Alice and Bob both download and compile the same source code, Alice's binary is byte-for-byte identical to Bob's binary.

Normal: Before Debian's initiative to handle this problem, most people didn't think hard about all the ways system-specific differences might wind up in binaries. For example: __DATE__ and __TIME__ macros in C, parallel builds finishing in different order, anything that produces a tar file (or zip etc.) usually by default asks the OS for the input files' modification time and puts that into the bytes of the tar file, filesystems may list files in a directory in different order and this may also get preserved in tar/zip files or other places...

Why it's important: With reproducible builds, anyone can check the official binaries of Debian match the source code. This means going forward, any bad actors who want to sneak backdoors or other malware into Debian will have to find a way to put it in the source code, where it will be easier for people to spot.

replies(4): >>43488311 #>>43489316 #>>43494151 #>>43497265 #
1. floxy ◴[] No.43497265[source]

> __DATE__ and __TIME__ macros in C

So how do those work in these Debian reproducible builds? Do they outlaw those directives? Or do they set those based on something other than the current date and time? Or something else?

replies(1): >>43498343 #
2. progval ◴[] No.43498343[source]

The toolchain (eg. compiler) reads the time from an environment variable if present, instead of the actual time. https://reproducible-builds.org/docs/source-date-epoch/