Skip to content

Commit

Permalink
rewrite rmeta-preferred to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jun 19, 2024
1 parent e89570f commit 61b9273
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
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 @@ -172,7 +172,6 @@ run-make/rlib-chain/Makefile
run-make/rlib-format-packed-bundled-libs-2/Makefile
run-make/rlib-format-packed-bundled-libs-3/Makefile
run-make/rlib-format-packed-bundled-libs/Makefile
run-make/rmeta-preferred/Makefile
run-make/rustc-macro-dep-files/Makefile
run-make/rustdoc-io-error/Makefile
run-make/sanitizer-cdylib-link/Makefile
Expand Down
7 changes: 6 additions & 1 deletion tests/run-make/metadata-only-crate-no-ice/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ fn main() {
rustc().input("baz.rs").emit("metadata").run();
rustc().input("bar.rs").emit("metadata").extern_("baz", "libbaz.rmeta").run();
// There should be no internal compiler error message.
rustc().input("foo.rs").emit("metadata").extern_("bar", "libbaz.rmeta").run().assert_stderr_not_contains("unexpectedly panicked");
rustc()
.input("foo.rs")
.emit("metadata")
.extern_("bar", "libbaz.rmeta")
.run()
.assert_stderr_not_contains("unexpectedly panicked");
}
16 changes: 0 additions & 16 deletions tests/run-make/rmeta-preferred/Makefile

This file was deleted.

18 changes: 18 additions & 0 deletions tests/run-make/rmeta-preferred/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This test compiles `lib.rs`'s dependency, `rmeta_aux.rs`, as both an rlib
// and an rmeta crate. By default, rustc should give the metadata crate (rmeta)
// precedence over the rust-lib (rlib). This test inspects the contents of the binary
// and that the correct (rmeta) crate was used.
// rlibs being preferred could indicate a resurgence of the -Zbinary-dep-depinfo bug
// seen in #68298.
// See https://github.com/rust-lang/rust/pull/37681

//@ ignore-cross-compile

use run_make_support::{invalid_utf8_contains, invalid_utf8_not_contains, rustc};

fn main() {
rustc().input("rmeta_aux.rs").crate_type("rlib").emit("link,metadata").run();
rustc().input("lib.rs").crate_type("rlib").emit("dep-info").arg("-Zbinary-dep-depinfo").run();
invalid_utf8_contains("lib.d", "librmeta_aux.rmeta");
invalid_utf8_not_contains("lib.d", "librmeta_aux.rlib");
}

0 comments on commit 61b9273

Please sign in to comment.