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 1c2b42b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 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
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 1c2b42b

Please sign in to comment.