-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustbuild: Copy crate doc files fewer times #64613
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
Conversation
Previously when building documentation for the standard library we'd copy all the files 5 times, and these files include libcore/libstd docs which are huge! This commit instead only copies the files after rustdoc has been run for each crate, reducing the number of redundant copies we're making.
(rust_highfive has picked a reviewer for you, use r? to override) |
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.
r=me presuming this has been tested; it seems fine but rustdoc can be picky about ordering and such
}; | ||
for krate in &["alloc", "core", "std", "proc_macro", "test"] { | ||
run_cargo_rustdoc_for(krate); | ||
} | ||
builder.cp_r(&my_out, &out); |
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.
Can we avoid this copy entirely by instead symlinking rustdoc's outdir to out
(the final location)?
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.
I haven't strictly tested the symlink, but I wanted to land some easy wins first and start investigating deeper wins later. I believe symlinks won't work because everything attempts to preserve symlinks, and rust-installer wants to actually archive the symlink, which would cause invalid tarballs since we wouldn't actually distribute docs.
I'm working on rust-installer now though so I'll try to plumb this through eventually, ideally I don't want to have to copy documentation anywhere.
@bors: r=Mark-Simulacrum |
📌 Commit d7f6474 has been approved by |
…k-Simulacrum rustbuild: Copy crate doc files fewer times Previously when building documentation for the standard library we'd copy all the files 5 times, and these files include libcore/libstd docs which are huge! This commit instead only copies the files after rustdoc has been run for each crate, reducing the number of redundant copies we're making.
Rollup of 6 pull requests Successful merges: - #63448 (fix Miri discriminant handling) - #64592 (Point at original span when emitting unreachable lint) - #64601 (Fix backticks in documentation) - #64606 (Remove unnecessary `mut` in doc example) - #64611 (rustbuild: Don't package libstd twice) - #64613 (rustbuild: Copy crate doc files fewer times) Failed merges: r? @ghost
Rollup of 6 pull requests Successful merges: - #63448 (fix Miri discriminant handling) - #64592 (Point at original span when emitting unreachable lint) - #64601 (Fix backticks in documentation) - #64606 (Remove unnecessary `mut` in doc example) - #64611 (rustbuild: Don't package libstd twice) - #64613 (rustbuild: Copy crate doc files fewer times) Failed merges: r? @ghost
Previously when building documentation for the standard library we'd
copy all the files 5 times, and these files include libcore/libstd docs
which are huge! This commit instead only copies the files after rustdoc
has been run for each crate, reducing the number of redundant copies
we're making.