Skip to content

Commit 4f44f04

Browse files
committedJun 24, 2024
Auto merge of #126861 - GuillaumeGomez:migrate-run-make-invalid-library, r=<try>
Migrate `run-make/invalid-library` to `rmake.rs` Part of #121876. r? `@jieyouxu` try-job: x86_64-msvc
2 parents 2c243d9 + 22cac46 commit 4f44f04

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed
 

‎src/tools/compiletest/src/header/needs.rs

+5
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ pub(super) fn handle_needs(
144144
condition: config.runner.as_ref().is_some_and(|r| r.contains("wasmtime")),
145145
ignore_reason: "ignored when wasmtime runner is not available",
146146
},
147+
Need {
148+
name: "needs-ar",
149+
condition: !config.target.contains("msvc"),
150+
ignore_reason: "ignored when ar command is not available",
151+
},
147152
Need {
148153
name: "needs-symlink",
149154
condition: cache.symlinks,

‎src/tools/run-make-support/src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ pub fn target() -> String {
6161
env_var("TARGET")
6262
}
6363

64+
/// `AR`
65+
#[track_caller]
66+
#[must_use]
67+
pub fn ar_command() -> Command {
68+
let ar_path = env_var("AR");
69+
Command::new(ar_path)
70+
}
71+
6472
/// Check if target is windows-like.
6573
#[must_use]
6674
pub fn is_windows() -> bool {

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

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ run-make/incr-add-rust-src-component/Makefile
5454
run-make/incr-foreign-head-span/Makefile
5555
run-make/interdependent-c-libraries/Makefile
5656
run-make/intrinsic-unreachable/Makefile
57-
run-make/invalid-library/Makefile
5857
run-make/invalid-so/Makefile
5958
run-make/issue-107094/Makefile
6059
run-make/issue-109934-lto-debuginfo/Makefile

‎tests/run-make/invalid-library/Makefile

-6
This file was deleted.
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ needs-ar
2+
3+
use run_make_support::fs_wrapper::create_file;
4+
use run_make_support::{ar_command, rustc};
5+
6+
fn main() {
7+
create_file("lib.rmeta");
8+
ar_command().arg("crus").arg("libfoo-ffffffff-1.0.rlib").arg("lib.rmeta").run();
9+
rustc().input("foo.rs").run_fail().assert_stderr_contains("found invalid metadata");
10+
}

0 commit comments

Comments
 (0)