File tree 1 file changed +21
-4
lines changed
src/tools/compiletest/src
1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -3632,12 +3632,29 @@ impl<'test> TestCx<'test> {
3632
3632
// annotated with `#[must_use]`.
3633
3633
rustc. arg ( "-Dunused_must_use" ) ;
3634
3634
3635
- // FIXME(jieyouxu): explain this!
3635
+ // > `cg_clif` uses `COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0` for running the rustc
3636
+ // > test suite. With the introduction of rmake.rs this broke. `librun_make_support.rlib` is
3637
+ // > compiled using the bootstrap rustc wrapper which sets `--sysroot
3638
+ // > build/aarch64-unknown-linux-gnu/stage0-sysroot`, but then compiletest will compile
3639
+ // > `rmake.rs` using the sysroot of the bootstrap compiler causing it to not find the
3640
+ // > `libstd.rlib` against which `librun_make_support.rlib` is compiled.
3641
+ //
3642
+ // The gist here is that we have to pass the proper stage0 sysroot if we want
3643
+ //
3644
+ // ```
3645
+ // $ COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0
3646
+ // ```
3647
+ //
3648
+ // to work correctly.
3649
+ //
3650
+ // See <https://github.com/rust-lang/rust/pull/122248> for more background.
3636
3651
if std:: env:: var_os ( "COMPILETEST_FORCE_STAGE0" ) . is_some ( ) {
3637
- let mut stage0_sysroot = build_root. clone ( ) ;
3638
- stage0_sysroot. push ( "stage0-sysroot" ) ;
3652
+ let stage0_sysroot = {
3653
+ let mut p = build_root. clone ( ) ;
3654
+ p. push ( "stage0-sysroot" ) ;
3655
+ p
3656
+ } ;
3639
3657
debug ! ( ?stage0_sysroot) ;
3640
- debug ! ( exists = stage0_sysroot. exists( ) ) ;
3641
3658
3642
3659
rustc. arg ( "--sysroot" ) . arg ( & stage0_sysroot) ;
3643
3660
}
You can’t perform that action at this time.
0 commit comments