EmbarkStudios / EmbarkStudios/krates
Document the status of resolver v2 support
- Dominant language
- Rust
- Stars
- 78
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
Cargo has [made it possible to depend on the same version of a given crate with different feature sets](https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2), provided that one version is a runtime dependency and another is a build dependency.
`cargo metadata` somewhat notoriously is [not aware of that](https://github.com/rust-lang/cargo/issues/10718), which leads it to conflate the build-only Cargo features with runtime features. While in reality there are two dependency graphs, `cargo metadata` still treats them as one. This causes the `resolve` graph produced by `cargo metadata` to include features and dependencies that aren't actually included in the build.
This is problematic for tools that need the precise dependency graph, such as `cargo auditable` or `cargo cyclonedx`.
It would be great to know whether `krates` overcomes this limitation, and have some example code for querying both graphs (runtime and build dependencies). It it does, then it is a big step forward for those tools!
Contributor guide
Assessment
This issue has not been assessed yet.