diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-01-21 22:03:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-21 22:03:11 +0100 |
| commit | fc694064e8f2d9553738d4243c13c676327e9779 (patch) | |
| tree | a262dc1232307ab3228fb265f01ec6f00c8e0c22 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | cbaeec14f90b59a91a6b0f17fc046c66fa811892 (diff) | |
| parent | b3ad40532db231cd3ca55bc37047aa50fb1a1a71 (diff) | |
| download | rust-fc694064e8f2d9553738d4243c13c676327e9779.tar.gz rust-fc694064e8f2d9553738d4243c13c676327e9779.zip | |
Rollup merge of #91965 - ferrocene:pa-more-granular-exclude, r=Mark-Simulacrum
Add more granular `--exclude` in `x.py`
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:
./x.py test --exclude library/std
...the invocation would eventually fail, as that would not only exclude running the tests for the standard library (`library/std` in the `test` module), it would also exclude generating its documentation (`library/std` in the `doc` 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:
./x.py test --exclude test::library/std
This maintains backward compatibility with existing invocations, while allowing more ganular exclusion. Examples of the behavior:
| `--exclude` | Docs | Tests |
| ------------------- | ------- | ------- |
| `library/std` | Skipped | Skipped |
| `doc::library/std` | Skipped | Run |
| `test::library/std` | Run | Skipped |
Note that this PR only changes the `--exclude` flag, and not in other `x.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 future `Step` 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 of `std::any::type_name()` they'll also notice they have to update rustbuild.
r? `@Mark-Simulacrum`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
