forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#133633 - jyn514:hide-linker-args, r=<try>
don't show the full linker args unless `--verbose` is passed the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them. split out from rust-lang#119286. fixes rust-lang#109979. r? `@bjorn3` try-build: dist-x86_64-linux
- Loading branch information
Showing
8 changed files
with
126 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
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 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,13 @@ | ||
fn main() { | ||
for arg in std::env::args() { | ||
match &*arg { | ||
"run_make_info" => println!("foo"), | ||
"run_make_warn" => eprintln!("warning: bar"), | ||
"run_make_error" => { | ||
eprintln!("error: baz"); | ||
std::process::exit(1); | ||
} | ||
_ => (), | ||
} | ||
} | ||
} |
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 @@ | ||
fn main() {} |
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 @@ | ||
use run_make_support::{Rustc, rustc}; | ||
|
||
fn run_rustc() -> Rustc { | ||
let mut rustc = rustc(); | ||
rustc.arg("main.rs").output("main").linker("./fake-linker"); | ||
rustc | ||
} | ||
|
||
fn main() { | ||
// first, compile our linker | ||
rustc().arg("fake-linker.rs").output("fake-linker").run(); | ||
|
||
// Make sure we don't show the linker args unless `--verbose` is passed | ||
run_rustc() | ||
.link_arg("run_make_error") | ||
.verbose() | ||
.run_fail() | ||
.assert_stderr_contains_regex("fake-linker.*run_make_error") | ||
.assert_stderr_not_contains("object files omitted") | ||
.assert_stderr_contains_regex(r"lib[/\\]libstd"); | ||
run_rustc() | ||
.link_arg("run_make_error") | ||
.run_fail() | ||
.assert_stderr_contains("fake-linker") | ||
.assert_stderr_contains("object files omitted") | ||
.assert_stderr_contains_regex(r"\{") | ||
.assert_stderr_not_contains_regex(r"lib[/\\]libstd"); | ||
} |