You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project with two binary crates as well as a common library crate. Both binaries depend on the library, but are unrelated to each other.
When activating a feature on one of the binaries the feature gets activated on the other binary as well. I'm not sure if that is intended.
I made a minimal case here. shared_lib/src/lib.rs in the test case has two different return values, based on the state of my_feature. bin1 does not set the feature, bin2 does. When executing cargo run --bin bin1 bin1 behaves as if the feature is set.
Steps
Have two binary crates in one workspace
Set a feature of a common dependency that lives in the same workspace for one of the binary crates
See that the feature is also set for the second binary crate
Thanks for the report! This is a known issue where using --bin bin1 implies --workspace in order to find where bin1 is located. The --workspace flag causes all features of all workspace members to be unified. You can instead use -p bin1 to tell cargo to only use the bin1 package.
Problem
I have a project with two binary crates as well as a common library crate. Both binaries depend on the library, but are unrelated to each other.
When activating a feature on one of the binaries the feature gets activated on the other binary as well. I'm not sure if that is intended.
I made a minimal case here.
shared_lib/src/lib.rs
in the test case has two different return values, based on the state ofmy_feature
.bin1
does not set the feature,bin2
does. When executingcargo run --bin bin1
bin1 behaves as if the feature is set.Steps
Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: