Skip to content

Commit 2e64710

Browse files
authored
Rollup merge of rust-lang#111979 - jyn514:cargoflags, r=albertlarsan68
Respect CARGOFLAGS in bootstrap.py This makes it possible to pass flags to bootstrap itself, for consistency with std/rustc: https://github.com/rust-lang/rust/blob/04265621f9a82cfc2fc2278b935dcc5d4a1c39b7/src/bootstrap/builder.rs#L1446-L1447 Like RUSTFLAGS, this doesn't support CARGOFLAGS_BOOTSTRAP: https://github.com/rust-lang/rust/blob/6674dcda7a1da4c66e0aa0cfc67b27e42f4ebb34/src/bootstrap/bootstrap.py#L883-L884 I found this useful recently when I wanted to pass `-Zsparse-registry` to an old checkout of the compiler from before it was stabilized in cargo.
2 parents 3eaa3eb + 6674dcd commit 2e64710

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bootstrap/bootstrap.py

+4
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,10 @@ def build_bootstrap(self, color, verbose_count):
918918
args.append("--color=always")
919919
elif color == "never":
920920
args.append("--color=never")
921+
try:
922+
args += env["CARGOFLAGS"].split()
923+
except KeyError:
924+
pass
921925

922926
# Run this from the source directory so cargo finds .cargo/config
923927
run(args, env=env, verbose=self.verbose, cwd=self.rust_root)

0 commit comments

Comments
 (0)