-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Describe the problem you are trying to solve
Given two crates foo and foo-macro, where foo-macro has a dependency on foo, foo should be able to optionally depend on foo-macro via a cargo feature (as long as foo-macro does not activate the feature).
Describe the solution you'd like
See above.
Notes
With the new v2 dependency resolver (amazing stuff by the way, this solves a lot of other various wrinkles I've stumbled across), it feels like this should be fairly straight forward to solve for someone familiar with the cargo internals. My guess would be the checker for cyclic dependencies simply now has false positives and adjusting the check to recognize the above scenarios would simply work.
For a more concrete use case, SQLx currently has three primary crates: sqlx, sqlx-core, and sqlx-macros. All the sqlx crate does is forward everything from sqlx-core and sqlx-macros into a single crate. sqlx-macros needs to use sqlx-core. This feature request would remove the need to have the sqlx-core crate.