Skip to content

Commit 58a38cd

Browse files
committed
Fix verbosity setting
1 parent 8652d96 commit 58a38cd

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ pub struct Config {
9393
pub ccache: Option<String>,
9494
/// Call Build::ninja() instead of this.
9595
pub ninja_in_file: bool,
96-
pub verbose: usize,
9796
pub submodules: Option<bool>,
9897
pub compiler_docs: bool,
9998
pub library_docs_private_items: bool,
@@ -528,7 +527,7 @@ impl Config {
528527
extended,
529528
tools,
530529
tool,
531-
verbose,
530+
verbose: build_verbose,
532531
sanitizers,
533532
profiler,
534533
cargo_native_static,
@@ -586,6 +585,12 @@ impl Config {
586585
}
587586
}
588587

588+
// Prefer CLI verbosity flags if set (`flags_verbose` > 0), otherwise take the value from
589+
// TOML.
590+
config
591+
.exec_ctx
592+
.set_verbosity(cmp::max(build_verbose.unwrap_or_default() as u8, flags_verbose));
593+
589594
let mut paths: Vec<PathBuf> = flags_skip.into_iter().chain(flags_exclude).collect();
590595
if let Some(exclude) = exclude {
591596
paths.extend(exclude);
@@ -741,7 +746,6 @@ impl Config {
741746
set(&mut config.extended, extended);
742747
config.tools = tools;
743748
set(&mut config.tool, tool);
744-
set(&mut config.verbose, verbose);
745749
set(&mut config.sanitizers, sanitizers);
746750
set(&mut config.profiler, profiler);
747751
set(&mut config.cargo_native_static, cargo_native_static);
@@ -750,8 +754,6 @@ impl Config {
750754
set(&mut config.print_step_timings, print_step_timings);
751755
set(&mut config.print_step_rusage, print_step_rusage);
752756

753-
config.verbose = cmp::max(config.verbose, flags_verbose as usize);
754-
755757
// Verbose flag is a good default for `rust.verbose-tests`.
756758
config.verbose_tests = config.is_verbose();
757759

src/bootstrap/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ impl Build {
515515
local_rebuild: config.local_rebuild,
516516
fail_fast: config.cmd.fail_fast(),
517517
doc_tests: config.cmd.doc_tests(),
518-
verbosity: config.verbose,
518+
verbosity: config.exec_ctx.verbosity as usize,
519519

520520
host_target: config.host_target,
521521
hosts: config.hosts.clone(),

src/bootstrap/src/utils/exec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ impl Default for CommandOutput {
550550
#[derive(Clone, Default)]
551551
pub struct ExecutionContext {
552552
dry_run: DryRun,
553-
verbosity: u8,
553+
pub verbosity: u8,
554554
pub fail_fast: bool,
555555
delayed_failures: Arc<Mutex<Vec<String>>>,
556556
command_cache: Arc<CommandCache>,
@@ -640,7 +640,7 @@ impl ExecutionContext {
640640
self.dry_run = value;
641641
}
642642

643-
pub fn set_verbose(&mut self, value: u8) {
643+
pub fn set_verbosity(&mut self, value: u8) {
644644
self.verbosity = value;
645645
}
646646

0 commit comments

Comments
 (0)