Build once
Khem Raj December 24, 2024 #metaThere are mainly two ways to consume software, prebuilt and source forms. Both have advantages and downsides.
Consuming only prebuilts hinder's customizations and can be a downside when targetted at customized hardware since it may not run all optimized for the target.
Distributing as source overcomes above problem and can be customized to core but it requires to re-create the build environment and maintain it for the life of products.
Software projects have become growing in lines of code at a fast pace in recent years, Linux Kernel has ~35M lines, Chrome is around 30M lines and LLVM is growing at 10% year over year It becomes challanging to distribute it as source and expect every user to compile own copy as they may not have systems powerful enough to do so. Therefore recommending to build everything from source as default may not be optimal for developers on the other hand it might be a requirement for products. So we need systems where reuse of binary build artifacts is reliable at the same time if one needs to build a package/component from source it should not be a herculean task either.
A system could be put together from binary artifacts if a standard profile is used, but when customizations are added, the system could be smart to only rebuild the pieces which are absolutely needed to be rebuilt including the dependencies. A slice of the system is rebuilt not whole system.
Size of software will keep growing, we need smart ways to build, distribute, consume and develop it.