Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e738432

Browse files
authoredJun 12, 2024
Unrolled build for rust-lang#126310
Rollup merge of rust-lang#126310 - GuillaumeGomez:migrate-run-make-prefer-rlib, r=Kobzol Migrate run make prefer rlib Part of rust-lang#121876. r? `@jieyouxu`
2 parents 02c7a59 + 45a9bd5 commit e738432

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed
 

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ run-make/pgo-gen/Makefile
175175
run-make/pgo-indirect-call-promotion/Makefile
176176
run-make/pgo-use/Makefile
177177
run-make/pointer-auth-link-with-c/Makefile
178-
run-make/prefer-rlib/Makefile
179178
run-make/pretty-print-to-file/Makefile
180179
run-make/pretty-print-with-dep-file/Makefile
181180
run-make/print-calling-conventions/Makefile

‎tests/run-make/prefer-dylib/rmake.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
//@ ignore-cross-compile
22

3-
use run_make_support::{cwd, dynamic_lib_name, read_dir, run, run_fail, rustc};
4-
use std::fs::remove_file;
5-
use std::process::Command;
3+
use run_make_support::{cwd, dynamic_lib_name, fs_wrapper, read_dir, run, run_fail, rustc};
64

75
fn main() {
86
rustc().input("bar.rs").crate_type("dylib").crate_type("rlib").arg("-Cprefer-dynamic").run();
97
rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
108

119
run("foo");
1210

13-
remove_file(dynamic_lib_name("bar")).unwrap();
11+
fs_wrapper::remove_file(dynamic_lib_name("bar"));
1412
// This time the command should fail.
1513
run_fail("foo");
1614
}

‎tests/run-make/prefer-rlib/Makefile

-9
This file was deleted.

‎tests/run-make/prefer-rlib/rmake.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Check that `foo.rs` prefers to link to `bar` statically, and can be executed even if the `bar`
2+
// library artifacts are removed.
3+
4+
//@ ignore-cross-compile
5+
6+
use run_make_support::{dynamic_lib_name, fs_wrapper, path, run, rust_lib_name, rustc};
7+
8+
fn main() {
9+
rustc().input("bar.rs").crate_type("dylib").crate_type("rlib").run();
10+
assert!(path(rust_lib_name("bar")).exists());
11+
rustc().input("foo.rs").run();
12+
fs_wrapper::remove_file(rust_lib_name("bar"));
13+
fs_wrapper::remove_file(dynamic_lib_name("bar"));
14+
run("foo");
15+
}

0 commit comments

Comments
 (0)
Failed to load comments.