-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Summary
RFC: rust-lang/rfcs#3662 (rustdoc focused)
rust-lang/rust issue: rust-lang/rust#130676
Implementation: #16167 (WIP)
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#rustdoc-mergeable-info
Leverage rustdoc's mergeable crate info, so that cargo doc can merge cross-crate information (like the search index, source files index) from separate output directories, run rustdoc in parallel, and avoid (sometimes) unexpected documentation merge.
Unresolved Issues
- How to expose this feature in Cargo?
- It would be a breaking change, as
cargo docalready exposes the legacyrustdoc --merge=sharedbehavior (rustdoc artifacts are additive) - If Cargo provides a flag, say
--config doc.merge=on|off, how to deal with that user switching betweendoc.merge=offanddoc.merge=on? Should the pre-existing HTML file be kept or removed?
- It would be a breaking change, as
- Should
rustdoc --merge=finalizebe modeled in Cargo's "unit of execution" model- Currently in Cargo, a unit in the unit graph is tied to a Command execution, for example rustc or rustdoc.
rustdoc --merge=finializeis apparently a "unit of execution". However, the currentUnitstruct is designed for compiler invocation, which havefeatures,rustflagsand Cargo target information. If we don't model this invocation in unit of work model, a special rebuild detection mechanism may need to be implemented. It might be worth a refactor if we want to support both this and Support -Zno-link #9019, and perhaps doctest execution in the future.
- Currently in Cargo, a unit in the unit graph is tied to a Command execution, for example rustc or rustdoc.
- Should all
RUSTFLAGSapply torustdoc --merge=finalizecall?- Some probably only need to pass to the
--merge=finalizeinvocation, like--extend-css?
- Some probably only need to pass to the
- crate-info JSON file name collision. Same as below
Future Extensions
No response
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status