-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add unstable documentation dependencies under [doc-dependencies] #10435
Conversation
r? @ehuss (rust-highfive has picked a reviewer for you, use r? to override) |
This is awesome, thanks a lot! |
def392d
to
33c9dc2
Compare
We talked about this at length in today's @rust-lang/cargo meeting. Currently, Rust has three kinds of dependencies: dependencies, dev-dependencies, and build-dependencies. Adding a fourth kind of dependency would be a substantial increase in complexity. The original issue, #8905 , started out talking about using feature flags for this, and in our discussions today we felt like that approach would be much simpler and make more use of existing Cargo facilities. Crates today already use features for this, and then add docs.rs metadata telling docs.rs to use those features. And features can already control dependencies or features of dependencies. We'd be open to the idea of adding a mechanism to automatically enable a specific feature for Also, separately, this is something we'd consider to be a large feature, for which we'd like to see an RFC design rather than going directly to a PR. Doing design iteration in a PR is much higher bandwidth for us than reviewing an RFC. I'm going to close this PR in favor of #8905 , and propose that we discuss the feature design further there and subsequently in an RFC. |
The biggest issue is that it using features makes Just to be sure: if an RFC about this is made, would you be interested into it? |
@GuillaumeGomez Sorry, I missed including a detail from the meeting: We'd be open to the idea of adding a mechanism to automatically enable a specific feature for cargo doc by default. I've updated the comment above accordingly. |
This pull-request introduce the concept of documentation dependencies similar to development dependencies except that documentation dependencies are only activated for doc and doc-test.
How should we test this PR?
Cargo.toml:
src/lib.rs
cargo doc
you should see theSystem
type.How should we review this PR?
Commit by commit.
The most important change is in
src/cargo/core/compiler/unit_dependencies.rs
:Additional information
-Z avoid-dev-deps
from interacting with doc depscargo tree
Fixes #8905
cc @GuillaumeGomez