4 ms·
The thing I want most from a build tool is not a nice DSL or portability. What u want most is hermetic builds. There are only a few told out there that do it. C
by zaphar 8y ago
The thing I want most from a build tool is not a nice DSL or portability. What u want most is hermetic builds. There are only a few told out there that do it. CMake is not one of them.
- nerdponx 8y agoWhat do you mean "hermetic" in this context, and why does CMake fail? Also, for my purposes (using both Windows and GNU/Linux at work), portability is a tremendous benefit.
- klodolph 8y agoIn this context, "hermetic" means that for every step in the build, all inputs and outputs are known by the build system. Hermetic builds are reproducible, and can be more easily done by a distributed build cluster. Hermetic build rules can also be run in a sandbox, so you can have assurances that your build scripts are correct. With non-hermetic builds, it's much more difficult to verify the correctness of your build rules, which means that you might get non-reproducible builds or you might get incorrect incremental builds. With hermetic builds, it's always safe to do an incremental build, no matter what state the repository is in.
- 01100011 8y agoIn 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.
- HappyJoy 8y agoWhich tools?
- klodolph 8y agoAll of the newest generation of build tools. - Bazel https://bazel.build/ https://bazel.build/ - Buck https://buckbuild.com/ https://buckbuild.com/ - Pants https://www.pantsbuild.org/index.html https://www.pantsbuild.org/index.html - Please https://please.build/ https://please.build/