-
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 #125031 - Oneirical:dynamic-libs, r=jieyouxu
Migrate `run-make/issue-11908` to new `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). Set as draft, because I have a few concerns: - [x] I am not sure if `target().contains("darwin")` is a good way of checking that the target is on OSX. - [x] I find it strange that the `dylib` part of the test adapts to different target platforms, but not the `rlib` part. Is `rlib` named the same on all platforms?
- Loading branch information
Showing
8 changed files
with
79 additions
and
37 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 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
File renamed without changes.
File renamed without changes.
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,28 @@ | ||
// A path which contains the same rlib or dylib in two locations | ||
// should not cause an assertion panic in the compiler. | ||
// This test tries to replicate the linked issue and checks | ||
// if the bugged error makes a resurgence. | ||
|
||
// See https://github.com/rust-lang/rust/issues/11908 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{dynamic_lib, rust_lib, rustc, tmp_dir}; | ||
use std::fs; | ||
|
||
fn main() { | ||
let tmp_dir_other = tmp_dir().join("other"); | ||
|
||
fs::create_dir(&tmp_dir_other); | ||
rustc().input("foo.rs").crate_type("dylib").arg("-Cprefer-dynamic").run(); | ||
fs::rename(dynamic_lib("foo"), &tmp_dir_other); | ||
rustc().input("foo.rs").crate_type("dylib").arg("-Cprefer-dynamic").run(); | ||
rustc().input("bar.rs").library_search_path(&tmp_dir_other).run(); | ||
fs::remove_dir_all(tmp_dir()); | ||
|
||
fs::create_dir_all(&tmp_dir_other); | ||
rustc().input("foo.rs").crate_type("rlib").run(); | ||
fs::rename(rust_lib("foo"), &tmp_dir_other); | ||
rustc().input("foo.rs").crate_type("rlib").run(); | ||
rustc().input("bar.rs").library_search_path(tmp_dir_other).run(); | ||
} |