Skip to content
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

rustdoc: follow-up work for --emit=toolchain-shared-resources #83784

Open
3 tasks done
jyn514 opened this issue Apr 2, 2021 · 0 comments
Open
3 tasks done

rustdoc: follow-up work for --emit=toolchain-shared-resources #83784

jyn514 opened this issue Apr 2, 2021 · 0 comments
Labels
A-CLI Area: Command-line interface (CLI) to the compiler C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. requires-nightly This issue requires a nightly compiler in some way. S-tracking-perma-unstable Status: The feature will stay unstable indefinitely. T-docs-rs Relevant to the docs-rs subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Apr 2, 2021

This is a tracking issue for the unstable feature --emit=toolchain-shared-resources, which requires -Z unstable-options. This feature is not meant to ever be stabilized; it's used by docs.rs to avoid copying the same files for each crate. Users other than docs.rs are not supported.

Unresolved Questions

  • Can we get rid of unversioned-shared-resources completely? It's unclear what the difference between a versioned and unversioned resource is; I don't know if rustdoc can promise its files will never change even across toolchains.
  • main.js is currently marked as a toolchain resource, which is wrong if the user passes --theme in RUSTDOCFLAGS.

Implementation history

Why does this feature exist?

Docs.rs has been having quite a lot of trouble with essential files. Here are the recent developments:

  1. rustdoc added a new crates.js file a few weeks ago, breaking search for all newly built crates Search within crate is broken: "Uncaught TypeError: crates is undefined" docs.rs#1300
  2. dtolnay added crates.js and also some other essential files that were missing Add crates.js and woff2 fonts to required files docs.rs#1301
  3. It turned out the other essential files had a typo, breaking all builds Static resources corresponding to 20210305-1.52.0-nightly-caca2121f are missing docs.rs#1305. the typo was fixed by Fix spelling of FiraSans-*.woff2 docs.rs#1308
  4. rustdoc wanted to start adding more essential files (Remove theme.js file #82732, Update Source Code Pro and include italics #80705) and I got fed up of dealing with it so I opened Don't hard-code essential rustdoc files docs.rs#1312
  5. Don't hard-code essential rustdoc files docs.rs#1312 had a bug (Don't hard-code essential rustdoc files docs.rs#1312 (comment)) if we copy more files than necessary. I opened Give precedence to local shared files over global ones docs.rs#1324 giving precedence to local shared files over global ones which avoids the bug.
  6. Give precedence to local shared files over global ones docs.rs#1324 broke docs that weren't using --extern-html-root-url (Docs for releases during 2018-{10-12} appear unstyled docs.rs#1327 (comment)). The tracking issue for rebuilding those is Docs built during 2018-{10-12} link to the wrong url for static resources docs.rs#1181.

In summary, docs.rs can't copy fewer shared files than rustdoc generates, and due to 2 months of broken builds about 3 years ago, it also can't copy more. So there has to be a way to know exactly which files should be shared and which shouldn't.

@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. requires-nightly This issue requires a nightly compiler in some way. T-docs-rs Relevant to the docs-rs subteam, which will review and decide on the PR/issue. labels Apr 2, 2021
Bobo1239 added a commit to Bobo1239/rust that referenced this issue May 28, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue May 30, 2021
Remove `--print unversioned-files` from rustdoc

This flag isn't needed anymore. See rust-lang#83784.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 30, 2021
Remove `--print unversioned-files` from rustdoc

This flag isn't needed anymore. See rust-lang#83784.
@workingjubilee workingjubilee added the A-CLI Area: Command-line interface (CLI) to the compiler label Mar 5, 2023
@Dylan-DPC Dylan-DPC added the S-tracking-perma-unstable Status: The feature will stay unstable indefinitely. label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: Command-line interface (CLI) to the compiler C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. requires-nightly This issue requires a nightly compiler in some way. S-tracking-perma-unstable Status: The feature will stay unstable indefinitely. T-docs-rs Relevant to the docs-rs subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants