Skip to content

Commit 86bd349

Browse files
committed
rewrite rlib-chain to rmake
1 parent 371845b commit 86bd349

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ run-make/remap-path-prefix-dwarf/Makefile
135135
run-make/reproducible-build-2/Makefile
136136
run-make/reproducible-build/Makefile
137137
run-make/return-non-c-like-enum-from-c/Makefile
138-
run-make/rlib-chain/Makefile
139138
run-make/rlib-format-packed-bundled-libs-2/Makefile
140139
run-make/rlib-format-packed-bundled-libs-3/Makefile
141140
run-make/rlib-format-packed-bundled-libs/Makefile

tests/run-make/dylib-chain/rmake.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// In this test, m4 depends on m3, which depends on m2, which depends on m1.
22
// Even though dependencies are chained like this and there is no direct mention
3-
// of m1 or m2 in m4.rs, compilation and execution should still succeed. Naturally,
4-
// removing those dependencies should cause execution to fail.
3+
// of m1 or m2 in m4.rs, compilation and execution should still succeed. Unlike the
4+
// rlib-chain test, dynamic libraries contain upstream dependencies, and breaking
5+
// the chain by removing the dylibs causes execution to fail.
56
// See https://github.com/rust-lang/rust/issues/10434
67

78
//@ ignore-cross-compile

tests/run-make/rlib-chain/Makefile

-11
This file was deleted.

tests/run-make/rlib-chain/rmake.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// In this test, m4 depends on m3, which depends on m2, which depends on m1.
2+
// Even though dependencies are chained like this and there is no direct mention
3+
// of m1 or m2 in m4.rs, compilation and execution should still succeed. Unlike
4+
// the dylib-chain test, rlibs do not contain upstream dependencies, and removing
5+
// the libraries still allows m4 to successfully execute.
6+
// See https://github.com/rust-lang/rust/issues/10434
7+
8+
//@ ignore-cross-compile
9+
// Reason: the compiled binary is executed
10+
11+
use run_make_support::{fs_wrapper, run, rust_lib_name, rustc};
12+
13+
fn main() {
14+
rustc().input("m1.rs").run();
15+
rustc().input("m2.rs").run();
16+
rustc().input("m3.rs").run();
17+
rustc().input("m4.rs").run();
18+
run("m4");
19+
fs_wrapper::remove_file(rust_lib_name("m1"));
20+
fs_wrapper::remove_file(rust_lib_name("m2"));
21+
fs_wrapper::remove_file(rust_lib_name("m3"));
22+
run("m4");
23+
}

0 commit comments

Comments
 (0)