summary refs log tree commit diff
diff options
context:
space:
mode:
authorbit-aloo <sshourya17@gmail.com>2025-06-08 11:00:42 +0530
committerbit-aloo <sshourya17@gmail.com>2025-06-09 20:39:45 +0530
commitf3e1eb1dcade3e846c8624d2db85fc2d11a6d82a (patch)
tree0e0f7fafcb58dafb95d6d053f6e58140c89b94fe
parent50725f325b32d3de2a0f159c7b90b21cfc91a2d3 (diff)
downloadrust-f3e1eb1dcade3e846c8624d2db85fc2d11a6d82a.tar.gz
rust-f3e1eb1dcade3e846c8624d2db85fc2d11a6d82a.zip
update dry_run value in exec_ctx and start forwarding exec_ctx verbose methods via config
-rw-r--r--src/bootstrap/src/core/config/config.rs9
-rw-r--r--src/bootstrap/src/core/download.rs2
-rw-r--r--src/bootstrap/src/lib.rs2
-rw-r--r--src/bootstrap/src/utils/channel.rs5
4 files changed, 5 insertions, 13 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 8b5e252d1d7..6b6d9c9e5ba 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 c518cc8bcd4..16d097661b1 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<P: AsRef<Path>>(&self, path: P, s: &str) {
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index c8b6d59f38f..75dee300ec5 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 fec9f068f6d..8bd090e1a01 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.