Skip to content

Commit dd12046

Browse files
committed
Auto merge of #135096 - jieyouxu:fix-doc-submodule-handling, r=onur-ozkan
bootstrap: correctly handle doc paths within submodules Fixes #135041 by passing the correct submodule path when requiring submodules. This PR changes `is_path_in_submodule` to `submodule_path_of`. `submodule_path_of` returns the path of the containing submodule when given a path nested inside a submodule we handle, and `None` otherwise. I tested this manually locally by unregistering the `src/tools/cargo` submodule, then running `./x doc src/tools/cargo/src/doc`. This command fails on master with ``` thread 'main' panicked at src/bootstrap/src/utils/helpers.rs:441:5: std::fs::read_dir(dir) failed with No such file or directory (os error 2) ``` since the require submodule fails as `src/tools/cargo/src/doc` is not a known submodule. Now we use the submodule path if such a nested-in-submodule-path is passed, and thus running this command with cargo submodule unregistered still succeeds: ``` Rustbook (x86_64-unknown-linux-gnu) - cargo Doc path: /home/joe/repos/rust/build/x86_64-unknown-linux-gnu/doc/cargo/index.html Build completed successfully in 0:00:11 ``` r? `@onur-ozkan`
2 parents cf3eb35 + 9fdf5b1 commit dd12046

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)