@@ -653,6 +653,20 @@ mod dist {
653653 & [ "compiler/rustc" . into ( ) , "library" . into ( ) ] ,
654654 ) ;
655655
656+ assert_eq ! ( builder. config. stage, 2 ) ;
657+
658+ // `compile::Rustc` includes one-stage-off compiler information as the target compiler
659+ // artifacts get copied from there to the target stage sysroot.
660+ // For example, `stage2/bin/rustc` gets copied from the `build/host/stage1-rustc` build directory.
661+ assert_eq ! (
662+ first( builder. cache. all:: <compile:: Rustc >( ) ) ,
663+ & [
664+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
665+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 ) ,
666+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 1 ) ,
667+ ]
668+ ) ;
669+
656670 assert_eq ! (
657671 first( builder. cache. all:: <compile:: Std >( ) ) ,
658672 & [
@@ -664,13 +678,34 @@ mod dist {
664678 std!( TEST_TRIPLE_1 => TEST_TRIPLE_3 , stage = 2 ) ,
665679 ]
666680 ) ;
667- assert_eq ! ( builder . cache . all :: <compile :: Assemble > ( ) . len ( ) , 4 ) ;
681+
668682 assert_eq ! (
669- first( builder. cache. all:: <compile:: Rustc >( ) ) ,
683+ first( builder. cache. all:: <compile:: Assemble >( ) ) ,
670684 & [
671- rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
672- rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 ) ,
673- rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 1 ) ,
685+ compile:: Assemble {
686+ target_compiler: Compiler {
687+ host: TargetSelection :: from_user( TEST_TRIPLE_1 ) ,
688+ stage: 0
689+ }
690+ } ,
691+ compile:: Assemble {
692+ target_compiler: Compiler {
693+ host: TargetSelection :: from_user( TEST_TRIPLE_1 ) ,
694+ stage: 1
695+ }
696+ } ,
697+ compile:: Assemble {
698+ target_compiler: Compiler {
699+ host: TargetSelection :: from_user( TEST_TRIPLE_1 ) ,
700+ stage: 2
701+ }
702+ } ,
703+ compile:: Assemble {
704+ target_compiler: Compiler {
705+ host: TargetSelection :: from_user( TEST_TRIPLE_2 ) ,
706+ stage: 2
707+ }
708+ } ,
674709 ]
675710 ) ;
676711 }
0 commit comments