-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #125674 - Oneirical:another-day-another-test, r=<try>
Rewrite `symlinked-extern`, `symlinked-rlib` and `symlinked-libraries` `run-make` tests in `rmake.rs` format Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-msvc
- Loading branch information
Showing
8 changed files
with
81 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// 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. | ||
// See https://github.com/rust-lang/rust/pull/16505 | ||
|
||
// This test checks that --extern and symlinks together | ||
// can result in successful compilation. | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{create_symlink, cwd, fs_wrapper, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").run(); | ||
fs_wrapper::create_dir_all("other"); | ||
create_symlink("libfoo.rlib", "other"); | ||
rustc().input("bar.rs").library_search_path(cwd()).run(); | ||
rustc().input("baz.rs").extern_("foo", "other").library_search_path(cwd()).run(); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// When a directory and a symlink simultaneously exist with the same name, | ||
// setting that name as the library search path should not cause rustc | ||
// to avoid looking in the symlink and cause an error. This test creates | ||
// a directory and a symlink named "other", and places the library in the symlink. | ||
// If it succeeds, the library was successfully found. | ||
// See https://github.com/rust-lang/rust/issues/12459 | ||
|
||
//@ ignore-cross-compile | ||
use run_make_support::{create_symlink, dynamic_lib_name, fs_wrapper, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
fs_wrapper::create_dir_all("other"); | ||
create_symlink(dynamic_lib_name("foo"), "other"); | ||
rustc().input("bar.rs").library_search_path("other").run(); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Rustc did not recognize libraries which were symlinked | ||
// to files having extension other than .rlib. This was fixed | ||
// in #32828. This test creates a symlink to "foo.xxx", which has | ||
// an unusual file extension, and checks that rustc can successfully | ||
// use it as an rlib library. | ||
// See https://github.com/rust-lang/rust/pull/32828 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{create_symlink, cwd, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").crate_type("rlib").output("foo.xxx").run(); | ||
create_symlink("foo.xxx", "libfoo.rlib"); | ||
rustc().input("bar.rs").library_search_path(cwd()).run(); | ||
} |