rust/tests/run-make/symlinked-extern/rmake.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
856 B
Rust
Raw Normal View History

2024-05-28 12:21:28 -05:00
// Crates that are resolved normally have their path canonicalized and all
// symlinks resolved. This did not happen for paths specified
// using the --extern option to rustc, which could lead to rustc thinking
// that it encountered two different versions of a crate, when it's
// actually the same version found through different paths.
2024-05-28 12:33:14 -05:00
// See https://github.com/rust-lang/rust/pull/16505
2024-05-28 12:21:28 -05:00
// This test checks that --extern and symlinks together
// can result in successful compilation.
//@ ignore-cross-compile
//@ needs-symlink
2024-05-28 12:21:28 -05:00
2024-07-17 08:31:38 -05:00
use run_make_support::{cwd, rfs, rustc};
2024-05-28 12:21:28 -05:00
fn main() {
rustc().input("foo.rs").run();
rfs::create_dir_all("other");
rfs::create_symlink("libfoo.rlib", "other");
2024-05-28 12:57:09 -05:00
rustc().input("bar.rs").library_search_path(cwd()).run();
rustc().input("baz.rs").extern_("foo", "other").library_search_path(cwd()).run();
2024-05-28 12:21:28 -05:00
}