Define a single shared Rust dependency for both Apple and Android apps with the new rust_mobile_library target kind in the Rust Starlark prelude. The target declares the source and crate metadata once, and each consumer materializes only the native library it needs: Apple consumers compile the staticlib variant and Android consumers compile the cdylib variant. As a result, Android-only graphs no longer force an Apple Rust target, and Apple-only graphs no longer force the Android linker. Bundled mobile examples were updated to declare one SharedRust target instead of separate Apple and Android Rust targets. Note: rust_mobile_library does not yet support Rust dependencies; projects needing them should keep using explicit platform-specific rust_library targets.
Hive
Shared Rust target for Apple and Android apps
Published
Jun 29, 2026 · 16:02 UTC
Repository
tuist/once