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

Testing workspace package with features expects the root package to have those features #4106

Closed
torkleyy opened this issue May 26, 2017 · 3 comments · Fixed by #8074
Closed
Labels
A-features Area: features — conditional compilation A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@torkleyy
Copy link
Contributor

torkleyy commented May 26, 2017

Consider this project structure:

foo
├── bar
│   ├── Cargo.toml
│   └── src
│       └── lib.rs
├── Cargo.toml
└── src
    └── lib.rs

If I add a feature to foo/bar/Cargo.toml called whatever and I run

cargo test -p bar --features whatever

I get

error: Package `foo v0.1.0 (file://[...]/foo)` does not have these features: `whatever`
@alexcrichton
Copy link
Member

Ah yes currently Cargo interprets --features as applying to the "target" crate of the --manifest-path or current directory arguments. Right now there's no way to activate selective features in selected crates transitively, unfortunately.

@carols10cents carols10cents added A-features Area: features — conditional compilation A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` labels Oct 3, 2017
@torkleyy
Copy link
Contributor Author

torkleyy commented May 12, 2018 via email

@sharksforarms
Copy link

Oops, I had deleted my comment shortly after I posted, to give some context to torkleyy's comment, I had asked if --features flags got passed down to dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-features Area: features — conditional compilation A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants