Rollup merge of #124899 - RalfJung:bootstrap-dry, r=onur-ozkan

bootstrap: add comments for the automatic dry run
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-05-11 01:15:09 +01:00 committed by GitHub
commit 881fa5b011
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -683,6 +683,8 @@ impl Build {
if !self.config.dry_run() {
{
// 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);
builder.execute_cli();