Skip to content

Android (S0): make rune and rune-kit type-check for Android targets #2647

Done

Description

@pascalandr

Follow-up to #2484 (slice S0 of the native Android host series on https://github.com/NeuralNomadsAI/rune).

Gap on dev (3e46617e5)

  • crates/rune/Cargo.toml:149: winit is built without an Android activity feature, so android-activity fails to compile (file not found for module activity_impl).
  • crates/rune/src/tooling/perf_warn/runq.rs:33: libc::getloadavg is compiled under cfg(unix); Android's bionic libc does not provide it.

Slice (4 files, +52 −2)

  • Enable android-native-activity on winit for Android targets only.
  • Return false from the overload probe (runq.rs) on Android.
  • Add .github/workflows/android.yml cross-checking aarch64-linux-android and x86_64-linux-android with embedded-fonts,accessibility,tooling,segmenter-dictionaries,svg,avif for rune and markdown,mermaid for rune-kit (on pushes to android/** and workflow_dispatch), plus a changelog fragment.

Checked

  • Fork CI workflow green for both aarch64-linux-android and x86_64-linux-android.
  • cargo check -p rune (Windows host) and cargo check-wasm pass.
  • Also verified merged onto current dev (3e46617e5) in android/next (03f8c0ff1: clippy on both Android targets, wasm, 488/0 doctests). No device involved.

Reference branch

Questions

  1. Is a CI job that only runs on android/** pushes and workflow_dispatch acceptable, given macOS tests moved off per-push?
  2. blake3's build script needs the NDK's clang and rav1d needs nasm on x86_64: fine as CI setup, or would you rather gate them?

Activity

  1. opencodejr commented on Nov 27, 2026

    @opencodejr
    Contributor

    both compile gaps on dev are real: crates/rune/Cargo.toml enables winit without an android activity feature (vendor/winit/Cargo.toml pulls android-activity 0.6 on target_os = "android", requiring android-native-activity or android-game-activity), and crates/rune/src/tooling/perf_warn/runq.rs calls libc::getloadavg under cfg(unix), which bionic does not provide. (checked by reading the code on dev; no android cross-check was run here.)

    the runq.rs gate is straightforward, while the workflow and build-toolchain choices need a maintainer call:

    1. ci triggers (.github/workflows/android.yml): anomalyco/rune lands directly on dev rather than android/** branches. .github/workflows/macos-tests.yml moved to a 6-hour schedule + workflow_dispatch because mac runners are scarce, whereas .github/workflows/check.yml runs on ubuntu-latest per push/pr. an ubuntu-hosted android cross-check fits either schedule + workflow_dispatch (or workflow_dispatch only until the host slices land) or a per-push/pr check once stable.
    2. blake3, rav1d, and winit: rav1d is already behind the opt-in avif feature (crates/rune-image/Cargo.toml) and already documents nasm on x86 builds, so ci can either install nasm or omit avif from the android check. blake3 (Cargo.toml) is unconditional and needs ndk clang for neon/x86 simd unless blake3/pure is enabled on android (which drops simd hashing for image keys and shaders). enabling winit/android-native-activity also ties into Android (S1): native host (RuneView, lifecycle, insets, back) #2648's question on whether android keeps winit linked or cfgs it out.

    questions for maintainers:

    • should an android cross-check workflow run on workflow_dispatch (+ schedule, like macos-tests.yml), on dev pushes/prs like check.yml, or wait until the host slices land?
    • should android builds require ndk clang (keeping blake3 simd) and nasm (when checking avif) in ci, or switch android to blake3/pure / omit avif — and is enabling winit/android-native-activity the intended s0 step alongside Android (S1): native host (RuneView, lifecycle, insets, back) #2648?
  2. pascalandr commented on Nov 27, 2026

    @pascalandr
    Author

    What the fork does, for the two calls:

    1. CI: android.yml runs on ubuntu-latest, about 2 minutes per target (cargo check of rune with the app features and of rune-kit), plus 4 minutes for the APK. It is cheap enough for dev pushes and PRs like check.yml; a per-push check is what catches the next getloadavg.
    2. Toolchain: the fork keeps blake3's SIMD and avif. The runner's preinstalled NDK (ANDROID_NDK_LATEST_HOME) supplies clang, set through CC_<target>; nasm comes from apt. Nothing else is installed. winit/android-native-activity is the S0 step: it only makes winit build, the host in Android (S1): native host (RuneView, lifecycle, insets, back) #2648 never runs its activity glue.
  3. Hona commented on Nov 27, 2026

    @Hona
    Member

    Merged in PR #2662 (e662f2428).

    Design decisions

    • winit Android feature: Enabled winit/android-native-activity under [target.'cfg(target_os = "android")'.dependencies] in crates/rune/Cargo.toml so android-activity compiles for S0 without pulling desktop Linux, X11, Wayland, arboard, or D-Bus crates onto Android.
    • Load-average probe: Gated libc::getloadavg in crates/rune/src/tooling/perf_warn/runq.rs behind #[cfg(all(unix, not(target_os = "android")))] and returned false on Android where bionic lacks getloadavg.
    • CI triggers & toolchain: Added .github/workflows/android.yml running on pushes to dev, pull requests, and workflow_dispatch on ubuntu-latest (matching check.yml). It keeps blake3 SIMD using the runner's preinstalled ANDROID_NDK_LATEST_HOME clang + llvm-ar for aarch64-linux-android and x86_64-linux-android, and checks rune with embedded-fonts,accessibility,tooling,segmenter-dictionaries,svg,avif plus rune-kit with markdown,mermaid. nasm is not needed because rav1d on dev uses pure Rust (default-features = false, no asm).

    Verification

    • Verified locally (Windows host):
      • cargo tree -p rune -p rune-kit --target aarch64-linux-android -e normal confirmed zero desktop-only crates (x11, wayland, arboard, zbus, accesskit_unix, rfd, spellbook).
      • cargo check -p rune -p rune-kit --target x86_64-linux-android passed with default, --no-default-features, and full Android feature sets.
      • cargo check -p rune -p rune-kit --target aarch64-linux-android --features blake3/no_neon,... passed.
      • cargo check -p rune -p rune-kit --features rune-kit/markdown,rune-kit/mermaid, cargo check-wasm, and cargo test -p rune --lib tooling::perf_warn::runq (6/6) passed.
    • Not verified locally: Full blake3 NEON C compilation with Android NDK clang on aarch64-linux-android, native Linux host build, or runtime execution on Android hardware/emulator (covered by GitHub Actions android.yml and check.yml on ubuntu-latest, where NDK clang discovery passed and the dev run is in progress).

    Please reopen if anything is still off.

  4. added 2 commits that reference this issue on Nov 27, 2026
    e662f24
    fc6a412
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions