Add dart/flutter bindings to livekit-uniffi#1183
Open
jhugman wants to merge 5 commits into
Open
Conversation
Contributor
ChangesetThe following package versions will be affected by this PR:
|
Release/multi-platform delivery for the Dart package: - uniffi-cdylib.yml builds liblivekit_uniffi for desktop + mobile targets and attaches build-<triple>.zip (+ .sha256) to the livekit-uniffi release; wired into uniffi-packages.yml. Validated across all 10 targets via CI dry-run. - hook/build.dart.tera gains a download mode: fetches and SHA-256-verifies the prebuilt library for the target when no local build is present.
Ship tests in support/dart/test, copied into the generated package by the dart-package flow. Covers the FFI smoke path (buildVersion) and a real JWT/HMAC round-trip (generate -> verify -> decode, plus wrong-secret rejection) to exercise Rust logic across the boundary.
uniffi-dart-test.yml builds the Dart package (host cdylib + bindings via cargo make dart-package) and runs dart test on PRs/pushes touching livekit-uniffi or its dependencies. The dart build keeps symbols (CARGO_PROFILE_RELEASE_STRIP=false) so library-mode bindgen can read the UNIFFI_META_* metadata, which the release strip removes on Linux.
cdd271c to
c60ae51
Compare
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.
Before you submit your PR
Make sure the following is true before submitting your PR:
PR description
Added Dart bindings with the uniffi-dart bindgen. This generates a
Native AssetsAPI. Exercise withcargo make bindgen-dart.This adds a uniffi-bindgen-dart feature to the
livekit-unifficrate: followup would be to separate out the uniffi-tooling binaries in to a workspace centred tooling crate.Added consumable package, with a hook/build.dart. This works both locally, and by downloading a prebuilt cdylib.
Added CI which builds the cdylibs per OS/architecture on release.
Breaking changes
No changes breaking changes are made, however:
uniffi-dartbindgen needed a bug fix which means the version of uniffi-dart is from main (pinned to the hash).uniffi-bindgen-node. Followup: moveuniffi-bindgen-nodetouniffi-bindgen-react-native.MSRV
No changes. uniffi 0.31 requires >= 1.85
Testing
support/dart/tests): a smoke test including a negative case.Async
We want the project to be runtime-agnostic, so please reuse what's already in livekit-runtime and feel free to add anything missing. It's ok to use Tokio directly, when writing unit tests, if necessary. When testing, do not use artificial delays for the state to "catch up"; instead, respect the event flow and subscribe properly using channels or other mechanisms.