bootstrap: Replace Step::DEFAULT and default_condition with is_default_step
#148987
+1,003
−307
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Step::is_really_defaultfromStep::should_run#148965One of the confusing things about bootstrap's
Step::should_runis that it combines two loosely-related but non-overlapping responsibilities:./x test compiler, this allows bootstrap to know what steps “compiler” should translate intoDEFAULT = trueshould actually run or not, when no paths/aliases are explicitly specified./x test, this allows bootstrap to know which steps to run by defaultThis PR therefore splits out the latter of those responsibilities into a dedicated
is_default_stepassociated function, which also replaces the existingDEFAULTassociated constant.A small number of steps were using
ShouldRun::lazy_default_conditionto specify a condition that should not be run repeatedly if possible, e.g. because it queries external tools. Those steps now perform memoization via fields inBuilderinstead.r? jieyouxu