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
When using a workspace that has multiple crates that depend on each other, enabling of feature flags prevents running of cargo check --no-default-features on all crates.
Steps
Example workspace:
crates
A [features: Foo]
B [depends on: A with feature Foo enabled]
Running
cargo c --no-default-features
inside {workspace-dir}/crates/A will cause errors when anything that should be hidden behind the Foo feature flag is referenced
cargo c --no-default-features --all
inside {workspace-dir} does not cause any errors.
Possible Solution(s)
I'd potentially expect two version of A to be checked:
One that complies with the cargo check --no-default-features command
One that suffices the dependency for B (Foo enabled)
We generally refer to this as "feature unification" and this is expected. When only do one build combination within a run. I believe #4463 is the most relevant existing issue for this.
One workaround is to use tools like cargo-hack to do multiple cargo check runs.
Going to go ahead and close this but if there is something I missed, let us know and we can re-open it!
Problem
When using a workspace that has multiple crates that depend on each other, enabling of feature flags prevents running of
cargo check --no-default-features
on all crates.Steps
Example workspace:
Foo
]Foo
enabled]Running
inside
{workspace-dir}/crates/A
will cause errors when anything that should be hidden behind theFoo
feature flag is referencedinside
{workspace-dir}
does not cause any errors.Possible Solution(s)
I'd potentially expect two version of A to be checked:
cargo check --no-default-features
commandFoo
enabled)Notes
No response
Version
The text was updated successfully, but these errors were encountered: