News for hackers. Stuff that matters.
Re:An introduction to deterministic builds with C/C++ by dgellow on Monday September 02, 2019 @08:26AM (#20858641)
I can see the arguments in favor of deterministic/reproducible builds. What are the arguments against it?
Re:An introduction to deterministic builds with C/C++ by marcyb5st on Monday September 02, 2019 @08:39AM (#20858709)
In my personal experience, is that you need to sandbox everything and that could potentially make the dev experience cumbersome. For example, you might need to bring into the sandbox an external tool that signs your binaries and depending on the build system and your needed add-on this can be a pain in the neck.

Luckily, there are some good tools out there like bazel [1] (the open source version of what we use internally at Google) that can help you get this right.

[1] https://bazel.build/

Re:An introduction to deterministic builds with C/C++ by pjc50 on Monday September 02, 2019 @08:34AM (#20858678)
There's no good reason to make builds deliberately nondeterministic, but it is time-consuming to set up and maintain, and forces tooling choices along the way.

I suppose it rules out including build date in the binaries.

Re:An introduction to deterministic builds with C/C++ by dfgdghdf on Monday September 02, 2019 @09:06AM (#20858869)
You can make the date an input to the build and push it to the configuration.
Re:An introduction to deterministic builds with C/C++ by muststopmyths on Monday September 02, 2019 @10:37AM (#20859327)
That sometimes it's just not necessary ? The main advantage IMO seems to be security (i.e., you can verify that a given build environment produced exactly the same binary that you downloaded, so the NSA or FSB probably hasn't embedded a Trojan in it). If you need this, then you obviously need reproducible builds.

The other advantages and why you may not need them :

- build acceleration : There are ways to do this without caching binaries. Incredibuild, for example does an excellent job (at least on Windows. Haven't used their Linux version). It costs money, so you have to figure out your priorities there. In my experience their support is excellent and it usually works very well.

- Storage savings : The premise here is that if a binary hasn't changed, there is no need to store it again with a new build. Maybe I'm getting rid of my old builds every 30 days (or whatever) so I don't really care about this either.

Absolutism is silly. You should analyze the advantages and costs of doing something instead of doing it because Google (or insert SV darling here) does it.

Re:An introduction to deterministic builds with C/C++ by nickpsecurity on Monday September 02, 2019 @10:38AM (#20859333)
It was originally about stopping backdoors done post-compile but before software delivery. They were specifically worried about attacks like Paul Karger's compiler-compiler attack that Ken Thompson made famous. The thing is, almost all attacks are in the code, configuration, etc with transport security and reputation covering most of the risk they're trying to address. It's enormous effort with tiny security gain. I explain here:

https://lobste.rs/s/7zbbzr/reproducing_linux_builds_firefox_...

Another argument is that reproducible builds, at least the final form being reproducible, creates a monoculture that lets people be hit with exploits more easily. Cutting-edge research in CompSci has produced numerous techniques to use compilers to automatically secure source either by addressing root causes (eg Softbound + CETS) or obfuscating the program (eg instruction set randomization by Barrantes et al.). The latter methods are affected in that the hashes won't match when it's working. If you're trying to understand, they usually do things similar to the kinds of mitigations in OpenBSD (below) just with compilers. Personally, the state of software security would make me prioritize running it through a hardening tool over it being reproducible.

https://www.openbsd.org/security.html

The main way reproducible builds help is with debugging. Design-by-contract with runtime checks on can do that, too, on top of a lot of other benefits. They can have a debug version with checks on that people use just for diagnosing problems. At this point, reproducible builds might be easier than getting that going, though, due to all the work already put it. It also looks like some compiler modifications upstream could help a lot, too.

http://se.ethz.ch/~meyer/publications/computer/contract.pdf

https://www.hillelwayne.com/post/contracts/

https://www.hillelwayne.com/post/pbt-contracts/

Re:An introduction to deterministic builds with C/C++ by twic on Monday September 02, 2019 @01:18PM (#20860504)
It means there is some metadata you can't include in the output: the time it was built, the user who built it, the host and path where it was built. Sometimes that stuff is rather useful.
Re:An introduction to deterministic builds with C/C++ by patrec on Monday September 02, 2019 @03:17PM (#20861218)
Incremental compilation tends to conflict with fully deterministic builds. But you don't need incremental compilation for the final artifact.
Re:An introduction to deterministic builds with C/C++ by patthebunny on Thursday September 05, 2019 @03:15PM (#20889865)
Effort required vs rewards for doing it.