Skip to content
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

Provide a way to figure out why a specific dependency feature is enabled during build #13289

Closed
SludgePhD opened this issue Jan 13, 2024 · 4 comments · Fixed by #13305
Closed
Assignees
Labels
A-documenting-cargo-itself Area: Cargo's documentation A-features Area: features — conditional compilation C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@SludgePhD
Copy link

SludgePhD commented Jan 13, 2024

Problem

I'm currently trying to disable a feature in a dependency, but Cargo clearly still enables it (the items it gates are still available; there is no other way Cargo communicates this). I've checked all other crates in my dependency graph that depend on that crate, and none of them seem to enable that feature.

There does not seem to be any way, or at least any documented way, or any third-party subcommand, that can help debug this. This is incredibly frustrating.

Proposed Solution

No response

Notes

No response

@SludgePhD SludgePhD added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Jan 13, 2024
@epage
Copy link
Contributor

epage commented Jan 13, 2024

Try running cargo tree -e features -i <dep>.

If not, rust-lang/rfcs#3553 should have you covered

@epage epage added the A-features Area: features — conditional compilation label Jan 13, 2024
@SludgePhD
Copy link
Author

Thanks, that helped. Is there any way to make this more visible perhaps? I searched the web for a bunch of related queries and -e features has never come up.

@epage
Copy link
Contributor

epage commented Jan 14, 2024

#12903 expanded the troubleshooting but somehow we overlooked "why is this feature enabled" and would be a good topic to add.

@epage epage added A-documenting-cargo-itself Area: Cargo's documentation S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review and removed S-triage Status: This issue is waiting on initial triage. labels Jan 14, 2024
@linyihai
Copy link
Contributor

@rustbot claim

Try running cargo tree -e features -i .

This is a new world for me, too.

This issue was closed.
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 A-features Area: features — conditional compilation C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants