-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Description
Currently, cargo run has a big footgun: if you modify src/bootstrap/bin/rustc.rs (or rustdoc.rs), it won't be rebuilt until you manually run cargo build --bins. I tried avoiding this in #94828 by running that automatically in bootstrap, but it discards various linker arguments and environment variables that prevent people from configuring the build.
A better solution is to introduce a binary that dispatches to different main functions, like rustup. If called as bootstrap it would run the main builder; if called as rustc or rustdoc it would run the logic currently in rustc.rs / rustdoc.rs; if called by any other name it should give a hard error.
I am happy to help mentor this work.
@rustbot label: +A-rustbuild +C-enhancement +E-mentor +E-help-wanted