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