Skip to content

Commit 07ce2de

Browse files
committed
rewrite incr-add-rust-src-component to rmake
1 parent 5367673 commit 07ce2de

File tree

3 files changed

+22
-46
lines changed

3 files changed

+22
-46
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ run-make/emit-to-stdout/Makefile
1111
run-make/extern-fn-reachable/Makefile
1212
run-make/foreign-double-unwind/Makefile
1313
run-make/foreign-exceptions/Makefile
14-
run-make/incr-add-rust-src-component/Makefile
1514
run-make/issue-36710/Makefile
1615
run-make/issue-84395-lto-embed-bitcode/Makefile
1716
run-make/issue-88756-default-output/Makefile

tests/run-make/incr-add-rust-src-component/Makefile

-45
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// rust-lang/rust#70924: Test that if we add rust-src component in between two
2+
// incremental compiles, the compiler does not ICE on the second.
3+
// Remove the rust-src part of the sysroot for the *first* build.
4+
// Then put in a facsimile of the rust-src
5+
// component for the second build, in order to expose the ICE from issue #70924.
6+
// See https://github.com/rust-lang/rust/pull/72952
7+
8+
//FIXME(Oneirical): try on test-various and windows
9+
//FIXME(Oneirical): check that the direct edit of the sysroot is not messing things up
10+
11+
use run_make_support::{path, rfs, rustc};
12+
13+
fn main() {
14+
let sysroot = rustc().print("sysroot").run().stdout_utf8();
15+
let sysroot = sysroot.trim();
16+
let sysroot = format!("{sysroot}-sysroot");
17+
rfs::remove_dir_all(path(&sysroot).join("lib/rustlib/src/rust"));
18+
rustc().arg("--sysroot").arg(&sysroot).incremental("incr").input("main.rs").run();
19+
rfs::create_dir_all(path(&sysroot).join("lib/rustlib/src/rust/src/libstd"));
20+
rfs::create_file(path(&sysroot).join("lib/rustlib/src/rust/src/libstd/lib.rs"));
21+
rustc().arg("--sysroot").arg(&sysroot).incremental("incr").input("main.rs").run();
22+
}

0 commit comments

Comments
 (0)