feat(rustdoc): stabilize --emit flag#146220
Conversation
|
Questions:
|
|
cc @aDotInTheVoid since you've involved in the PR removing the last blocker :) |
|
We discussed on today's rustdoc meeting. Before going any further, we will investigate exactly what each |
Thanks for it! This PR contains a doc based on my understanding and the history of these options, but I am not 100% sure if that is correct |
e1a5014 to
cc82db2
Compare
This comment has been minimized.
This comment has been minimized.
cc82db2 to
bfb63c3
Compare
|
I haven't read this yet but here are probably some very important and relevant considerations: #83784. |
|
For the use case in Cargo, we actually don't need anything other than
I guess one way forward is that rustdoc provides an extra emit type, say,
|
This option hasn't done anything for a long time, and can be removed. I've kept a shim in place to avoid breaking docs.rs, but the option no longer does anything. Using git-blame, I tracked this option down to f77ebd4, the commit that introduced EmitType in the first place. It was used with SharedResource::Unversioned, which no longer exists since f9e1f6f removed them. Part of rust-lang#146220
|
I've opened #148180, a follow-up that removes the no-op unversioned-shared-resources, which hasn't done anything ever since we switched to using hashes for cache busting. |
This option hasn't done anything for a long time, and can be removed. I've kept a shim in place to avoid breaking docs.rs, but the option no longer does anything. Using git-blame, I tracked this option down to f77ebd4, the commit that introduced EmitType in the first place. It was used with SharedResource::Unversioned, which no longer exists since f9e1f6f removed them. CC rust-lang#146220 Part of rust-lang#83784
bfb63c3 to
b7f8908
Compare
This comment has been minimized.
This comment has been minimized.
This option hasn't done anything for a long time, and can be removed. I've kept a shim in place to avoid breaking docs.rs, but the option no longer does anything. Using git-blame, I tracked this option down to f77ebd4, the commit that introduced EmitType in the first place. It was used with SharedResource::Unversioned, which no longer exists since f9e1f6f removed them. CC rust-lang#146220 Part of rust-lang#83784
…rces, r=GuillaumeGomez rustdoc: remove `--emit=unversioned-shared-resources` This option hasn't done anything for a long time, and can be removed. I've kept a shim in place to avoid breaking docs.rs, but the option no longer does anything. Using git-blame, I tracked this option down to f77ebd4, the commit that introduced EmitType in the first place. It was used with SharedResource::Unversioned, which no longer exists since f9e1f6f removed them. CC rust-lang#146220 Part of rust-lang#83784
…eGomez rustdoc: fix `--emit=dep-info` on scraped examples Makes sure both stages (the scraping process itself, and the doc build) emit complete dependency lists. CC rust-lang/rust#146220 Part of rust-lang/rust#83784
|
I haven’t found any more problems with this feature (that don’t involve its interaction with other unstable features). I think it can be stabilized in its current form. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
@rfcbot fcp merge rustdoc |
|
Team member @GuillaumeGomez has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
| This flag controls the types of output by rustdoc. It accepts a comma-separated | ||
| list of values, and may be specified multiple times. The valid emit kinds are: | ||
|
|
||
| - `toolchain-shared-resources` --- Generates shared static files that their |
There was a problem hiding this comment.
Not sure whether these triple-dashes are considered standard :)
There was a problem hiding this comment.
It's a mdbook stuff. Not sure about rustdoc but Cargo book uses that everywhere
https://rust-lang.github.io/mdBook/format/markdown.html#smart-punctuation
b7f8908 to
d5d59c7
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rfcbot reviewed
I'd like to have a tiny stabilization report, just a few sentences esp. around the motivation would be great. For example, it's unclear to me right now whether Cargo is only interested in @rfcbot concern tiny-stab-report I've noticed that Could we please honor the outdir? @rfcbot concern outdir-not-honored (minor bikeshedding) Re. the naming of E.g., seeing the word toolchain in the context of the Re. @rfcbot concern naming Lastly, what should we do if the user passes (stable) @rfcbot concern interaction-with-other-modes The following isn't an official concern and only tangentially related. I'm wondering whether |
There was a problem hiding this comment.
(non-blocking, just some impl cleanups we should do at some point)
- Under
--emit=dep-infoand--emit=invocation-specificrustdoc still generates an empty<OUTDIR>/static.files/directory. - On unknown emission/output types rustdoc doesn't list all legal types in the error diagnostic unlike rustc.
test-dingus % ls
lib.rs
test-dingus % rustdoc +nightly --emit=toolchain-shared-resources -Zunstable-options lib.rs
test-dingus % ls
doc lib.rs
test-dingus % ls doc
static.filesMaybe the |
rustdoc: make `--emit` and `--out-dir` mimic rustc
The behavior in the test case matches rustc's:
test-dingus % ls
main.rs
test-dingus % mkdir foobar
test-dingus % rustc --emit=dep-info main.rs --out-dir=foobar
test-dingus % ls
foobar main.rs
test-dingus % ls foobar
main.d
test-dingus % rustc --emit=dep-info=testfile.d main.rs --out-dir=foobar
test-dingus % ls
foobar main.rs testfile.d
test-dingus % ls foobar
main.d
CC rust-lang#146220 (comment)
rustdoc: make `--emit` and `--out-dir` mimic rustc
The behavior in the test case matches rustc's:
test-dingus % ls
main.rs
test-dingus % mkdir foobar
test-dingus % rustc --emit=dep-info main.rs --out-dir=foobar
test-dingus % ls
foobar main.rs
test-dingus % ls foobar
main.d
test-dingus % rustc --emit=dep-info=testfile.d main.rs --out-dir=foobar
test-dingus % ls
foobar main.rs testfile.d
test-dingus % ls foobar
main.d
CC rust-lang#146220 (comment)
rustdoc: make `--emit` and `--out-dir` mimic rustc
The behavior in the test case matches rustc's:
test-dingus % ls
main.rs
test-dingus % mkdir foobar
test-dingus % rustc --emit=dep-info main.rs --out-dir=foobar
test-dingus % ls
foobar main.rs
test-dingus % ls foobar
main.d
test-dingus % rustc --emit=dep-info=testfile.d main.rs --out-dir=foobar
test-dingus % ls
foobar main.rs testfile.d
test-dingus % ls foobar
main.d
CC rust-lang#146220 (comment)
rustdoc: make `--emit` and `--out-dir` mimic rustc
The behavior in the test case matches rustc's:
test-dingus % ls
main.rs
test-dingus % mkdir foobar
test-dingus % rustc --emit=dep-info main.rs --out-dir=foobar
test-dingus % ls
foobar main.rs
test-dingus % ls foobar
main.d
test-dingus % rustc --emit=dep-info=testfile.d main.rs --out-dir=foobar
test-dingus % ls
foobar main.rs testfile.d
test-dingus % ls foobar
main.d
CC rust-lang#146220 (comment)
Rollup merge of #153003 - notriddle:emit-outdir, r=fmease rustdoc: make `--emit` and `--out-dir` mimic rustc The behavior in the test case matches rustc's: test-dingus % ls main.rs test-dingus % mkdir foobar test-dingus % rustc --emit=dep-info main.rs --out-dir=foobar test-dingus % ls foobar main.rs test-dingus % ls foobar main.d test-dingus % rustc --emit=dep-info=testfile.d main.rs --out-dir=foobar test-dingus % ls foobar main.rs testfile.d test-dingus % ls foobar main.d CC #146220 (comment)
rustdoc: rename `--emit` names These new names are pithier and match up with the rest of our terminology: - `--emit=html-static-files` matches the default name of the directory that it actually emits, which is `static.files` (the hyphen is used for emit because every other emit option uses hyphens, but the directory uses a dot because we don't want its name to conflict with a crate). - `--emit=html-non-static-files` matches the convention that emit is a noun, not an adjective, and it logically groups with other data formats. This commit changes the docs, but leaves in support for the old names, to break the cycle with cargo and docs.rs. This commit needs merged, then cargo and docs.rs will be updated to use the new names, then, finally, the old names will be removed. CC #146220 (comment)
rustdoc: rename `--emit` names These new names are pithier and match up with the rest of our terminology: - `--emit=html-static-files` matches the default name of the directory that it actually emits, which is `static.files` (the hyphen is used for emit because every other emit option uses hyphens, but the directory uses a dot because we don't want its name to conflict with a crate). - `--emit=html-non-static-files` matches the convention that emit is a noun, not an adjective, and it logically groups with other data formats. This commit changes the docs, but leaves in support for the old names, to break the cycle with cargo and docs.rs. This commit needs merged, then cargo and docs.rs will be updated to use the new names, then, finally, the old names will be removed. CC rust-lang#146220 (comment)
|
So just needs an update for the docs @weihanglo then the PR seems ready to go! |
|
As well as a tiny stabilization report, please :D (FCP concern tiny-stab-report). Moreover, FCP concern interaction-with-other-modes hasn't been resolved yet. |
View all comments
TODO: stabilization report?
r? rustdoc