Skip to content

Commit

Permalink
Rollup merge of rust-lang#65129 - andjo403:cargo_args, r=alexcrichton
Browse files Browse the repository at this point in the history
make it possible to add args to cargo in x.py

eg. make it easier to test -Ztimings for rustc

cc rust-lang#65088
  • Loading branch information
Centril authored Oct 9, 2019
2 parents 6846eb7 + 6ae36a3 commit 8697fb3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,12 +817,22 @@ impl<'a> Builder<'a> {

let mut rustflags = Rustflags::new(&target);
if stage != 0 {
if let Ok(s) = env::var("CARGOFLAGS_NOT_BOOTSTRAP") {
cargo.args(s.split_whitespace());
}
rustflags.env("RUSTFLAGS_NOT_BOOTSTRAP");
} else {
if let Ok(s) = env::var("CARGOFLAGS_BOOTSTRAP") {
cargo.args(s.split_whitespace());
}
rustflags.env("RUSTFLAGS_BOOTSTRAP");
rustflags.arg("--cfg=bootstrap");
}

if let Ok(s) = env::var("CARGOFLAGS") {
cargo.args(s.split_whitespace());
}

match mode {
Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {},
Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {
Expand Down

0 comments on commit 8697fb3

Please sign in to comment.