I’ve noticed that when newcomers come to hack on
rustc, one of the first obstacles they hit is the question of “How do I execute the compiler I just built?” Over the years it seems like every rustc dev has crafted their own custom solution to this. I decided to package up my particular solution (a script I’ve been using since like 2011…) so that other people could reuse it:
It’s now packaged up as a rustup toolchain, but the basic idea is that – once you set it up – you can do
rustc ... and it will check your current directory, find your current root directory, and execute the rustc that you built. You can select which stage to use via
rustc --stage1 or
rustc --stage2 and so forth.
I’m curious to get feedback before I publicize this more widely. Does this work for people? Is there some better way to do it that I’m just unaware of?