-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add more granular --exclude
in x.py
#91965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Isn't the problem one of dependency management rather than path includes/excludes? Either linkchecker has to force |
To clarify, in theory linkchecker could pass even if the standard library docs were skipped: the problem is that other documentation links to the standard library docs, so if the standard library docs are not there linkchecker will identify those links as broken. Changing the linkchecker step to always build all docs would indeed solve the specific problem I'm facing when excluding the standard library tests, but would also prevent other use cases: at least I have occasionally done |
cc #91794 |
I'm not actually sure this is the right implementation strategy. The module is not really a user-visible thing; and eventually some Steps may work for multiple different modules ( You should be able to adjust the match arms here to pass in the kind to StepDescription::from in some way, I think? Not sure if that'll work too easily, may need some refactoring. Ideally the strategy pursued should take into account the possibility for one struct implementing Step to have multiple different "kinds", though that might be painful -- let's try to avoid doing something that prevents it from happening in the future, at least, if possible. |
I still think |
The motivation (in my eyes) is not necessarily to fix/prevent the link check problem - I agree that has a different solution, likely with an error on excluding "too much/too little" for required dependencies like this. But the desired error there may want to suggest either excluding link check or limiting the standard library exclude, I think - though not sure. |
72c0ffc
to
9ad4b12
Compare
Changed the PR to use |
This comment has been minimized.
This comment has been minimized.
9ad4b12
to
ac5d3f6
Compare
This comment has been minimized.
This comment has been minimized.
ac5d3f6
to
e0df276
Compare
This comment has been minimized.
This comment has been minimized.
e76ed36
to
5cf334e
Compare
r=me with commits squashed (particularly the last two); I was going to do this myself but it looks like the push permissions aren't setup such that I can do that. |
x.py has support for excluding some steps from the invocation, but unfortunately that's not granular enough: some steps have the same name in different modules, and that prevents excluding only *some* of them. As a practical example, let's say you need to run everything in `./x.py test` except for the standard library tests, as those tests require IPv6 and need to be executed on a separate machine. Before this commit, if you were to just run this: ./x.py test --exclude library/std ...the execution would fail, as that would not only exclude running the tests for the standard library, it would also exclude generating its documentation (breaking linkchecker). This commit adds support for an optional module annotation in --exclude paths, allowing the user to choose which module to exclude from: ./x.py test --exclude test::library/std This maintains backward compatibility, but also allows for more ganular exclusion. More examples on how this works: | `--exclude` | Docs | Tests | | ------------------- | ------- | ------- | | `library/std` | Skipped | Skipped | | `doc::library/std` | Skipped | Run | | `test::library/std` | Run | Skipped | Note that the new behavior only works in the `--exclude` flag, and not in other x.py arguments or flags yet.
5cf334e
to
b3ad405
Compare
Squashed. @bors r=Mark-Simulacrum |
📌 Commit b3ad405 has been approved by |
…askrgr Rollup of 10 pull requests Successful merges: - rust-lang#91965 (Add more granular `--exclude` in `x.py`) - rust-lang#92467 (Ensure that early-bound function lifetimes are always 'local') - rust-lang#92586 (Set the allocation MIN_ALIGN for espidf to 4.) - rust-lang#92835 (Improve error message for key="value" cfg arguments.) - rust-lang#92843 (Improve string concatenation suggestion) - rust-lang#92963 (Implement tuple array diagnostic) - rust-lang#93046 (Use let_else in even more places) - rust-lang#93109 (Improve `Arc` and `Rc` documentation) - rust-lang#93134 (delete `Stdin::split` forwarder) - rust-lang#93139 (rustdoc: fix overflow-wrap for table layouts) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…-Simulacrum bootstrap: Disallow `--exclude test::std` Use the top-level Kind to determine whether Steps are excluded. Previously, this would use the `Kind` passed to `--exclude` (and not do any filtering at all if no kind was passed). That meant that `x test linkchecker --exclude std` would fail - you had to explicitly say `--exclude test::std`. Change bootstrap to use the top-level Kind instead, which does the right thing automatically. Note that this breaks things like `x test --exclude doc::std`, but I'm not sure why you'd ever want to do that. There's a lot of churn here, but the 1-line change in the first commit is the actual behavior change, the rest is just cleanup. Fixes rust-lang#103201. Note that this effectively reverts most of rust-lang#91965. cc `@pietroalbini`
x.py has support for excluding some steps from the current invocation, but unfortunately that's not granular enough: some steps have the same name in different modules, and that prevents excluding only some of them.
As a practical example, let's say you need to run everything in
./x.py test
except for the standard library tests, as those tests require IPv6 and need to be executed on a separate machine. Before this commit, if you were to just run this:...the invocation would eventually fail, as that would not only exclude running the tests for the standard library (
library/std
in thetest
module), it would also exclude generating its documentation (library/std
in thedoc
module), breaking linkchecker.This commit adds support to the
--exclude
flag for prefixing paths with the name of the module their step is defined in, allowing the user to choose which module to exclude from:This maintains backward compatibility with existing invocations, while allowing more ganular exclusion. Examples of the behavior:
--exclude
library/std
doc::library/std
test::library/std
Note that this PR only changes the
--exclude
flag, and not in otherx.py
arguments or flags yet.In the implementation I tried to limit the impact this would have with rustbuild as a whole as much as possible. The module name is extracted from the step by parsing the result of
std::any::type_name()
: unfortunately that output can change at any point in time, but IMO it's better than having to annotate all the existing and futureStep
implementations with the module name. I added a test to ensure the parsing works as expected, so hopefully if anyone makes changes to the output ofstd::any::type_name()
they'll also notice they have to update rustbuild.r? @Mark-Simulacrum