Skip to content

Switch to uniffi-bindgen-kotlin-jni - #7607

Open
bendk wants to merge 2 commits into
mainfrom
bdk/push-nyxmurywznro
Open

bendk wants to merge 2 commits into
mainfrom
bdk/push-nyxmurywznro

Conversation

@bendk

@bendk bendk commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Pin our UniFFI crates to the head of
https://github.com/bendk/uniffi-rs/tree/0.32-uniffi-bindgen-kotlin-jni. That branch is 0.32.1, with the uniffi_parse_rs and uniffi-bindgen-jni changes cherry-picked in.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

@bendk bendk mentioned this pull request Sep 17, 2026
7 tasks
@bendk
bendk force-pushed the bdk/push-nyxmurywznro branch 2 times, most recently from f77615e to 79679f8 Compare September 17, 2026 20:33
@bendk
bendk force-pushed the bdk/push-nyxmurywznro branch 2 times, most recently from e35c35f to 6d27801 Compare October 6, 2026 20:14
@bendk
bendk force-pushed the bdk/push-nyxmurywznro branch from 6d27801 to 1c9cc1a Compare October 27, 2026 19:34
@bendk
bendk requested review from a team as code owners October 27, 2026 19:34
@bendk
bendk requested review from Almaju and removed request for a team October 27, 2026 19:34
#[macro_export]
macro_rules! uniffi_bridged_engine {
($name:ident) => {
($name:ident, $error_ty:ty) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later we could maybe "invert" the error, putting it in the base trait - SyncEngine could take an E - it just uses anyhow to be generic in Rust and some E bound with some into magic might be able to clean this up further.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that plan and this should work well with that, which is nice to know.

@bendk
bendk force-pushed the bdk/push-nyxmurywznro branch 7 times, most recently from d093511 to 48a579d Compare November 4, 2026 19:09
bendk added 2 commits November 5, 2026 10:42
These are transitive dependencies of the Android megazord, but we never
set up the UniFFI config for them. The bindings were getting generated
into the `uniffi` package, which was weird and will make it harder to
move to `uniffi-bindgen-kotlin-jni`

Added UniFFI configuration for `context-id` and setup the Android
bindings.

Made `interrupt-support` use the UDL in it's crate, but don't setup the
Android bindings there. Android isn't currently using this and I don't
expect it to use it in the future, since the only exported function in
`shutdown()` and Android is usually shutdown by killing the process.
TODO:
 - filter out `uniffi` packages from documentation
    - https://github.com/Kotlin/dokka/blob/9466daeb3c009a40a0a5d635a577c4f56a0c2e6b/docs/topics/runners/dokka-cli.md#per-package-configuration
- `cargo::rerun-if-changed=` for Cargo.toml files

Pin our UniFFI crates to the head of
https://github.com/bendk/uniffi-rs/tree/0.32-uniffi-bindgen-kotlin-jni.
That branch is 0.32.1, with the uniffi_parse_rs and uniffi-bindgen-jni
changes cherry-picked in.

* Added uniffi-bindgen-kotlin-jni binary, which we run from the gradle
  scripts.
* Update the gradle code to generate all bindings from the megazord.
  This simplifies the overall process and we no longer need to copy
  around `libmegazord.so` so much.
* Make `megazord` depend on all UniFFI crates, including transitive
  dependencies.  This is a `uniffi-bindgen-kotlin-jni` requirement.
* Don't use `uniffi-bindgen-kotlin-jni` on `glean-sym`.  It's failing
  because it expects some items to be public, but we don't need it
  anyways since `glean-sym` calls the UniFFI code directly.
@bendk
bendk force-pushed the bdk/push-nyxmurywznro branch from 48a579d to bad2792 Compare November 5, 2026 15:49

This branch has not been deployed

No deployments
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