Skip to content

Commit c07d1e2

Browse files
committed
Use same --remap-path-prefix as bootstrap for testing the rustc test suite
This allows removing the CFG_VIRTUAL_RUST_SOURCE_BASE_DIR hack and re-enabling a fair amount of tests.
1 parent 62f6e84 commit c07d1e2

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

build_system/build_sysroot.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::env;
12
use std::fs;
23
use std::path::{Path, PathBuf};
34
use std::process::Command;
@@ -259,6 +260,14 @@ fn build_clif_sysroot_for_triple(
259260
// inlining.
260261
rustflags.push("-Zinline-mir".to_owned());
261262
}
263+
if let Some(prefix) = env::var_os("CG_CLIF_STDLIB_REMAP_PATH_PREFIX") {
264+
rustflags.push("--remap-path-prefix".to_owned());
265+
rustflags.push(format!(
266+
"{}={}",
267+
STDLIB_SRC.to_path(dirs).to_str().unwrap(),
268+
prefix.to_str().unwrap()
269+
));
270+
}
262271
compiler.rustflags.extend(rustflags);
263272
let mut build_cmd = STANDARD_LIBRARY.build(&compiler, dirs);
264273
maybe_incremental(&mut build_cmd);

scripts/setup_rust_fork.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/usr/bin/env bash
22
set -e
33

4-
./y.sh build
4+
# Compiletest expects all standard library paths to start with /rustc/FAKE_PREFIX.
5+
# CG_CLIF_STDLIB_REMAP_PATH_PREFIX will cause cg_clif's build system to pass
6+
# --remap-path-prefix to handle this.
7+
CG_CLIF_STDLIB_REMAP_PATH_PREFIX=/rustc/FAKE_PREFIX ./y.sh build
58

69
echo "[SETUP] Rust fork"
710
git clone https://github.com/rust-lang/rust.git || true
@@ -32,8 +35,6 @@ verbose-tests = false
3235
EOF
3336
popd
3437

35-
export CFG_VIRTUAL_RUST_SOURCE_BASE_DIR="$(cd build/stdlib; pwd)"
36-
3738
# Allow the testsuite to use llvm tools
3839
host_triple=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ")
3940
export LLVM_BIN_DIR="$(rustc --print sysroot)/lib/rustlib/$host_triple/bin"

scripts/test_rustc_tests.sh

-14
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,6 @@ rm tests/ui/consts/issue-33537.rs # same
111111
rm tests/ui/layout/valid_range_oob.rs # different ICE message
112112
rm tests/ui/const-generics/generic_const_exprs/issue-80742.rs # gives error instead of ICE with cg_clif
113113

114-
rm tests/ui/consts/issue-miri-1910.rs # different error message
115-
rm tests/ui/consts/offset_ub.rs # same
116-
rm tests/ui/consts/const-eval/ub-slice-get-unchecked.rs # same
117-
rm tests/ui/intrinsics/panic-uninitialized-zeroed.rs # same
118-
rm tests/ui/lint/lint-const-item-mutation.rs # same
119-
rm tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs # same
120-
rm tests/ui/suggestions/derive-trait-for-method-call.rs # same
121-
rm tests/ui/typeck/issue-46112.rs # same
122-
rm tests/ui/consts/const_cmp_type_id.rs # same
123-
rm tests/ui/consts/issue-73976-monomorphic.rs # same
124-
rm tests/ui/rfcs/rfc-3348-c-string-literals/non-ascii.rs # same
125-
rm tests/ui/consts/issue-94675.rs # same
126-
rm tests/ui/associated-types/issue-85103-layout-debug.rs # same
127-
128114
# rustdoc-clif passes extra args, suppressing the help message when no args are passed
129115
rm -r tests/run-make/issue-88756-default-output
130116

0 commit comments

Comments
 (0)