Skip to content

Commit

Permalink
Auto merge of rust-lang#126861 - GuillaumeGomez:migrate-run-make-inva…
Browse files Browse the repository at this point in the history
…lid-library, r=<try>

Migrate `run-make/invalid-library` to `rmake.rs`

Part of rust-lang#121876.

r? `@jieyouxu`

try-job: x86_64-msvc
  • Loading branch information
bors committed Jun 24, 2024
2 parents 2c243d9 + 22cac46 commit 4f44f04
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/tools/compiletest/src/header/needs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ pub(super) fn handle_needs(
condition: config.runner.as_ref().is_some_and(|r| r.contains("wasmtime")),
ignore_reason: "ignored when wasmtime runner is not available",
},
Need {
name: "needs-ar",
condition: !config.target.contains("msvc"),
ignore_reason: "ignored when ar command is not available",
},
Need {
name: "needs-symlink",
condition: cache.symlinks,
Expand Down
8 changes: 8 additions & 0 deletions src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ pub fn target() -> String {
env_var("TARGET")
}

/// `AR`
#[track_caller]
#[must_use]
pub fn ar_command() -> Command {
let ar_path = env_var("AR");
Command::new(ar_path)
}

/// Check if target is windows-like.
#[must_use]
pub fn is_windows() -> bool {
Expand Down
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 @@ -54,7 +54,6 @@ run-make/incr-add-rust-src-component/Makefile
run-make/incr-foreign-head-span/Makefile
run-make/interdependent-c-libraries/Makefile
run-make/intrinsic-unreachable/Makefile
run-make/invalid-library/Makefile
run-make/invalid-so/Makefile
run-make/issue-107094/Makefile
run-make/issue-109934-lto-debuginfo/Makefile
Expand Down
6 changes: 0 additions & 6 deletions tests/run-make/invalid-library/Makefile

This file was deleted.

10 changes: 10 additions & 0 deletions tests/run-make/invalid-library/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ needs-ar

use run_make_support::fs_wrapper::create_file;
use run_make_support::{ar_command, rustc};

fn main() {
create_file("lib.rmeta");
ar_command().arg("crus").arg("libfoo-ffffffff-1.0.rlib").arg("lib.rmeta").run();
rustc().input("foo.rs").run_fail().assert_stderr_contains("found invalid metadata");
}

0 comments on commit 4f44f04

Please sign in to comment.