4 ms·
In my experience, this is usually handled with a combination of source control and containers(Docker, but more commonly just a chroot image).
by 01100011 8y ago
In my experience, this is usually handled with a combination of source control and containers(Docker, but more commonly just a chroot image).
- klodolph 8y agoI'm not sure how source control is connected. Normally, I want hermetic builds whether or not the files I am building are checked into source control yet.
- 01100011 8y agoWell if you want repeatability, I'm assuming that means over some long timeframe, which means you need a way to get the code as it was at some point. You then need to build that code using a consistent set of tools and libraries, which is where the chroot comes in.
- klodolph 8y agoRepeatability definitely does not mean some long time frame, it's over any time frame. Short time frames have the largest impact, because it allows you to use a shared cache for build products. One big chroot around your whole build system isn't enough, you can run into nondeterminism problems due to relative ordering of different build steps during execution. This is why it's nice that the new build systems make each individual step hermetic, because you can make a separate chroot for each individual step (Bazel executes each build step in a separate sandbox). This allows you to cache all intermediate results, share the cache, and get the same results both for clean and incremental builds, repeatably. It's also easier to remove nondeterminism from individual build steps rather than looking at the whole build.
- 01100011 8y agoCool, didn't know that. I like the idea of breaking things up into steps. So you're saying this takes care of race conditions in the build where things may happen out of order even if you have a fixed environment?
- klodolph 8y agoYes. Since the different steps are executing in different sandboxes, you can be confident that there are no race conditions between them.