-
Notifications
You must be signed in to change notification settings - Fork 2.6k
cargo add <crate> --git=<repo> -F <feature>
results in "error: unrecognized feature for crate <crate>" for crates in a workspace
#13542
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
Comments
cargo add <crate> --git=<repo> -F <feature>
results in "error: unrecognized feature for crate <crate>"cargo add <crate> --git=<repo> -F <feature>
results in "error: unrecognized feature for crate <crate>" for crates an a workspace
cargo add <crate> --git=<repo> -F <feature>
results in "error: unrecognized feature for crate <crate>" for crates an a workspacecargo add <crate> --git=<repo> -F <feature>
results in "error: unrecognized feature for crate <crate>" for crates in a workspace
I believe this is resolved by #13213. The current beta |
BTW, Click to see the error messages
|
Thanks, @weihanglo. It does look like the issue will be fixed by #13213. I think I'll close this as a duplicate. The error is generated from a couple of cargo-generate template directories in the project that aren't actually listed in the top level Cargo.toml as workspace members. If you happen to know a way to keep cargo from parsing those directories I'd be happy to apply that. |
This works-around rust-lang/cargo#13542
Problem
For crates in a workspace,
cargo add
with agit
flag andfeature
flag results in an "unrecognized feature" error.The error occurs if the dependency is being newly added or updated.
Discovered in the fluvio repository CI, but other workspace organized repositories seem to show the same problem.
Steps
cargo init .
cargo add fluvio --git=https://github.com/infinyon/fluvio.git -F admin
error: unrecognized feature for crate fluvio: admin
no features available for crate fluvio
fluvio = { features = ["admin"], git = "https://github.com/infinyon/fluvio.git" }
Possible Solution(s)
Manually adding the dependency works fine.
Notes
Other repos with using a workspace fail in the same way:
Repos that are not workspace organized seem to work fine:
Version
The text was updated successfully, but these errors were encountered: