Repository navigation
Merge livekit-ffi / livekit-uniffi together into a new livekit-ffi with room-apis andcore-modules modes
#1438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
4026257
refactor(livekit-ffi): move the FFI surface into a room_apis module
1egoman ddb1583
refactor(livekit-ffi): move the crate-root FFI types into room_apis
1egoman 6b83f68
IMPORTANT(livekit-ffi): gate the existing surface behind a room-apis …
1egoman 89d1f56
IMPORTANT(livekit-ffi): skip the libwebrtc build steps without room-apis
1egoman 7b930a1
chore(bindgens): move the Dart bindgen CLI into tools/bindgens
1egoman 8605f2e
refactor(livekit-ffi): move the livekit-uniffi sources into a core_mo…
1egoman dc8aa81
IMPORTANT(livekit-ffi): add the core-modules feature
1egoman ba5eb68
IMPORTANT(livekit-ffi): bind the core modules to prost 0.12
1egoman 9a01d68
chore(livekit-ffi): move the livekit-uniffi packaging assets in
1egoman 1561786
chore(livekit-ffi): drop the UniFFI node build
1egoman 991b2b5
chore: remove the livekit-uniffi crate
1egoman 9590c13
feat(ci): declare which feature set each platform builds
1egoman 38c71fe
IMPORTANT(livekit-ffi): build core-modules from the cargo-make packaging
1egoman 867ce51
IMPORTANT(livekit-ffi): follow the cdylib rename in the bindings config
1egoman 94a7ef9
ci: build livekit-ffi/core-modules in the uniffi workflows
1egoman cbf9b78
IMPORTANT(ci): create the release tag with the repo-writer App
1egoman 20066b6
IMPORTANT(ci): trigger the UniFFI packages from the tag push
1egoman 4f0337c
ci: retarget the Dart publish at livekit-ffi/v*
1egoman bf05dff
test(ci): keep core-modules compiled and tested per commit
1egoman c4ae74f
ci: narrow the gen-node-proto trigger
1egoman 441a1aa
docs(livekit-ffi): rewrite the crate README for the two surfaces
1egoman c72aaf4
docs: update the repo docs and add the merge changeset
1egoman 0b4aa9a
fix(livekit-ffi): make every platform-features entry self-contained
1egoman d83416d
fix(livekit-ffi): keep crate::conversion resolving after the move
1egoman 99b9379
feat(livekit-ffi): resolve build features per platform in the packaging
1egoman e3d654e
refactor(ci): state the core-modules flags in the per-commit gates
1egoman cded005
refactor(ci): remove --surface from platform_features.py
1egoman c854feb
chore(livekit-ffi): remove the orphaned python test harness
1egoman 99f5e06
fix: adjust changeset to make ci check pass
1egoman be33b2e
refactor: drop useless comments
1egoman 5da03fe
fix(changeset): cover the remaining dependent crates
1egoman 3aff285
fix(ci): run the core-modules build steps under bash
1egoman 088b773
feat: upgrade to prost 0.14 across the whole project
1egoman 84736d8
docs(livekit-ffi): drop the stale note about a split prost
1egoman 95faa05
docs(livekit-ffi): say why core-modules excludes the WebRTC stack
1egoman d6cde30
chore(ci): correct the copyright year on the feature resolver
1egoman 64c6dac
refactor(ci): rename platform_features.py to ffi_features.py
1egoman 912b8e8
refactor(livekit-ffi): group the room-apis build steps into a module
1egoman 206699f
fix: port to use pub.dev.workflow_dispatch ci trigger
1egoman 44426a2
fix(changeset): retarget the livekit-uniffi bumps at livekit-ffi
1egoman 273783b
docs(livekit-common): name the renamed Swift framework in the comment
1egoman bb49119
docs(livekit-ffi): title the Android README after the merged crate
1egoman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| --- | ||
| livekit-ffi: major | ||
| livekit: patch | ||
| livekit-api: patch | ||
| livekit-capture: patch | ||
| livekit-common: patch | ||
| livekit-data-stream: patch | ||
| livekit-datatrack: patch | ||
| livekit-net: patch | ||
| livekit-rpc: patch | ||
| livekit-signaling: patch | ||
| livekit-token-source: patch | ||
| --- | ||
|
|
||
| Merge `livekit-uniffi` into `livekit-ffi`. | ||
|
|
||
| There is now one crate, one version and one release tag. The `livekit-uniffi` | ||
| crate, its changelog and its `livekit-uniffi/v*` tags are gone; its history is | ||
| preserved in git. | ||
|
|
||
| The crate carries two mutually exclusive surfaces, selected by feature: | ||
|
|
||
| - `room-apis` (default) is the existing protobuf / C-ABI surface, with | ||
| `livekit` and libwebrtc. Everything that built `livekit-ffi` before builds it | ||
| unchanged. | ||
| - `core-modules` is the former `livekit-uniffi` surface — access tokens, log | ||
| forwarding, data tracks, data streams v2 — and depends on none of `livekit`, | ||
| `libwebrtc`, `soxr-sys` or `imgproc`. What previously built `livekit-uniffi` | ||
| now builds `-p livekit-ffi --no-default-features --features core-modules`. | ||
|
|
||
| `[package.metadata.platform-features]` in `livekit-ffi/Cargo.toml` records | ||
| which surface each downstream package build gets, and CI resolves its build | ||
| flags from it. | ||
|
|
||
| The merge itself requires no downstream SDK changes: the UniFFI namespace is | ||
| pinned per surface and every published package name is preserved. The one | ||
| difference is the native library the crate builds, `liblivekit_uniffi` → | ||
| `liblivekit_ffi`, which is loaded by name from the generated bindings and the | ||
| Dart build hook and needs no consumer change. The package renames are a | ||
| separate change, released alongside this one. | ||
|
|
||
| The UniFFI node package (`@livekit/uniffi`) is not built for now and will be | ||
| reintroduced separately; node bindings ship from `livekit-ffi-node-bindings`. | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| --- | ||
| livekit-uniffi: patch | ||
| livekit-ffi: patch | ||
| --- | ||
|
|
||
| Embed per-slice `.dSYM` bundles in the Swift `RustLiveKitUniFFI.xcframework` again so Xcode archives and crash symbolication can resolve Rust frames (livekit/client-sdk-swift#1149). | ||
| Embed per-slice `.dSYM` bundles in the Swift `RustLiveKitFFI.xcframework` again so Xcode archives and crash symbolication can resolve Rust frames (livekit/client-sdk-swift#1149). |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| #!/usr/bin/env python3 | ||
| # Copyright 2026 LiveKit, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Resolve cargo build flags for a downstream platform build of livekit-ffi. | ||
|
1egoman marked this conversation as resolved.
|
||
|
|
||
| `livekit-ffi` exposes two mutually exclusive FFI surfaces, `room-apis` and | ||
| `core-modules`. Which one each downstream package build gets is declared once, | ||
| in `[package.metadata.platform-features]` in livekit-ffi/Cargo.toml, and read | ||
| back here so a platform cannot silently drift onto the wrong surface. | ||
|
|
||
| $ ffi_features.py swift | ||
| --no-default-features --features core-modules | ||
|
|
||
| $ ffi_features.py --list | ||
| android --no-default-features --features core-modules | ||
| ... | ||
|
|
||
| Every build site that produces an artifact names its platform. Used by | ||
| livekit-ffi/Makefile.toml and by the uniffi-* workflows. | ||
| """ | ||
|
|
||
| import argparse | ||
| import json | ||
| import subprocess | ||
| import sys | ||
|
|
||
| PACKAGE = "livekit-ffi" | ||
| METADATA_KEY = "platform-features" | ||
|
|
||
|
|
||
| def load_table(): | ||
| out = subprocess.run( | ||
| ["cargo", "metadata", "--no-deps", "--format-version", "1"], | ||
| capture_output=True, | ||
| text=True, | ||
| check=True, | ||
| ).stdout | ||
| meta = json.loads(out) | ||
| for pkg in meta["packages"]: | ||
| if pkg["name"] == PACKAGE: | ||
| table = (pkg.get("metadata") or {}).get(METADATA_KEY) | ||
| if not table: | ||
| sys.exit( | ||
| f"{PACKAGE} declares no [package.metadata.{METADATA_KEY}] table" | ||
| ) | ||
| return table | ||
| sys.exit(f"{PACKAGE} not found in cargo metadata") | ||
|
|
||
|
|
||
| def flags_for(entry, platform): | ||
| features = entry.get("features") or [] | ||
| if not features: | ||
| sys.exit(f"platform '{platform}' declares no features") | ||
|
|
||
| surfaces = {f for f in features if f in ("room-apis", "core-modules")} | ||
| if len(surfaces) != 1: | ||
| sys.exit( | ||
| f"platform '{platform}' must select exactly one of room-apis / " | ||
| f"core-modules (got: {sorted(surfaces) or 'none'})" | ||
| ) | ||
| # Every entry states its whole feature set. Without this, an entry inherits | ||
| # whatever `default` happens to list, so a change there moves platforms | ||
| # silently -- and for a core-modules entry it would select both surfaces, | ||
| # which do not compile together. | ||
| if not entry.get("no-default-features"): | ||
| sys.exit( | ||
| f"platform '{platform}' does not set no-default-features; every " | ||
| f"entry must list the whole feature set it wants, so that a change " | ||
| f"to the crate's `default` features cannot move it onto another " | ||
| f"surface" | ||
| ) | ||
|
|
||
| flags = [] | ||
| if entry.get("no-default-features"): | ||
| flags.append("--no-default-features") | ||
| flags += ["--features", ",".join(features)] | ||
| return " ".join(flags) | ||
|
|
||
|
|
||
| def main(): | ||
| ap = argparse.ArgumentParser(description=__doc__) | ||
| ap.add_argument("platform", nargs="?", help="platform key to resolve") | ||
| ap.add_argument( | ||
| "--list", action="store_true", help="print every platform and its flags" | ||
| ) | ||
| args = ap.parse_args() | ||
|
|
||
| table = load_table() | ||
|
|
||
| if args.list: | ||
| width = max(len(k) for k in table) | ||
| for name in sorted(table): | ||
| print(f"{name:<{width}} {flags_for(table[name], name)}") | ||
| return | ||
|
|
||
| if not args.platform: | ||
| ap.error("a platform key is required (or --list)") | ||
|
|
||
| if args.platform not in table: | ||
| sys.exit( | ||
| f"unknown platform '{args.platform}'. Known: {', '.join(sorted(table))}" | ||
| ) | ||
| print(flags_for(table[args.platform], args.platform)) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.