bootstrap: PathSet::check only considers starts_with for --skip flag#148223
bootstrap: PathSet::check only considers starts_with for --skip flag#148223jyn514 wants to merge 1 commit intorust-lang:mainfrom
--skip flag#148223Conversation
This comment has been minimized.
This comment has been minimized.
… flag The original motivation for adding this `path.starts_with` check was to allow things like `--skip=src/etc`. But it affects quite a lot more things than just `--skip`; bootstrap is really not designed for the case when multiple Steps match the same filter. For example, `x test src` does ... something! Not sure what, but something! Change `starts_with` to only affect `--skip`, not anything else. The original motivation for this was to make it so that `x doc src/doc --open` doesn't open a dozen different books, but I expect it to fix various other steps in bootstrap as well.
f27a772 to
0821573
Compare
|
the failure is because the I've added a manual As an aside, I'm not sure the snapshot test is testing what it intends to ... I don't think it realizes that the stage 2 compiler is only built as a dependency of the codegen backends. |
| } | ||
|
|
||
| fn has(&self, needle: &Path, module: Kind) -> bool { | ||
| fn has(&self, needle: &Path, module: Kind, filter_start: bool) -> bool { |
There was a problem hiding this comment.
I'm very wary of seeing cryptic booleans threaded through functions that are already have mysterious semantics to begin with.
This seems like it's going to cause a lot of frustration for whoever tries to properly clean up PathSet someday.
There was a problem hiding this comment.
Would you like me to add more doc-comments, or convert it to an enum? I really do think the current behavior is not correct ... Happy to hear other suggestions for fixing it.
|
The path checking in bootstrap is quite.. interesting 😆 Tbh I don't think it's unreasonable to expect that Ideally, we would revamp the whole system from the ground up based on some agreed-upon reasoning that is well-defined for all our current use-cases, but.. you know 😆 I think that at some places we should be using prefixes, at some places suffixes/prefixes, at some places an exact match, etc., but that's not trivial to do at the moment. For your fix, I would appreciate using at least an enum (as Zalathar mentioned), so that we can make it a bit more explicit how does the matching work.
The snapshot tests simply print all non-trivial steps that are executed for a given bootstrap invocation, they don't care whether they are built as a dependency or not. We want to see e.g. if some step is suddenly becoming executed even if only as a dependency. |
I have a concern about spot-fixing the pathset-related handling logic, this is an aspect that I genuinely think we as a team need to take a step back, and survey all the different variations of pathset-like handling we have in bootstrap, before changing its current behavior any further. The pathset-related handling, at least when I briefly had a look, was the product of organic growth over the years, and there's no overarching design philosophy (even if there was, the I understand that this PR only
But I really would encourage us to take a step back and have a closer look at the larger picture surrounding pathset logic before making any changes to its current behavior. |
|
That is to say, usually I would be fine with these kind of fixes, but the I fully agree that the current behavior surely isn't right, and "what should be considered correct" is the question that I would like the team to discuss. |
|
☔ The latest upstream changes (presumably #152230) made this pull request unmergeable. Please resolve the merge conflicts. |
The original motivation for adding this
path.starts_withcheck was to allow things like--skip=src/etc: #133492. But it affects quite a lot more things than just--skip; bootstrap is really not designed for the case when multiple Steps match the same filter (#134919 (comment)). For example,x test srcdoes ... something! Not sure what, but something!This has already caused several issues; see #135022, #135022, probably others I am forgetting.
Change
starts_withto only affect--skip, not anything else.The immediate motivation for this change was to prevent
x doc --open src/docfrom opening a dozen different pages (seewas_explicitly_invokedfor how this is related).r? bootstrap cc @marcoieni @onur-ozkan @jieyouxu @Zalathar