-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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’s approach to producing output needs to be rethought #14595
Comments
The current design of rustdoc has explicitly avoided a second metadata blob which is required for interim processing. The reason for this is that we all of a sudden need to start distributing This problem can be worked around, but this is my largest concern if moving to a interim-json system. Also, can you explain more what this model buys us? I'm not particularly sold on deterministic |
@chris-morgan can you respond to @alexcrichton 's concerns here? |
Would you still get some benefits by specifying the universe of crates from the get-go, without writing that problematic blob of metadata to disk? It would simplify rustdoc's rendering of cross-crate trait impls and generating a search index I suppose. |
I can't speak for chris, but here are the advantages I can see from emitting a metadata blob:
In order to to smooth the process, rustdoc could embed the std.doc.json and core.doc.json in the binary so that it would work as long as no cli argument provide other jsons. It need the rustc tree to be compiled anyway... |
Triage: this is a pain point that we still feel today, especially on Windows. That being said, keeping an issue open to track it isn't really helping; we may or may not change rustdoc to fix this, or a successor to rustdoc might. I don't think this issue is very useful for tracking that, so I'm going to give it a close. Thanks! |
rustdoc was built under a single-crate-universe assumption: that the documentation would be just for that crate. While that assumption held, Rust-to-HTML generation worked fine.
This assumption is now broken. We have the
implementors/**/*.js
technique for trait implementatons; search pulls its information for many crates from one; the order in which you build the documentation of crates matters and—for the Rust repository—make docs
produces different output tomake -j docs
.It is precept upon precept,
precept upon precept;
line upon line,
line upon line;
here a little,
there a little.
It’s time to stop writing new workarounds and address the basic problem that we have here: rustdoc needs to handle this multiple-crates world intelligently. This means ditching the simple and, alas, simplistic single-pass Rust-to-HTML approach.
I propose in its stead this model:
By default, the second pass should probably still be run, but it can be turned off with a flag like
--no-html
for efficiency when you do have multiple crates. Or you can run the HTML pass by itself, which will allow meaningful Makefile dependencies in this blasé-with-respect-to-detail example, allowing efficient, consistent and correctmake -j
behaviour:The text was updated successfully, but these errors were encountered: