-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Stabilize rustdoc --merge --parts-out-dir, and --include-parts-dir options
#152902
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -453,6 +453,35 @@ command line options from it. These options are one per line; a blank line indic | |
| an empty option. The file can use Unix or Windows style line endings, and must be | ||
| encoded as UTF-8. | ||
|
|
||
| ## `--merge`, `--parts-out-dir` and `--include-parts-dir`: control how rustdoc handles files that combine data from multiple crates | ||
|
|
||
| By default, they act like `--merge=shared` is set, and `--parts-out-dir` and `--include-parts-dir` | ||
| are turned off. The `--merge=shared` mode causes rustdoc to load the existing data in the out-dir, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be clear, we aren’t committing to a particular layout. Just that rustdoc handles them automatically. We currently go to some effort to “decompile” the output JSON to read it back in, but we don’t have to do it that way. We could drop a |
||
| combine the new crate data into it, and write the result. This is very easy to use in scripts that | ||
| manually invoke rustdoc, but it's also slow, because it performs O(crates) work on | ||
| every crate, meaning it performs O(crates<sup>2</sup>) work. | ||
|
|
||
| ```console | ||
| $ rustdoc crate1.rs --out-dir=doc | ||
| $ cat doc/search.index/crateNames/* | ||
| rd_("fcrate1") | ||
| $ rustdoc crate2.rs --out-dir=doc | ||
| $ cat doc/search.index/crateNames/* | ||
| rd_("fcrate1fcrate2") | ||
| ``` | ||
|
|
||
| To delay shared-data merging until the end of a build, so that you only have to perform O(crates) | ||
| work, use `--merge=none` on every crate except the last one, which will use `--merge=finalize`. | ||
|
|
||
| ```console | ||
| $ rustdoc +nightly crate1.rs --merge=none --parts-out-dir=crate1.d -Zunstable-options | ||
| $ cat doc/search.index/crateNames/* | ||
| cat: 'doc/search.index/crateNames/*': No such file or directory | ||
| $ rustdoc +nightly crate2.rs --merge=finalize --include-parts-dir=crate1.d -Zunstable-options | ||
| $ cat doc/search.index/crateNames/* | ||
| rd_("fcrate1fcrate2") | ||
| ``` | ||
|
Comment on lines
+476
to
+483
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be helpful to adjust the example to have another dependency crate too so we can show passing |
||
|
|
||
| ## `--passes`: add more rustdoc passes | ||
|
|
||
| This flag is **deprecated**. | ||
|
|
||
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.
While mergeable info arguments standalone is great, it won't be that useful until we have
--emitstabllilized I guess?See rust-lang/cargo#16167 (comment)