- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.7k
Closed
Labels
Description
I'm using the profile-overrides feature to optimize one specific crate in my workspace, like this:
[workspace]
members = ["base-crate", "user-crate", "opt-pkg"]
# This allows us to optimize dependencies
# If you aren't on nightly, you can just comment this out.
[profile.dev.overrides."*"]
opt-level = 3
# Also optimize opt-pkg
# Per default, workspace members are not included by "*".
[profile.dev.overrides.opt-pkg]
opt-level = 3base-crate depends on no crate from the workspace, while the other two depend on base-crate and user-crate depends on opt-pkg. base-crate also has a binary target.
This works nicely so far. When I do cargo run -p base-crate though, I get this warning:
warning: profile override spec `opt-pkg` did not match any packages
Nothing bad happens but IMO the warning is redundant. You don't get the warning when doing cargo run -p user-crate as it depends on opt-pkg. I think this is because only the resolution DAG of the package built is used. The warning should only fire if the crate can't be found in all of Cargo.lock (combined resolution DAG for all workspace crates).