Skip to content

Commit 8c7b921

Browse files
committed
Auto merge of #65129 - andjo403:cargo_args, r=alexcrichton
make it possible to add args to cargo in x.py eg. make it easier to test -Ztimings for rustc cc #65088
2 parents 8ee24f6 + 6ae36a3 commit 8c7b921

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bootstrap/builder.rs

+10
Original file line numberDiff line numberDiff line change
@@ -817,12 +817,22 @@ impl<'a> Builder<'a> {
817817

818818
let mut rustflags = Rustflags::new(&target);
819819
if stage != 0 {
820+
if let Ok(s) = env::var("CARGOFLAGS_NOT_BOOTSTRAP") {
821+
cargo.args(s.split_whitespace());
822+
}
820823
rustflags.env("RUSTFLAGS_NOT_BOOTSTRAP");
821824
} else {
825+
if let Ok(s) = env::var("CARGOFLAGS_BOOTSTRAP") {
826+
cargo.args(s.split_whitespace());
827+
}
822828
rustflags.env("RUSTFLAGS_BOOTSTRAP");
823829
rustflags.arg("--cfg=bootstrap");
824830
}
825831

832+
if let Ok(s) = env::var("CARGOFLAGS") {
833+
cargo.args(s.split_whitespace());
834+
}
835+
826836
match mode {
827837
Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {},
828838
Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {

0 commit comments

Comments
 (0)