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

[patch.crates-io] ignores all features #9629

Closed
JakkuSakura opened this issue Jun 26, 2021 · 2 comments
Closed

[patch.crates-io] ignores all features #9629

JakkuSakura opened this issue Jun 26, 2021 · 2 comments
Labels
C-bug Category: bug

Comments

@JakkuSakura
Copy link

JakkuSakura commented Jun 26, 2021

Problem
I was trying to patch some of my deps, with additional features enabled in my workspace. However, features specified in [patch.crates-io] are all ignored.

Steps

[path.crates-io]
async-tungstenite = { git = "https://github.com/qiujiangkun/async-tungstenite", rev="1a544fb13fe46b22aa6df94e49277f49f8ffa8ca", features=["there-is-no-such-feature-whatsoever", "no-verbose-logging"] }

The features are ignored, no error is given(there-is-no-such-feature-whatsoever), and no feature is actually enabled(no-verbose-logging)

Possible Solution(s)
I think we can simply fix it, gives a hard error saying this is not supported, or gives a warning saying features are currently ignored

Output of cargo version:

cargo 1.54.0-nightly (44456677b 2021-06-12)
@JakkuSakura JakkuSakura added the C-bug Category: bug label Jun 26, 2021
@weihanglo
Copy link
Member

IIRC [patch] is used only for patching sources of dependencies at this moment. For fields related to "conditional compilation", such as features and optional, you still need to specify them in the original [dependencies] section.

@ehuss
Copy link
Contributor

ehuss commented Jul 2, 2021

I believe this is a duplicate of #3034, so closing in favor of that. Cargo should at least emit a warning about the unused features.

@ehuss ehuss closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants