Stream: rustdoc

Topic: How to run local build of `rustdoc` on a file / crate


view this post on Zulip Robin Moussu (Nov 25 2020 at 11:56):

I would like to run my fork of rustdoc on a whole repository. It works for a single file without external dependencies, but I don't know how to invoke it on a file that have dependencies, or on a whole crate. I guess that cargo doc does exactly that, but I didn't figure yet how it does it.

Note: my fork is not build with x.py, but with cargo (It's librustdoc compiled as a binary instead of a lib).

view this post on Zulip Robin Moussu (Nov 25 2020 at 12:03):

If I run it on some file that have external dependencies, I get many errors because my fork cannot find those dependencies.

view this post on Zulip Joshua Nelson (Nov 25 2020 at 12:43):

Try setting the env variable RUSTDOC as the path to your binary, then running cargo doc

view this post on Zulip Joshua Nelson (Nov 25 2020 at 12:44):

Trying to replicate cargo's build flags is not worth it IMO

view this post on Zulip Robin Moussu (Nov 25 2020 at 16:41):

Perfect, it worked! (or at least it does stuff, I need to work on the visualization part to know if this makes sense).


Last updated: Oct 11 2021 at 22:34 UTC