Skip to content

cargo rustdoc should build docs for dependencies #2594

Open
@tari

Description

@tari

The rustdoc subcommand currently only builds documentation for the specified crate, and none of its dependencies. This is different from the behavior of cargo rustc which builds all dependencies (though that is by necessity) and cargo doc which includes all dependencies.

When building for custom targets, it is necessary to use cargo rustdoc to pass -Lpath to allow it to find the system libraries such as libcore. This only documents one crate, however, so getting the same behavior as cargo doc requires multiple invocations of cargo rustdoc with some glue logic to find dependencies.


Alternate approach that would also fix my issue: accept a RUSTDOCFLAGS environment variable similar to how RUSTFLAGS is currently handled. This is a feasible solution if the current limited behavior of cargo rustdoc is desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-rustdocS-needs-team-inputStatus: Needs input from team on whether/how to proceed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions