3 ms·
I can see the arguments in favor of deterministic/reproducible builds. What are the arguments against it?
by dgellow 7y ago
I can see the arguments in favor of deterministic/reproducible builds. What are the arguments against it?
- pjc50 7y agoThere'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.
- dfgdghdf 7y agoYou can make the date an input to the build and push it to the configuration.
- marcyb5st 7y agoIn 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/ https://bazel.build/
- muststopmyths 7y agoThat 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.
- nickpsecurity 7y agoIt 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_68#c_rxjicd 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 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 http://se.ethz.ch/~meyer/publications/computer/contract.pdf https://www.hillelwayne.com/post/contracts/ https://www.hillelwayne.com/post/contracts/ https://www.hillelwayne.com/post/pbt-contracts/ https://www.hillelwayne.com/post/pbt-contracts/
- twic 7y agoIt 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.
- patrec 7y agoIncremental compilation tends to conflict with fully deterministic builds. But you don't need incremental compilation for the final artifact.
- patthebunny 7y agoEffort required vs rewards for doing it.