Skip to content

Commit

Permalink
rewrite incr-add-rust-src-component to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Aug 5, 2024
1 parent 2b78d92 commit 38b1486
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 46 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ run-make/dep-info-spaces/Makefile
run-make/dep-info/Makefile
run-make/emit-to-stdout/Makefile
run-make/extern-fn-reachable/Makefile
run-make/incr-add-rust-src-component/Makefile
run-make/issue-84395-lto-embed-bitcode/Makefile
run-make/jobserver-error/Makefile
run-make/libs-through-symlinks/Makefile
Expand Down
45 changes: 0 additions & 45 deletions tests/run-make/incr-add-rust-src-component/Makefile

This file was deleted.

22 changes: 22 additions & 0 deletions tests/run-make/incr-add-rust-src-component/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// rust-lang/rust#70924: Test that if we add rust-src component in between two
// incremental compiles, the compiler does not ICE on the second.
// Remove the rust-src part of the sysroot for the *first* build.
// Then put in a facsimile of the rust-src
// component for the second build, in order to expose the ICE from issue #70924.
// See https://github.com/rust-lang/rust/pull/72952

//FIXME(Oneirical): try on test-various and windows
//FIXME(Oneirical): check that the direct edit of the sysroot is not messing things up

use run_make_support::{path, rfs, rustc};

fn main() {
let sysroot = rustc().print("sysroot").run().stdout_utf8();
let sysroot = sysroot.trim();
let sysroot = format!("{sysroot}-sysroot");
rfs::remove_dir_all(path(&sysroot).join("lib/rustlib/src/rust"));
rustc().arg("--sysroot").arg(&sysroot).incremental("incr").input("main.rs").run();
rfs::create_dir_all(path(&sysroot).join("lib/rustlib/src/rust/src/libstd"));
rfs::create_file(path(&sysroot).join("lib/rustlib/src/rust/src/libstd/lib.rs"));
rustc().arg("--sysroot").arg(&sysroot).incremental("incr").input("main.rs").run();
}

0 comments on commit 38b1486

Please sign in to comment.