-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support excluding the generation of the standalone docs #102706
Conversation
Before this commit, the step to generate the standalone docs (which included the index page and other HTML files at the root of the documentation) was bundled with the code copying files needed by multiple pieces of documentation. This means it wasn't possible to avoid generating the standalone docs. This commit splits the step into two, allowing the standalone docs generation to be excluded while still building the rest of the docs.
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.
Could we teach bootstrap to support anchoring paths, like |
I guess? That sounds like a way larger change than this (as we'd need to change how bootstrap handles paths), and it would retain the weird behavior if someone doesn't know how to add anchoring paths. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! r=me with the nits fixed.
@joshtriplett I think we should have a holistic conversation about what excludes should look like. The current syntax is currently quite baroque and AFAIK Pietro's CI scripts are the only ones using most of the features. Slapping git-style ignores on top seems like it will make things more confusing, not less.
That said, I agree the behavior is confusing and there's room for improvement; I'd love to get rid of the doc::
prefixes somehow and make the various paths unambiguous.
Co-authored-by: Joshua Nelson <[email protected]>
@bors r=jyn514 |
…yn514 Support excluding the generation of the standalone docs For Ferrocene we need to exclude the generation of the standalone docs (which include the index page, which we want to replace with our own), but with the way bootstrap is currently implemented that proved not possible. This PR aims to support that. The first problem is that the `doc::Standalone` step did two things: it generated the "standalone" documentation (which includes the index page and all the pages at the root of the documentation tree), but it also generated some files like `rust.css` and `version_info.html` that other step like `doc::TheBook` required. This meant generating the book required generating the index page, which made disabling the index page generation problematic. The approach I took to fix the first problem is to split the step into `doc::Standalone` and `doc::SharedAssets`, with `doc::TheBook` now depending on `doc::SharedAssets`. The second problem is that disabling the `doc::Standalone` proved to be tricky due to its path, `src/doc`. The path is accurate, as the source files for that step are `src/doc/*.md`. The problem is, bootstrap treats `--exclude` as a *suffix*, and so it also excluded the Cargo book whose source lives at `src/tools/cargo/src/doc`. The approach I took to fix the second problem is to add the `standalone` path in addition to `src/doc`, so that you can pass `--exclude standalone`. I'm not fully happy with the solution, and the other idea I had was to just move the standalone docs source code to `src/doc/standalone`. I feel that second approach is cleaner, but also requires more changes and might require more consensus. This PR is best reviewed commit-by-commit. r? `@jyn514`
…yn514 Support excluding the generation of the standalone docs For Ferrocene we need to exclude the generation of the standalone docs (which include the index page, which we want to replace with our own), but with the way bootstrap is currently implemented that proved not possible. This PR aims to support that. The first problem is that the `doc::Standalone` step did two things: it generated the "standalone" documentation (which includes the index page and all the pages at the root of the documentation tree), but it also generated some files like `rust.css` and `version_info.html` that other step like `doc::TheBook` required. This meant generating the book required generating the index page, which made disabling the index page generation problematic. The approach I took to fix the first problem is to split the step into `doc::Standalone` and `doc::SharedAssets`, with `doc::TheBook` now depending on `doc::SharedAssets`. The second problem is that disabling the `doc::Standalone` proved to be tricky due to its path, `src/doc`. The path is accurate, as the source files for that step are `src/doc/*.md`. The problem is, bootstrap treats `--exclude` as a *suffix*, and so it also excluded the Cargo book whose source lives at `src/tools/cargo/src/doc`. The approach I took to fix the second problem is to add the `standalone` path in addition to `src/doc`, so that you can pass `--exclude standalone`. I'm not fully happy with the solution, and the other idea I had was to just move the standalone docs source code to `src/doc/standalone`. I feel that second approach is cleaner, but also requires more changes and might require more consensus. This PR is best reviewed commit-by-commit. r? ``@jyn514``
@bors r- failed in a rollup it seems |
@bors try |
⌛ Trying commit 039a0f008cb5b4be922fafc74162ee65a2bd8b26 with merge 8f7d9c41d4f4a79d510dd11f125d677cd03291c4... |
039a0f0
to
91c09d4
Compare
Ok the last commit fixed the @rustbot review |
@bors r+ |
Rollup of 6 pull requests Successful merges: - rust-lang#95710 (Stabilize arbitrary_enum_discriminant, take 2) - rust-lang#102706 (Support excluding the generation of the standalone docs) - rust-lang#103428 (Removed verbose printing from the `PrettyPrinter` when printing constants) - rust-lang#103543 (Update books) - rust-lang#103546 (interpret: a bit of cast cleanup) - rust-lang#103554 (rustdoc: add visible focus outline to rustdoc-toggle) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
600: Pull changes from upstream `master` r=kirtchev-adacore a=pietroalbini * rust-lang/rust#103605 * rust-lang/rust#103604 * rust-lang/rust#103598 * rust-lang/rust#103596 * rust-lang/rust#103580 * rust-lang/rust#103579 * rust-lang/rust#103567 * rust-lang/rust#103558 * rust-lang/rust#103549 * rust-lang/rust#103537 * rust-lang/rust#103526 * rust-lang/rust#103432 * rust-lang/rust#103571 * rust-lang/rust#103492 * rust-lang/rust#103572 * rust-lang/rust#103554 * rust-lang/rust#103546 * rust-lang/rust#103543 * rust-lang/rust#103428 * rust-lang/rust#102706 * rust-lang/rust#95710 * rust-lang/rust#103284 * rust-lang/rust#103562 * rust-lang/rust#103542 * rust-lang/rust#103536 * rust-lang/rust#103533 * rust-lang/rust#103520 * rust-lang/rust#103444 * rust-lang/rust#103430 * rust-lang/rust#103416 * rust-lang/rust#103287 * rust-lang/rust#103209 * rust-lang/rust#102951 * rust-lang/rust#103279 * rust-lang/rust#103158 Co-authored-by: Lukas Wirth <[email protected]> Co-authored-by: Pietro Albini <[email protected]> Co-authored-by: DropDemBits <[email protected]> Co-authored-by: bors <[email protected]> Co-authored-by: Pietro Albini <[email protected]>
For Ferrocene we need to exclude the generation of the standalone docs (which include the index page, which we want to replace with our own), but with the way bootstrap is currently implemented that proved not possible. This PR aims to support that.
The first problem is that the
doc::Standalone
step did two things: it generated the "standalone" documentation (which includes the index page and all the pages at the root of the documentation tree), but it also generated some files likerust.css
andversion_info.html
that other step likedoc::TheBook
required. This meant generating the book required generating the index page, which made disabling the index page generation problematic.The approach I took to fix the first problem is to split the step into
doc::Standalone
anddoc::SharedAssets
, withdoc::TheBook
now depending ondoc::SharedAssets
.The second problem is that disabling the
doc::Standalone
proved to be tricky due to its path,src/doc
. The path is accurate, as the source files for that step aresrc/doc/*.md
. The problem is, bootstrap treats--exclude
as a suffix, and so it also excluded the Cargo book whose source lives atsrc/tools/cargo/src/doc
.The approach I took to fix the second problem is to add the
standalone
path in addition tosrc/doc
, so that you can pass--exclude standalone
. I'm not fully happy with the solution, and the other idea I had was to just move the standalone docs source code tosrc/doc/standalone
. I feel that second approach is cleaner, but also requires more changes and might require more consensus.This PR is best reviewed commit-by-commit.
r? @jyn514