Fix the livekit_uniffi build hook for universal builds and allow code_assets 2.x - #1416
Merged
Merged
Conversation
code_assets 2.0.0 shipped after the constraint was written. Its only breaking change, equality on OS and Architecture, does not affect the hook, and capping below it makes the package unresolvable next to any dependency that already requires 2.x. Verified against code_assets 2.0.0 and hooks 2.2.0 in both local and download mode.
Dependencies are inputs. Registering the downloaded output made the hooks runner see a file modified during the build and rerun the hook, and the download, once on every fresh build. Local mode keeps its registration, since there the library really is an input that a fresh cargo make dart-package overwrites.
Contributor
Changeset ✓This PR includes a changeset covering all affected packages:
|
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
The hook wrote every target's library to the same path under the shared output directory. A universal macOS release build runs the hook once per architecture and then merges the results with lipo, so the second download overwrote the first and lipo was handed the same x86_64 file twice. Key the directory by target triple, which also matches how the hooks package documents the shared directory should be used.
1egoman
approved these changes
Sep 9, 2026
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
Three fixes to the
livekit_uniffiDart package templates, found while doing the manual first publish of 0.1.10 and wiring it into client-sdk-flutter. All ship with the next release.code_assets2.x. The pubspec cappedcode_assetsbelow 2.0.0, which shipped on Aug 18. Its only breaking change (equality onOS/Architecture) does not affect the hook, and a cap below the current major makes the package unresolvable next to any dependency that already requires 2.x. Now>=1.0.0 <3.0.0. The comment is updated:hooks 2.2.0dropped itsmetadependency, so the Fluttermeta-pin back-solve that motivated the wide ranges mostly no longer applies, but wide bounded ranges remain the right shape.lipo, so the second download overwrote the first and the build failed with "have the same architectures (x86_64) and can't be in the same fat output file" (Integrate initial uniffi rust core client-sdk-flutter#1160's macOS CI job). The directory is now keyed by target triple, which is also how thehookspackage documents the shared directory should be used.Breaking changes
None.
MSRV
No changes.
Testing
From this branch,
cargo make dart-packagein both profiles:code_assets 2.0.0+hooks 2.2.0, 5/5 FFI tests pass.dart testdownloads the real 0.1.10 library from the release, the "File modified during build" rerun is gone, 5/5 tests pass, anddart pub publish --dry-runreports 0 warnings.flutter build macos --release. Builds,lipo -infoon the bundledlivekit_uniffi.frameworkreportsx86_64 arm64, and the hook produced separateaarch64-apple-darwinandx86_64-apple-darwinoutput directories. Debug builds are single-architecture and cannot catch this, which is why it reached CI.code_assets 2.0.0also adds header validation of the bundled library against the target architecture, which the downloaded 0.1.10 dylib passed.Async
No async code changed.
🤖 Generated with Claude Code