Restructure staged build / cross-compile architecture for speed #3772
Labels
I-slow
Issue: Problems and improvements with respect to performance of generated code.
Milestone
Right now a complete stageN image is composed of artifacts from multiple stages' compilers. This intermixing of stages makes us do more work than we should. It also causes unusual bugs like #3660.
At it's most simple, we want the build to consist of downloading the snapshot compiler and building the binaries once. Right now the closest we can get to that is a stage0 build, but the result of a stage0 build is still using the snapshot compiler. To get a rebuilt compiler you have to build stage1, but building stage1 forces you to rebuild the host libraries.
To recap, we distinguish between the host and target binaries. They live on different places on disk, but they are always built as target binaries, then 'promoted' to the next stage as host binaries.
It looks like this:
When we create stage0 on disk we drop the snapshot binaries into the stage0 host directories, then build the stage0 target directories. This is not right.
stage0 should be only snapshot binaries, stage1 should be built entirely by stage0, etc. Then a basic build is just download the snapshot and build all the binaries (once) directly to their final on-disk stage1 location. That's it.
Related to #2237
The text was updated successfully, but these errors were encountered: