(after lots of docs and experimenting)
My understanding is that stage0 refers to the very initial bootstrap compiler. It can be downloaded by x.py (the default), or with some configuration, it can be provided by the system instead. However, under no circumstances should any part of it be compiled by x.py - it always comes from somewhere else.
However, this is not what I find. In my setup, I do not use the default download-the-bootstrap-compiler behavior. Instead I’ve installed a suitable version of cargo and rustc elsewhere, and set the rustc= and cargo= options in config.toml to point to them.
When I run x.py build --stage 0, I would expect that nothing happens - I’ve already provided a complete bootstrap compiler. However, it appears that this builds the full compiler. It populates the directories build/x86_64-unknown-linux-gnu/stage0-{rustc,std,sysroot,test}. There’s a fully working compiler at build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/rustc, which does reflect changes I’ve made to the source code. It doesn’t have RPATH set up though, and I have to invoke it with LD_LIBRARY_PATH pointing to each of build/x86_64-unknown-linux-gnu/stage0-{rustc,test,std}/x86_64-unknown-linux-gnu/release/deps.
So, what’s does stage0 actually mean? If I want the fastest edit-compile-test loop possible, is it always enough to build and test stage 0?