Fix so cargo_metadata isn't a dependency without the cargo_metadata feature #2200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
uniffi_test
crate unconditionally depends oncargo_metadata
, and this will be difficult to change. This means that becauseuniffi_test
is an unconditional dependency ofuniffi_bindgen
, thecargo_metadata
feature doesn't actually preventuniffi_bindgen
from depending oncargo_metadata
.The top level
uniffi
create already has a featurebindgen-tests
. This patch introduces a feature of the same name touniffi_bindgen
. Enabling that feature also enables the metadata feature. This means that if you do not enable either of these features you should be able to avoidcargo_metadata
.This patch also renames the new
cargo_metadata
feature to becargo-metadata
to be more consistent with our existing features and Rust feature naming in general.This is on the path to trying to untangle the requirements for #2195, so I'd love feedback from @skeet70 - note that this doesn't actually fix the issue found there, but it's a step in the right direction. My intention is to push the actual execution of
cargo metadata
out to both the cli and touniffi_testing
, and this is a step in that direction.