-
Notifications
You must be signed in to change notification settings - Fork 435
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
Rules to run rustdoc on multiple crates #1837
Comments
@P1n3appl3 I believe Fuchsia has interest in using rustdoc. Could you share some context here on whether what @UebelAndre is proposing works for you, or any other constrains that we might want to take into account when working on improving the documentation story? |
Yep we were also interested in a way to produce docs for the entire workspace rather than single per-crate docs which aren't very useful because links wouldn't work and you don't get an index. Off the top of my head here are some things to take into account:
|
#152 could be related |
An incremental improvement here could be to extend |
Here's a prototype of generating docs for multiple crates at once: https://github.com/konkers/rules_rust/tree/wip/rustdoc. Since rustdoc must be invoked once per crate but with the same output directory, these invocations need to be wrapped into a single Bazel action otherwise Bazel will complain about multiple rules having the same output but different inputs. This is accomplished through two scripts:
Thoughts on this approach? Specifically how do people feel about this approach of dumping the command lines and wrapping them in a single invocation later. Additionally what are people's thoughts on how to expose this functionality? Two commands (one for a single crate and one for a set of crates)? Somehow combine them into a single |
If I read the code correctly, this would require listing every |
Perhaps I'm misunderstanding some details of aspects. I understand how aspects could be used to essentially generate rules for running rustdoc on each crate. These rules could then be run on through single A larger problem, however, is that I could see an aspect approach being useful for documenting transitive dependencies of crates. Am I missing something here? |
I'm also interested in this feature. Has any progress been made here? Happy to try to contribute if someone has a stepping off point. |
I spoke with scentini offline a while ago and they pointed out that my approach of bundling all the crate documentation into a single action has scalability issues with large source bases and distributed builds. I think the way forward here is for someone to engage with the |
I just rebased and played with this and it seems to work great. I understand that this doesn't scale well and it should be implemented in a different manner long term, but also its completely opt in and it seems like it would give people the ability to bundle crate docs together in a CI step where it can afford to be a little more expensive or as a post-merge to main action that updates github pages. |
Hello! I'm from the Fuchsia team, and I'm looking at this from the rustdoc perspective! I'm working on a rustdoc RFC, I would be very happy if you could take a look and see if these additions to rustdoc would meet your needs! The goal is to allow users to invoke rustdoc on crates in separate out directories, and merge the cross-crate information that rustdoc generates. |
I would like to take multiple crates and build docs for all of them in a similar fashion to Cargo.
With Cargo, I'm able to take the following workspace with packages,
foo
,bar
, andbaz
, wherefoo
depends onbar
andbaz
is an isolated library and generate all docs in one place.rustdoc_workspace.zip
The text was updated successfully, but these errors were encountered: