Skip to content

Commit f3e1eb1

Browse files
committed
update dry_run value in exec_ctx and start forwarding exec_ctx verbose methods via config
1 parent 50725f3 commit f3e1eb1

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,10 +1025,7 @@ impl Config {
10251025
}
10261026

10271027
pub fn dry_run(&self) -> bool {
1028-
match self.dry_run {
1029-
DryRun::Disabled => false,
1030-
DryRun::SelfCheck | DryRun::UserSelected => true,
1031-
}
1028+
self.exec_ctx.dry_run()
10321029
}
10331030

10341031
pub fn is_explicit_stage(&self) -> bool {
@@ -1256,9 +1253,7 @@ impl Config {
12561253

12571254
/// Runs a function if verbosity is greater than 0
12581255
pub fn verbose(&self, f: impl Fn()) {
1259-
if self.is_verbose() {
1260-
f()
1261-
}
1256+
self.exec_ctx.verbose(f);
12621257
}
12631258

12641259
pub fn any_sanitizers_to_build(&self) -> bool {

src/bootstrap/src/core/download.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn curl_version(config: &Config) -> semver::Version {
3838
/// Generic helpers that are useful anywhere in bootstrap.
3939
impl Config {
4040
pub fn is_verbose(&self) -> bool {
41-
self.verbose > 0
41+
self.exec_ctx.is_verbose()
4242
}
4343

4444
pub(crate) fn create<P: AsRef<Path>>(&self, path: P, s: &str) {

src/bootstrap/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ impl Build {
673673
let _sanity_check_span =
674674
span!(tracing::Level::DEBUG, "(1) executing dry-run sanity-check").entered();
675675
self.config.dry_run = DryRun::SelfCheck;
676+
self.config.exec_ctx.set_dry_run(DryRun::SelfCheck);
676677
let builder = builder::Builder::new(self);
677678
builder.execute_cli();
678679
}
@@ -683,6 +684,7 @@ impl Build {
683684
let _actual_run_span =
684685
span!(tracing::Level::DEBUG, "(2) executing actual run").entered();
685686
self.config.dry_run = DryRun::Disabled;
687+
self.config.exec_ctx.set_dry_run(DryRun::Disabled);
686688
let builder = builder::Builder::new(self);
687689
builder.execute_cli();
688690
}

src/bootstrap/src/utils/channel.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ impl GitInfo {
5151
if output.is_failure() {
5252
return GitInfo::Absent;
5353
}
54-
// Make sure git commands work
55-
// match helpers::git(Some(dir)).arg("rev-parse").as_command_mut().output() {
56-
// Ok(ref out) if out.status.success() => {}
57-
// _ => return GitInfo::Absent,
58-
// }
5954

6055
// If we're ignoring the git info, we don't actually need to collect it, just make sure this
6156
// was a git repo in the first place.

0 commit comments

Comments
 (0)