Rollup merge of #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: 04265621f9/src/bootstrap/builder.rs (L1446-L1447)
Like RUSTFLAGS, this doesn't support CARGOFLAGS_BOOTSTRAP: 6674dcda7a/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.
This commit is contained in:
Matthias Krüger 2023-05-31 11:19:08 +02:00 committed by GitHub
commit aee05c74e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -918,6 +918,10 @@ class RustBuild(object):
args.append("--color=always")
elif color == "never":
args.append("--color=never")
try:
args += env["CARGOFLAGS"].split()
except KeyError:
pass
# Run this from the source directory so cargo finds .cargo/config
run(args, env=env, verbose=self.verbose, cwd=self.rust_root)