Skip to content

Commit

Permalink
Auto merge of #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 #65088
  • Loading branch information
bors committed Oct 10, 2019
2 parents 8ee24f6 + 6ae36a3 commit 8c7b921
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 8c7b921

Please sign in to comment.