Skip to content

Commit

Permalink
Rollup merge of #126861 - GuillaumeGomez:migrate-run-make-invalid-lib…
Browse files Browse the repository at this point in the history
…rary, r=Kobzol

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

Part of #121876.

r? `@jieyouxu`
  • Loading branch information
workingjubilee authored Jun 24, 2024
2 parents 12d7736 + 10990e2 commit 969bbc6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
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.

8 changes: 8 additions & 0 deletions tests/run-make/invalid-library/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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 969bbc6

Please sign in to comment.