add a "standalone" path for doc::Standalone to be able to exclude it

Before this commit, the path for the doc::Standalone step was "src/doc",
which is accurate as the standalone docs source files live at the root
of the "src/doc" directory tree.

Unfortunately, that caused bad interactions when trying to exclude it
with `--exclude src/doc`. When an exclusion is passed to bootstrap, it
will exclude all steps whose path *ends with* the exclusion, which
results in the Cargo book (src/tools/cargo/src/doc) to also be excluded.

To work around this problem, this commit adds the "standalone" path as
an alternate path for doc::Standalone, allowing `--exclude standalone`
to work without side effects.
This commit is contained in:
Pietro Albini 2022-10-05 12:45:52 +02:00
parent afe29e48bc
commit 004b8b98d6
No known key found for this signature in database
GPG Key ID: CD76B35F7734769E

View File

@ -299,7 +299,7 @@ impl Step for Standalone {
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
run.path("src/doc").default_condition(builder.config.docs)
run.path("src/doc").path("standalone").default_condition(builder.config.docs)
}
fn make_run(run: RunConfig<'_>) {