bootstrap: tweak verbosity settings

Currently the verbosity settings are:
- 2: RUSTC-SHIM envvars get spammed on every invocation, O(30) lines
     cargo is passed -v which outputs CLI invocations, O(5) lines
- 3: cargo is passed -vv which outputs build script output, O(0-10) lines

This commit changes it to:

- 1: cargo is passed -v, O(5) lines
- 2: cargo is passed -vv, O(10) lines
- 3: RUSTC-SHIM envvars get spammed, O(30) lines
This commit is contained in:
Ximin Luo 2021-10-16 13:30:24 +01:00
parent 7fbd4ce276
commit d78559ac11
3 changed files with 3 additions and 3 deletions

View File

@ -146,7 +146,7 @@ fn main() {
} }
let is_test = args.iter().any(|a| a == "--test"); let is_test = args.iter().any(|a| a == "--test");
if verbose > 1 { if verbose > 2 {
let rust_env_vars = let rust_env_vars =
env::vars().filter(|(k, _)| k.starts_with("RUST") || k.starts_with("CARGO")); env::vars().filter(|(k, _)| k.starts_with("RUST") || k.starts_with("CARGO"));
let prefix = if is_test { "[RUSTC-SHIM] rustc --test" } else { "[RUSTC-SHIM] rustc" }; let prefix = if is_test { "[RUSTC-SHIM] rustc --test" } else { "[RUSTC-SHIM] rustc" };

View File

@ -959,7 +959,7 @@ class RustBuild(object):
self.cargo())) self.cargo()))
args = [self.cargo(), "build", "--manifest-path", args = [self.cargo(), "build", "--manifest-path",
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")] os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")]
for _ in range(1, self.verbose): for _ in range(0, self.verbose):
args.append("--verbose") args.append("--verbose")
if self.use_locked_deps: if self.use_locked_deps:
args.append("--locked") args.append("--locked")

View File

@ -1483,7 +1483,7 @@ impl<'a> Builder<'a> {
cargo.env("WINAPI_NO_BUNDLED_LIBRARIES", "1"); cargo.env("WINAPI_NO_BUNDLED_LIBRARIES", "1");
} }
for _ in 1..self.verbosity { for _ in 0..self.verbosity {
cargo.arg("-v"); cargo.arg("-v");
} }