Skip to content

Commit f7dcfcd

Browse files
committed
Don't build rustc without std
- Set rustc to build only when explicitly asked for This allows building the stage2 rustc artifacts, which nothing depends on. Previously the behavior was as follows (where stageN <-> stage(N-1) artifacts, except for stage0 libstd): - `x.py build --stage 0`: - stage0 libstd - stage1 rustc (but without putting rustc in stage0/) This leaves you without any rustc at all except for the beta compiler (rust-lang#73519). This is never what you want. - `x.py build --stage 1`: - stage0 libstd - stage1 rustc - stage1 libstd - stage1 rustdoc - stage2 rustc This leaves you with a broken stage2 rustc which doesn't even have libcore and is effectively useless. Additionally, it compiles rustc twice, which is not normally what you want. - `x.py build --stage 2`: - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 rustdoc and tools This builds all tools in release mode. This is the correct usage for CI, but takes far to long for development. Now the behavior is as follows: - `x.py build --stage 0`: - stage0 libstd This is suitable for contributors only working on the standard library, as it means rustc never has to be compiled. - `x.py build --stage 1`: - stage0 libstd - stage1 rustc - stage1 libstd - stage1 rustdoc This is suitable for contributors working on the compiler. It ensures that you have a working rustc and libstd without having to pass `src/libstd` in addition. - `x.py build --stage 2`: - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 libstd - stage2 rustdoc This is suitable for debugging errors which only appear with the stage2 compiler. - `x.py build --stage 2 src/libstd src/rustc` - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 libstd - stage2 rustdoc, tools, etc. - stage2 rustc artifacts ('stage3') This is suitable for CI, which wants all tools in release mode. However, most of the use cases for this should use `x.py dist` instead, which builds all the tools without each having to be named individually.
1 parent 0192fa4 commit f7dcfcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bootstrap/compile.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,10 @@ pub struct Rustc {
446446
impl Step for Rustc {
447447
type Output = ();
448448
const ONLY_HOSTS: bool = true;
449-
const DEFAULT: bool = true;
449+
const DEFAULT: bool = false;
450450

451451
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
452-
run.all_krates("rustc-main")
452+
run.path("src/rustc")
453453
}
454454

455455
fn make_run(run: RunConfig<'_>) {

0 commit comments

Comments
 (0)