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