diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 8b5e252d1d7b..6b6d9c9e5ba4 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1025,10 +1025,7 @@ impl Config { } pub fn dry_run(&self) -> bool { - match self.dry_run { - DryRun::Disabled => false, - DryRun::SelfCheck | DryRun::UserSelected => true, - } + self.exec_ctx.dry_run() } pub fn is_explicit_stage(&self) -> bool { @@ -1256,9 +1253,7 @@ impl Config { /// Runs a function if verbosity is greater than 0 pub fn verbose(&self, f: impl Fn()) { - if self.is_verbose() { - f() - } + self.exec_ctx.verbose(f); } pub fn any_sanitizers_to_build(&self) -> bool { diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs index c518cc8bcd48..16d097661b1d 100644 --- a/src/bootstrap/src/core/download.rs +++ b/src/bootstrap/src/core/download.rs @@ -38,7 +38,7 @@ fn curl_version(config: &Config) -> semver::Version { /// Generic helpers that are useful anywhere in bootstrap. impl Config { pub fn is_verbose(&self) -> bool { - self.verbose > 0 + self.exec_ctx.is_verbose() } pub(crate) fn create>(&self, path: P, s: &str) { diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index c8b6d59f38f7..75dee300ec5e 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -673,6 +673,7 @@ impl Build { let _sanity_check_span = span!(tracing::Level::DEBUG, "(1) executing dry-run sanity-check").entered(); self.config.dry_run = DryRun::SelfCheck; + self.config.exec_ctx.set_dry_run(DryRun::SelfCheck); let builder = builder::Builder::new(self); builder.execute_cli(); } @@ -683,6 +684,7 @@ impl Build { let _actual_run_span = span!(tracing::Level::DEBUG, "(2) executing actual run").entered(); self.config.dry_run = DryRun::Disabled; + self.config.exec_ctx.set_dry_run(DryRun::Disabled); let builder = builder::Builder::new(self); builder.execute_cli(); } diff --git a/src/bootstrap/src/utils/channel.rs b/src/bootstrap/src/utils/channel.rs index fec9f068f6df..8bd090e1a017 100644 --- a/src/bootstrap/src/utils/channel.rs +++ b/src/bootstrap/src/utils/channel.rs @@ -51,11 +51,6 @@ impl GitInfo { if output.is_failure() { return GitInfo::Absent; } - // Make sure git commands work - // match helpers::git(Some(dir)).arg("rev-parse").as_command_mut().output() { - // Ok(ref out) if out.status.success() => {} - // _ => return GitInfo::Absent, - // } // If we're ignoring the git info, we don't actually need to collect it, just make sure this // was a git repo in the first place.