feat: make uniffi optional behind the ffi feature - #8
Merged
Conversation
uniffi was an unconditional dependency, so every Rust consumer compiled it plus its bindgen chain (goblin, weedle2, cargo_metadata, scroll, bincode) purely to support the iOS/Android bindings. That is ~22 crates of dead weight for CLI and server consumers. Gate it behind an 'ffi' feature, left ON by default so the mobile bindings keep building unchanged. Rust-only consumers opt out with default-features = false. Also drop the [build-dependencies] uniffi entry: the crate has no build.rs, so it was never used. Refs cooklang/cookcli#366
dubadub
added a commit
to cooklang/cooklang-reports
that referenced
this pull request
Jul 13, 2026
cooklang-find enables uniffi by default for the mobile bindings. As a Rust-only consumer we don't need it, and pulling it in forces the whole bindgen chain (goblin, weedle2, cargo_metadata) on every downstream. Depends on cooklang/cooklang-find#8.
dubadub
added a commit
to cooklang/cooklang-reports
that referenced
this pull request
Jul 14, 2026
* chore(deps): move to cooklang-find 0.6 cooklang-reports was the last crate holding the 0.5 line, which forced downstreams to compile cooklang-find twice (0.5 and 0.6) in the same graph. The only call site, get_recipe_str(), is API-compatible in 0.6. Refs cooklang/cookcli#366 * chore(deps): opt out of cooklang-find's ffi feature cooklang-find enables uniffi by default for the mobile bindings. As a Rust-only consumer we don't need it, and pulling it in forces the whole bindgen chain (goblin, weedle2, cargo_metadata) on every downstream. Depends on cooklang/cooklang-find#8.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of the dependency reduction for cooklang/cookcli#366 ("Dependency Hell").
Problem
uniffiis an unconditional dependency ofcooklang-find. It exists to generate the iOS/Android bindings — but every Rust consumer compiles it anyway, along with its bindgen chain:uniffi_bindgen,goblin,weedle2,cargo_metadata,scroll,bincode,basic-toml,fs-err, ...For CookCLI that is ~22 crates of pure dead weight, and
uniffi_bindgenis a heavyweight build-time dependency that must compile before anything else in the graph.Change
uniffibecomesoptional = true, gated behind a newffifeature.ffiis ON by default, so the mobile bindings (cooklang-android,cooklang-kotlin) keep building with no change on their side. Rust-only consumers opt out withdefault-features = false.clinow impliesffi, since theuniffi-bindgenbinary needs it.[build-dependencies] uniffientry — the crate has nobuild.rs, so it was never used.I chose default-on rather than the arguably cleaner default-off specifically to avoid silently breaking the mobile builds. Happy to flip it if you would rather have the FFI be opt-in.
Verification
ffion)--no-default-featurescargo fmt --checkclean.Follow-on
This only removes uniffi from CookCLI's graph in combination with:
cooklang-reportsontocooklang-find0.6 (it is the last crate on the 0.5 line, so CookCLI currently compilescooklang-findtwice)cooklang-reports0.5.x +default-features = falseon bothWith all three, CookCLI goes 418 → 396 crates and
uniffileaves the graph entirely.