Description
The way the build currently works makes a distinction between the 'host' binaries, which are used only to run the toolchain, and the 'target' binaries, which are targeted by the toolchain. There are separate locations on disk for each. As the build progresses between stages, binaries are promoted from the target directories to the host directories, then the host bins used to build the target bins within the next stage.
This has a few problems:
- It doesn't make sense for cross compiles in general, since non-build-triple hosts don't need to bootstrap. This works in our only working multi-host cross-compile currently because we're just doing x86->x86_64.
- It means that programs compiled by rustc cannot (reliably) be used as plugins to rustc itself since they are linking to different versions of libsyntax/librustc. This would make procedural macros pretty difficult.
My preference is to not intermix binaries from different stages, not have the host libraries at all, link rustc to the same target libraries as others in the same stage, use previous stages to build the entirety of the next stage.
This would have it's own bootstrapping issues, and the last time I made this change we decided not to do it because of some new difficulty to the snapshotting/bootstrapping process that I don't recall. But any build arrangement for a self-bootstrapping compiler is going to have difficulties and I think this would be the least surprising way to do the build in general.