Allow remap-path-prefix in rustdoc#92648
Conversation
|
Please don't assign me, I'm on vacation. r? rust-lang/rustdoc |
|
cc @CraftSpider |
|
@CraftSpider any updates on this review? |
|
Sorry for the delay. Code looks fine, I'm not sure if there's a better way to test this. I'll ask in the zulip, but if no one has any ideas, I'll likely approve as-is |
|
It should be possible to write a run-make test for this, I think there's an existing one for rustc. |
|
Code change looks good. Please add the |
|
Thanks for the gentle ping. I’m still here, just very low motivation to push this over the finish line right now. |
8090b6e to
3660bfe
Compare
|
Alright, so I put a few rustdoc specific things into the existing |
|
☔ The latest upstream changes (presumably #97239) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Ping from triage: |
This adds the `--remap-path-prefix` (as an unstable option) to `rustdoc` as well, and passes it down to the rust compiler when compiling doctests. Combined with `--persist-doctests`, the generated executables should have the same resulting paths as the crate artifact itself.
3660bfe to
832c97b
Compare
|
@rustbot ready |
| compiler.arg("-Z").arg(&debugging_option_str); | ||
| } | ||
| for remap_path_prefix_str in &rustdoc_options.remap_path_prefix_strs { | ||
| compiler.arg("--remap-path-prefix").arg(&remap_path_prefix_str); |
There was a problem hiding this comment.
It looks like this is the only place you use remap-path-prefix. I think you should also pass it to the compiler options in core.rs, as well as the options used for parsing doctests.
|
☔ The latest upstream changes (presumably #98975) made this pull request unmergeable. Please resolve the merge conflicts. |
|
I believe there are a few ideas around of how to best sanitize paths in rustc in general, so I will probably close this for now until there is more movement in that area. |
This adds the
--remap-path-prefix(as an unstable option) torustdocas well, and passes it down to the rust compiler when compiling doctests.
Combined with
--persist-doctests, the generated executables shouldhave the same resulting paths as the crate artifact itself.
This is the rustdoc change needed for taiki-e/cargo-llvm-cov#122.
CC @richkadel I tried putting a
--remap-path-prefixinto all the rustc/rustdoc invocations for the coverage tests (and adjusting thellvm-cov --compilation-dirparam), but that resulted inllvm-covgenerating two different sections for the same path (probably because it is treated as different paths internally for whatever reason).However it has the intended effect for the above linked
cargo-llvm-covPR.I wonder how I could better test this. Maybe a rustdoc maintainer can help me out here.
r? @jyn514