Fix alias path for rustdoc#154571
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? me |
| } | ||
|
|
||
| /// Multiple on-disk paths that should be treated as aliases of one another. | ||
| pub fn path_aliases(mut self, paths: &[&str]) -> Self { |
There was a problem hiding this comment.
Discussion: hm, so this is a bit interesting, I'm not quite sure I like to call these "aliases", because for instance
run.path_aliases(&["src/librustdoc", "src/tools/rustdoc"])
Here src/librustdoc and src/tools/rustdoc may be considered should_run-eligible selectors for CrateRustdoc (which AFAIK is a "shared" common step for other rustdoc test steps), they are not really "aliases" I want to say... They are "eligible selectors"?
Not quite sure how to say this, curious to hear from other bootstrap maintainers.
cc @rust-lang/bootstrap
There was a problem hiding this comment.
Is run.selectors(&["src/librustdoc", "src/tools/rustdoc"]) any clearer 🤔
There was a problem hiding this comment.
Yeah, selectors sounds clearer to me. These entries are not necessarily aliases in the semantic sense; they are multiple CLI selectors that should map to the same PathSet for selection/skipping.
There was a problem hiding this comment.
I think selectors is probably more accurate 👍
Co-authored-by: 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>
|
I'd like a second opinion on this. |
|
@rustbot ready |
|
@bors r+ |
Rollup of 4 pull requests Successful merges: - #154571 (Fix alias path for rustdoc) - #155749 (`-Znext-solver` Ignore region constraints from the nested goals in leakcheck) - #156026 (`bufreader::Buffer`: Remove leftover note about `initialized` field) - #156063 (Map `WSAESHUTDOWN` to `io::ErrorKind::BrokenPipe`)
Rollup merge of #154571 - chenyukang:yukang-fix-alias-path, r=clubby789 Fix alias path for rustdoc I ran this command: ```console x build --stage 1 --skip rustdoc Building bootstrap Compiling bootstrap v0.0.0 (/Users/yukang/rust/src/bootstrap) Finished `dev` profile [unoptimized] target(s) in 1.08s /Users/yukang/rust/build/aarch64-apple-darwin/ci-llvm/bin/llvm-strip does not exist; skipping copy Building stage1 compiler artifacts (stage0 -> stage1, aarch64-apple-darwin) Finished `release` profile [optimized + debuginfo] target(s) in 0.45s Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`) Building stage1 library artifacts{alloc, compiler_builtins, core, panic_abort, panic_unwind, proc_macro, rustc-std-workspace-core, std, std_detect, sysroot, test, unwind} (stage1 -> stage1, aarch64-apple-darwin) Finished `dist` profile [optimized + debuginfo] target(s) in 0.10s Skipping Set({build::src/tools/rustdoc}) because it is excluded Building stage1 rustdoc_tool_binary (stage0 -> stage1, aarch64-apple-darwin) Finished `release` profile [optimized + debuginfo] target(s) in 0.19s ``` expect all `rustdoc` related compiling phase will be exlcuded, but from the log we can see `rustdoc_tool_binary` is still compiled. `src/tools/rustdoc` and `src/librustdoc` are documented as aliases in path set here: https://github.com/rust-lang/rust/blob/a25435bcf7cfc9b953d356eda3a51db8da9e3386/src/bootstrap/src/core/builder/mod.rs#L355-L360 we can also see here two paths are treated as alias: https://github.com/rust-lang/rust/blob/a25435bcf7cfc9b953d356eda3a51db8da9e3386/src/bootstrap/src/core/build_steps/check.rs#L818-L822 but bootstrap registered them as two different sets with `.path(..).path(...)`: https://github.com/rust-lang/rust/blob/a25435bcf7cfc9b953d356eda3a51db8da9e3386/src/bootstrap/src/core/build_steps/tool.rs#L691-L693 That meant commands like `x build --skip rustdoc`, `--skip src/tools/rustdoc`, or `--skip src/librustdoc` only excluded one side.
I ran this command:
expect all
rustdocrelated compiling phase will be exlcuded, but from the log we can seerustdoc_tool_binaryis still compiled.src/tools/rustdocandsrc/librustdocare documented as aliases in path set here:rust/src/bootstrap/src/core/builder/mod.rs
Lines 355 to 360 in a25435b
we can also see here two paths are treated as alias:
rust/src/bootstrap/src/core/build_steps/check.rs
Lines 818 to 822 in a25435b
but bootstrap registered them as two different sets with
.path(..).path(...):rust/src/bootstrap/src/core/build_steps/tool.rs
Lines 691 to 693 in a25435b
That meant commands like
x build --skip rustdoc,--skip src/tools/rustdoc, or--skip src/librustdoconly excluded one side.