Skip to content

Fix macOS LiteRT-LM runtime packaging#9

Merged
leehack merged 1 commit into
mainfrom
fix-macos-litert-lm-runtime
Jun 10, 2026
Merged

Fix macOS LiteRT-LM runtime packaging#9
leehack merged 1 commit into
mainfrom
fix-macos-litert-lm-runtime

Conversation

@leehack

@leehack leehack commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Fix macOS LiteRT-LM release packaging so the published x64 runtime no longer leaves Gemma model constraint provider symbols unresolved.

The previous release flow source-built libLiteRtLm.dylib for macOS x64. Upstream's Bazel graph selects the macOS arm64 Gemma provider prebuilt for all macOS builds, so the x64 dylib was published with unresolved dynamic lookups for LiteRtLmGemmaModelConstraintProvider_* and no matching x64 provider dylib. Downstream macOS x64 consumers could fail at process startup with a missing _LiteRtLmGemmaModelConstraintProvider_Destroy symbol.

This PR adds a macOS packaging path that consumes Google's official CLiteRTLM_mac.xcframework, builds this repo's bridge-enabled libLiteRtLm.dylib wrapper, and re-exports libCLiteRTLM_mac.dylib. It also updates release validation to require the new macOS runtime layout and to fail if the provider symbols are left as unresolved dynamic lookups again.

It also separates the Google upstream source tag from the native release tag. That lets us build from upstream v0.13.1 while publishing corrected artifacts as a new immutable native release such as v0.13.1-native.1, instead of overwriting the existing v0.13.1 release that downstream llamadart 0.7.x versions checksum-pin.

Validation

  • python3 tools/package_macos_runtime.py --upstream-tag v0.13.1 --archive /tmp/litert-lm-native-check/CLiteRTLM_mac.xcframework.zip --clean
  • python3 tools/package_apple_xcframeworks.py --release-tag v0.13.1-native.1 --clean
  • python3 tools/validate_runtime_dependencies.py
  • python3 -m py_compile tools/package_apple_xcframeworks.py tools/package_release.py tools/validate_release_manifest.py tools/package_macos_runtime.py tools/validate_runtime_artifacts.py tools/validate_runtime_dependencies.py
  • git diff --check
  • Synthetic manifest validation with --upstream-tag v0.13.1 --release-tag v0.13.1-native.1
  • Negative control: old macOS x64 release dylib fails the new dependency validation with unresolved Gemma provider symbols.

@leehack leehack force-pushed the fix-macos-litert-lm-runtime branch from 1e5a2fe to 609460d Compare June 10, 2026 15:09
@leehack leehack force-pushed the fix-macos-litert-lm-runtime branch from 609460d to 3245fbf Compare June 10, 2026 15:20
@leehack leehack merged commit 041af28 into main Jun 10, 2026
2 checks passed
@leehack leehack deleted the fix-macos-litert-lm-runtime branch June 10, 2026 15:34
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.

1 participant