Leveraging Rust to build cross-platform mobile libraries
summary
Mozilla rebuilds its telemetry SDK as a Rust core called glean core, compiles it for ten targets (including four Android ABIs) and integrates it with six languages via C FFI, cbindgen and tooling like ffi-support and the rust-android-gradle plugin. The team handles strings, enums, handles and cross‑thread safety, statically links C deps, runs CI to produce multi‑platform artifacts, and ships it to Android and iOS now with desktop integration underway — the system is live in Firefox Android and proves the approach works.
AI-written summary · about
chapters (25)
- 0:00Intro
- 2:01Firefox Telemetry
- 2:34Metric Time spent running the JS GC
- 4:08Lean Data Practices
- 6:29Firefox for Android
- 8:51Telemetry API in Firefox Desktop
- 14:06New Telemetry requirements
- 15:39Glean SDK stack
- 17:00Glean Core A Rust crate
- 18:07Metrics implemented as Rust types
- 18:38Glean FFI the connection
- 20:54Getting called from C
- 25:14ffi-support: Ffistr A safe wrapper around a null-terminated string.
- 29:10Glean targets
- 32:05Hello World with JNI Java
- 34:16Hello World with JNA
- 35:07Building a Cargo project using Gradle apply plugin: 'org.mozilla.rust-android-gradle rust-android cargo module
- 36:18Other Glean implementations
- 39:53Challenges of developing cross- platform Rust
- 40:35Data types: Numbers
- 42:49Data types: Strings
- 46:41Data types: Enums with data
- 51:55Optimizer: R8
- 53:46Extra libs
- 57:52Future: Component Interface Definition
related talks
30mShipping production ready Rust for Android
04m"Scaling Safety: Rust at Google”
37mRust for Linux
28mUsing Rust in your next Flutter SDK
39mSeamless Multiplatform – Kotlin-Rust-Multiplatform?!
37mUsing Rust in Your Next KMP App
48mStrengthening the Base: Laying the Groundwork for a more robust Rust SDK
24mJourney to Fullstack Mobile Game Development in Rust
