-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #126310 - GuillaumeGomez:migrate-run-make-prefer-rlib…
…, r=Kobzol Migrate run make prefer rlib Part of #121876. r? `@jieyouxu`
- Loading branch information
Showing
4 changed files
with
17 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{cwd, dynamic_lib_name, read_dir, run, run_fail, rustc}; | ||
use std::fs::remove_file; | ||
use std::process::Command; | ||
use run_make_support::{cwd, dynamic_lib_name, fs_wrapper, read_dir, run, run_fail, rustc}; | ||
|
||
fn main() { | ||
rustc().input("bar.rs").crate_type("dylib").crate_type("rlib").arg("-Cprefer-dynamic").run(); | ||
rustc().input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
|
||
run("foo"); | ||
|
||
remove_file(dynamic_lib_name("bar")).unwrap(); | ||
fs_wrapper::remove_file(dynamic_lib_name("bar")); | ||
// This time the command should fail. | ||
run_fail("foo"); | ||
} |
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,15 @@ | ||
// Check that `foo.rs` prefers to link to `bar` statically, and can be executed even if the `bar` | ||
// library artifacts are removed. | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{dynamic_lib_name, fs_wrapper, path, run, rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
rustc().input("bar.rs").crate_type("dylib").crate_type("rlib").run(); | ||
assert!(path(rust_lib_name("bar")).exists()); | ||
rustc().input("foo.rs").run(); | ||
fs_wrapper::remove_file(rust_lib_name("bar")); | ||
fs_wrapper::remove_file(dynamic_lib_name("bar")); | ||
run("foo"); | ||
} |