Skip to content

Commit

Permalink
rewrite incremental-session-fail to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jun 14, 2024
1 parent ab71510 commit abf6b17
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 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 @@ -67,7 +67,6 @@ run-make/inaccessible-temp-dir/Makefile
run-make/include_bytes_deps/Makefile
run-make/incr-add-rust-src-component/Makefile
run-make/incr-foreign-head-span/Makefile
run-make/incremental-session-fail/Makefile
run-make/inline-always-many-cgu/Makefile
run-make/interdependent-c-libraries/Makefile
run-make/intrinsic-unreachable/Makefile
Expand Down
13 changes: 5 additions & 8 deletions tests/run-make/incremental-debugger-visualizer/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// This test makes sure that changes to files referenced via //[debugger_visualizer]
// are picked up when compiling incrementally.

// We have to copy the source to $(TMPDIR) because Github CI mounts the source
// directory as readonly. We need to apply modifications to some of the source
// file.
// This test ensures that changes to files referenced via //[debugger_visualizer]
// (in this case, foo.py and foo.natvis) are picked up when compiling incrementally.
// See https://github.com/rust-lang/rust/pull/111641

use run_make_support::{
fs_wrapper, invalid_utf8_contains_str, invalid_utf8_not_contains_str, rustc,
Expand All @@ -14,7 +11,7 @@ fn main() {
fs_wrapper::create_file("foo.py");
fs_wrapper::write("foo.py", "GDB script v1");
fs_wrapper::create_file("foo.natvis");
fs_wrapper::write("foo.py", "Natvis v1");
fs_wrapper::write("foo.natvis", "Natvis v1");
rustc()
.input("foo.rs")
.crate_type("rlib")
Expand Down Expand Up @@ -45,7 +42,7 @@ fn main() {
// Now change the Natvis version and check that the change has been picked up
fs_wrapper::remove_file("foo.natvis");
fs_wrapper::create_file("foo.natvis");
fs_wrapper::write("foo.py", "Natvis v2");
fs_wrapper::write("foo.natvis", "Natvis v2");
rustc()
.input("foo.rs")
.crate_type("rlib")
Expand Down
14 changes: 0 additions & 14 deletions tests/run-make/incremental-session-fail/Makefile

This file was deleted.

15 changes: 15 additions & 0 deletions tests/run-make/incremental-session-fail/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Failing to create the directory where output incremental
// files would be stored used to cause an ICE (Internal Compiler
// Error). This was patched in #85698, and this test checks that
// the ensuing compilation failure is not an ICE.
// See https://github.com/rust-lang/rust/pull/85698

use run_make_support::{fs_wrapper, rustc};

fn main() {
fs_wrapper::create_file("session");
// rustc should fail to create the session directory here.
let out = rustc().input("foo.rs").crate_type("rlib").incremental("session").run_fail();
out.assert_stderr_contains("could not create incremental compilation crate directory");
out.assert_stderr_not_contains("internal compiler error");
}

0 comments on commit abf6b17

Please sign in to comment.