Skip to content

Conversation

@akhramov
Copy link

As of now, if the feature cli is enabled on uniffi crate, it starts to depend on cargo-metadata unconditionally and there's no way to opt-out, because cargo-metadata is featched by the default feature of uniffi-bindgen.

This change makes it possible to build the uniffi-bindgen binary without depending on cargo metadata, like this

cargo build --no-default-features --bin uniffi-bindgen

As of now, if the feature `cli` is enabled on uniffi crate, it starts
to depend on `cargo-metadata` unconditionally and there's no way to
opt-out, because `cargo-metadata` is featched by the default feature of
`uniffi-bindgen`.

This change makes it possible to build the `uniffi-bindgen` binary
without depending on `cargo metadata`, like this

```
cargo build --no-default-features --bin uniffi-bindgen
```
@akhramov akhramov requested a review from a team as a code owner November 28, 2025 14:23
@akhramov akhramov requested review from mhammond and removed request for a team November 28, 2025 14:23
@mhammond
Copy link
Member

I've only had a quick look and then I'll be out for a few days, but I'd have thought this patch would mean that cargo build --bin uniffi-bindgen would avoid the default feature (ie, not need --no-default-features), but that if you did want cargo_metadata enabled you'd need to specify something to explicitly enable it.

ie, are you sure this isn't going to change behaviour for existing users who want that feature by default?

@akhramov
Copy link
Author

akhramov commented Nov 28, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants