From 281aa50e3f52e13377444c518b190ac5dbace0cb Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 8 May 2024 19:11:17 +0200 Subject: [PATCH 1/2] bootstrap: add comments for the automatic dry run --- src/bootstrap/src/core/builder.rs | 3 +++ src/bootstrap/src/lib.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index 6c4b26ec2195f..b206aadef624a 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -88,6 +88,9 @@ pub trait Step: 'static + Clone + Debug + PartialEq + Eq + Hash { /// Primary function to execute this rule. Can call `builder.ensure()` /// with other steps to run those. + /// + /// This gets called twice during a normal `./x.py` execution: first + /// with `dry_run() == true`, and then for real. fn run(self, builder: &Builder<'_>) -> Self::Output; /// When bootstrap is passed a set of paths, this controls whether this rule diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 47b03d411cb0d..c4420010f2438 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -683,6 +683,8 @@ impl Build { if !self.config.dry_run() { { + // We first to a dry-run. This is a sanity-check to ensure that + // steps don't do anything expensive in the dry-run. self.config.dry_run = DryRun::SelfCheck; let builder = builder::Builder::new(self); builder.execute_cli(); From 87c09fefbbf54aa30d1252d60ef1135862eef76d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 10 May 2024 07:45:53 +0200 Subject: [PATCH 2/2] fix typo Co-authored-by: jyn --- src/bootstrap/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index c4420010f2438..698a576effa63 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -683,7 +683,7 @@ impl Build { if !self.config.dry_run() { { - // We first to a dry-run. This is a sanity-check to ensure that + // We first do a dry-run. This is a sanity-check to ensure that // steps don't do anything expensive in the dry-run. self.config.dry_run = DryRun::SelfCheck; let builder = builder::Builder::new(self);