bootstrap: Split out Step::is_really_default from Step::should_run#148965
bootstrap: Split out Step::is_really_default from Step::should_run#148965Zalathar wants to merge 1 commit intorust-lang:mainfrom
Step::is_really_default from Step::should_run#148965Conversation
|
r? @clubby789 rustbot has assigned @clubby789. Use |
| // named `builder` for IDE autocompletion. | ||
| let _ = builder; | ||
| Self::DEFAULT | ||
| } |
There was a problem hiding this comment.
Discussion: maybe a name like finalized_default? I kinda hate that name too, it reminds me of the convoluted compiler lint level decoration logic... Anyway, 'finalized' in the sense that there's a hierarchy or precedence ordering:
Step::DEFAULTis the "base" default.is_really_defaultorfinalized_defaultcan "override" this base default subject to conditions.
(2) then finally determines if a Step is eligible to run.
I say this because is_really_default I find quite confusing to read...
There was a problem hiding this comment.
I don't think is_really_default is a great name, but on the other hand I do appreciate that it conveys a suitable amount of “you should probably read the actual docs for this oddly-named function instead of assuming that it does something intuitive”.
There was a problem hiding this comment.
... Yeah. Let's land this now as is_really_default, if we can come up with a better name later, we can always do that in a follow-up.
There was a problem hiding this comment.
Would it be possible to merge const DEFAULT and fn is_really_default into a single fn default that returns a constant value for most steps?
There was a problem hiding this comment.
Hm yeah. I think I like that better.
| /// Called to allow steps to register the command-line paths that should | ||
| /// cause them to run. |
There was a problem hiding this comment.
Discussion:
command-line paths
I guess this is a path / path filter. Discussing in #t-infra/bootstrap > Path filters in bootstrap @ 💬 on what we actually call these
./x test xxx
^-- what is this called?
|
@bors r+ rollup |
|
@bors r- |
|
#148965 (comment), but also doesn't necessarily need to be in this PR, at your discretion. |
b9b6b58 to
7b863bb
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
The additional changes for |
|
☔ The latest upstream changes (presumably #148763) made this pull request unmergeable. Please resolve the merge conflicts. |
bootstrap: Replace `Step::DEFAULT` and `default_condition` with `is_default_step` - Revised and expanded version of #148965 --- One of the confusing things about bootstrap's `Step::should_run` is that it combines two loosely-related but non-overlapping responsibilities: - Registering paths/aliases to decide whether a step should be run in response to paths/aliases passed as explicit command-line arguments - When the user invokes `./x test compiler`, this allows bootstrap to know what steps “compiler” should translate into - Deciding whether a step marked `DEFAULT = true` should actually run or not, when no paths/aliases are explicitly specified - When the user invokes `./x test`, this allows bootstrap to know which steps to run by default This PR therefore splits out the latter of those responsibilities into a dedicated `is_default_step` associated function, which also replaces the existing `DEFAULT` associated constant. A small number of steps were using `ShouldRun::lazy_default_condition` to 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 in `Builder` instead. r? jieyouxu
bootstrap: Replace `Step::DEFAULT` and `default_condition` with `is_default_step` - Revised and expanded version of #148965 --- One of the confusing things about bootstrap's `Step::should_run` is that it combines two loosely-related but non-overlapping responsibilities: - Registering paths/aliases to decide whether a step should be run in response to paths/aliases passed as explicit command-line arguments - When the user invokes `./x test compiler`, this allows bootstrap to know what steps “compiler” should translate into - Deciding whether a step marked `DEFAULT = true` should actually run or not, when no paths/aliases are explicitly specified - When the user invokes `./x test`, this allows bootstrap to know which steps to run by default This PR therefore splits out the latter of those responsibilities into a dedicated `is_default_step` associated function, which also replaces the existing `DEFAULT` associated constant. A small number of steps were using `ShouldRun::lazy_default_condition` to 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 in `Builder` instead. r? jieyouxu
bootstrap: Replace `Step::DEFAULT` and `default_condition` with `is_default_step` - Revised and expanded version of #148965 --- One of the confusing things about bootstrap's `Step::should_run` is that it combines two loosely-related but non-overlapping responsibilities: - Registering paths/aliases to decide whether a step should be run in response to paths/aliases passed as explicit command-line arguments - When the user invokes `./x test compiler`, this allows bootstrap to know what steps “compiler” should translate into - Deciding whether a step marked `DEFAULT = true` should actually run or not, when no paths/aliases are explicitly specified - When the user invokes `./x test`, this allows bootstrap to know which steps to run by default This PR therefore splits out the latter of those responsibilities into a dedicated `is_default_step` associated function, which also replaces the existing `DEFAULT` associated constant. A small number of steps were using `ShouldRun::lazy_default_condition` to 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 in `Builder` instead. r? jieyouxu
|
Obsoleted by #148987. |
bootstrap: Replace `Step::DEFAULT` and `default_condition` with `is_default_step` - Revised and expanded version of rust-lang/rust#148965 --- One of the confusing things about bootstrap's `Step::should_run` is that it combines two loosely-related but non-overlapping responsibilities: - Registering paths/aliases to decide whether a step should be run in response to paths/aliases passed as explicit command-line arguments - When the user invokes `./x test compiler`, this allows bootstrap to know what steps “compiler” should translate into - Deciding whether a step marked `DEFAULT = true` should actually run or not, when no paths/aliases are explicitly specified - When the user invokes `./x test`, this allows bootstrap to know which steps to run by default This PR therefore splits out the latter of those responsibilities into a dedicated `is_default_step` associated function, which also replaces the existing `DEFAULT` associated constant. A small number of steps were using `ShouldRun::lazy_default_condition` to 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 in `Builder` instead. r? jieyouxu
bootstrap: Replace `Step::DEFAULT` and `default_condition` with `is_default_step` - Revised and expanded version of rust-lang/rust#148965 --- One of the confusing things about bootstrap's `Step::should_run` is that it combines two loosely-related but non-overlapping responsibilities: - Registering paths/aliases to decide whether a step should be run in response to paths/aliases passed as explicit command-line arguments - When the user invokes `./x test compiler`, this allows bootstrap to know what steps “compiler” should translate into - Deciding whether a step marked `DEFAULT = true` should actually run or not, when no paths/aliases are explicitly specified - When the user invokes `./x test`, this allows bootstrap to know which steps to run by default This PR therefore splits out the latter of those responsibilities into a dedicated `is_default_step` associated function, which also replaces the existing `DEFAULT` associated constant. A small number of steps were using `ShouldRun::lazy_default_condition` to 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 in `Builder` instead. r? jieyouxu
bootstrap: Replace `Step::DEFAULT` and `default_condition` with `is_default_step` - Revised and expanded version of rust-lang/rust#148965 --- One of the confusing things about bootstrap's `Step::should_run` is that it combines two loosely-related but non-overlapping responsibilities: - Registering paths/aliases to decide whether a step should be run in response to paths/aliases passed as explicit command-line arguments - When the user invokes `./x test compiler`, this allows bootstrap to know what steps “compiler” should translate into - Deciding whether a step marked `DEFAULT = true` should actually run or not, when no paths/aliases are explicitly specified - When the user invokes `./x test`, this allows bootstrap to know which steps to run by default This PR therefore splits out the latter of those responsibilities into a dedicated `is_default_step` associated function, which also replaces the existing `DEFAULT` associated constant. A small number of steps were using `ShouldRun::lazy_default_condition` to 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 in `Builder` instead. r? jieyouxu
bootstrap: Replace `Step::DEFAULT` and `default_condition` with `is_default_step` - Revised and expanded version of rust-lang#148965 --- One of the confusing things about bootstrap's `Step::should_run` is that it combines two loosely-related but non-overlapping responsibilities: - Registering paths/aliases to decide whether a step should be run in response to paths/aliases passed as explicit command-line arguments - When the user invokes `./x test compiler`, this allows bootstrap to know what steps “compiler” should translate into - Deciding whether a step marked `DEFAULT = true` should actually run or not, when no paths/aliases are explicitly specified - When the user invokes `./x test`, this allows bootstrap to know which steps to run by default This PR therefore splits out the latter of those responsibilities into a dedicated `is_default_step` associated function, which also replaces the existing `DEFAULT` associated constant. A small number of steps were using `ShouldRun::lazy_default_condition` to 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 in `Builder` instead. r? jieyouxu
bootstrap: Replace `Step::DEFAULT` and `default_condition` with `is_default_step` - Revised and expanded version of rust-lang/rust#148965 --- One of the confusing things about bootstrap's `Step::should_run` is that it combines two loosely-related but non-overlapping responsibilities: - Registering paths/aliases to decide whether a step should be run in response to paths/aliases passed as explicit command-line arguments - When the user invokes `./x test compiler`, this allows bootstrap to know what steps “compiler” should translate into - Deciding whether a step marked `DEFAULT = true` should actually run or not, when no paths/aliases are explicitly specified - When the user invokes `./x test`, this allows bootstrap to know which steps to run by default This PR therefore splits out the latter of those responsibilities into a dedicated `is_default_step` associated function, which also replaces the existing `DEFAULT` associated constant. A small number of steps were using `ShouldRun::lazy_default_condition` to 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 in `Builder` instead. r? jieyouxu
One 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 splits out the latter of those responsibilities into a separate
is_really_defaultassociated function.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.