Skip to content

Conversation

floers
Copy link

@floers floers commented Apr 8, 2025

I created my own registry by using a git repo and found that leaving the features in the dependencies in an index entry does not work. When a crate A has dependencies with features and you try to use it via the registry in crate B the build fails when A uses symbols only available by said features.

I tested with with 1.86

@rustbot
Copy link
Collaborator

rustbot commented Apr 8, 2025

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2025
// https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html.
"req": "^0.6",
// Array of features (as strings) enabled for this dependency.
// May be omitted since Cargo 1.84.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc might be a bit ambiguous. By looking at #14838 and #14839, this omitting means, if empty then you can omit this.

If a package has a features, then the field cannot be omitted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you = give a concrete example of the failing case, and the step to produce?

@weihanglo
Copy link
Member

weihanglo commented Jun 3, 2025

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 18, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 18, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Aug 18, 2025
epage added a commit to epage/cargo that referenced this pull request Sep 12, 2025
The current wording (from rust-lang#14839) makes it sound like new Cargo doesn't care about the
`features` entries when in reality Cargo does care still, the field is
just defaulted.

Closes rust-lang#15408
epage added a commit to epage/cargo that referenced this pull request Sep 12, 2025
The current wording (from rust-lang#14839) makes it sound like new Cargo doesn't care about the
`features` entries when in reality Cargo does care still, the field is
just defaulted.

Closes rust-lang#15408
epage added a commit to epage/cargo that referenced this pull request Sep 12, 2025
The current wording (from rust-lang#14839) makes it sound like new Cargo doesn't care about the
`features` entries when in reality Cargo does care still, the field is
just defaulted.

Closes rust-lang#15408
github-merge-queue bot pushed a commit that referenced this pull request Sep 12, 2025
### What does this PR try to resolve?

The current wording (from #14839) makes it sound like new Cargo doesn't
care about the `features` entries when in reality Cargo does care still,
the field is just defaulted.

Closes #15408
### How to test and review this PR?
@ehuss ehuss closed this in #15957 Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants