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
cargo metadata somewhat notoriously is not aware of that, 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!
The text was updated successfully, but these errors were encountered:
I have a minimal reproducing example for the effects of not having resolver v2 support in this branch, if it helps: rust-secure-code/cargo-auditable@master...fix-resolver-v2
The added tests are currently failing, since the tool uses the bare cargo metadata.
I'm not confident that I got the difference between resolver v1 and v2 exactly right in my tests, so there may be something I'm missing. But the initial results are promising.
Cargo has made it possible to depend on the same version of a given crate with different feature sets, provided that one version is a runtime dependency and another is a build dependency.
cargo metadata
somewhat notoriously is not aware of that, 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 theresolve
graph produced bycargo 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
orcargo 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!The text was updated successfully, but these errors were encountered: