diff options
| author | bit-aloo <sshourya17@gmail.com> | 2025-07-30 15:30:03 +0530 |
|---|---|---|
| committer | bit-aloo <sshourya17@gmail.com> | 2025-08-01 20:27:47 +0530 |
| commit | ae05591ade894daf8ac1974f001111b5520fcecf (patch) | |
| tree | 41780e6a367f015f5f2d07ff685fce9ff7e67c20 | |
| parent | ddd2a547b2115684c77e1735cca2122d20075e98 (diff) | |
| download | rust-ae05591ade894daf8ac1974f001111b5520fcecf.tar.gz rust-ae05591ade894daf8ac1974f001111b5520fcecf.zip | |
Force initializing ExecutionContext with verbosity and fail_fast mode
| -rw-r--r-- | src/bootstrap/src/core/config/config.rs | 4 | ||||
| -rw-r--r-- | src/bootstrap/src/utils/exec.rs | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index b66a9db1336..1dd62d9b756 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -454,9 +454,7 @@ impl Config { } = flags; let mut config = Config::default_opts(); - let mut exec_ctx = ExecutionContext::new(); - exec_ctx.set_verbose(flags_verbose); - exec_ctx.set_fail_fast(flags_cmd.fail_fast()); + let exec_ctx = ExecutionContext::new(flags_verbose, flags_cmd.fail_fast()); config.exec_ctx = exec_ctx; diff --git a/src/bootstrap/src/utils/exec.rs b/src/bootstrap/src/utils/exec.rs index 209ff393973..26582214c93 100644 --- a/src/bootstrap/src/utils/exec.rs +++ b/src/bootstrap/src/utils/exec.rs @@ -550,7 +550,7 @@ impl Default for CommandOutput { #[derive(Clone, Default)] pub struct ExecutionContext { dry_run: DryRun, - verbose: u8, + verbosity: u8, pub fail_fast: bool, delayed_failures: Arc<Mutex<Vec<String>>>, command_cache: Arc<CommandCache>, @@ -603,8 +603,8 @@ impl CommandCache { } impl ExecutionContext { - pub fn new() -> Self { - ExecutionContext::default() + pub fn new(verbosity: u8, fail_fast: bool) -> Self { + Self { verbosity, fail_fast, ..Default::default() } } pub fn dry_run(&self) -> bool { @@ -629,7 +629,7 @@ impl ExecutionContext { } pub fn is_verbose(&self) -> bool { - self.verbose > 0 + self.verbosity > 0 } pub fn fail_fast(&self) -> bool { @@ -641,7 +641,7 @@ impl ExecutionContext { } pub fn set_verbose(&mut self, value: u8) { - self.verbose = value; + self.verbosity = value; } pub fn set_fail_fast(&mut self, value: bool) { |
