Skip to content

ci(mobile): symlink legacy NDK binutils so vendored OpenSSL cross-compiles for Android#6335

Merged
houko merged 1 commit into
mainfrom
fix-android-openssl-ranlib
Jun 26, 2026
Merged

ci(mobile): symlink legacy NDK binutils so vendored OpenSSL cross-compiles for Android#6335
houko merged 1 commit into
mainfrom
fix-android-openssl-ranlib

Conversation

@houko

@houko houko commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Problem

The Android Tauri legs have been red on main for days, independent of any feature work:

  • Mobile Build Smoke / Android (debug, unsigned) (push-to-main canary)
  • Release / Mobile / Android (aab + apk) (continue-on-error: true, so it does not block a release but ships no Android artifact)

Both fail at the same spot while building vendored OpenSSL for aarch64-linux-android:

/bin/sh: 1: aarch64-linux-android-ranlib: not found
make: *** [Makefile:2802: install_dev] Error 127
Error installing OpenSSL: 'make' reported failure with exit status: 2
cargo build --package librefang-desktop --target aarch64-linux-android ... exited with code 101

This is pre-existing — the v2026.6.24-beta.23 release run shows the same Mobile / Android: failure, and mobile-smoke has failed on every relevant main push since 2026-06-23.

Root cause

#6279 vendored OpenSSL unconditionally so cross-compiled targets link. openssl-src then builds OpenSSL from source for Android and runs make install_dev, which archives via ${CROSS_COMPILE}ranlib = aarch64-linux-android-ranlib.

NDK r23+ removed the legacy GNU-style <target>-ar / -ranlib wrappers in favour of llvm-ar / llvm-ranlib. This repo pins NDK r27 (27.0.12077973), so aarch64-linux-android-ranlib does not exist and the archive-indexing step exits 127.

The same-target CLI / aarch64-linux-android job passes — only the Tauri desktop/mobile build pulls the vendored openssl-sys, which is why this surfaced solely on the mobile legs.

Fix

After NDK_HOME is exported, symlink the legacy-named ar / ranlib / nm / strip to their llvm-* equivalents in the NDK toolchain bin, in both Android jobs:

  • .github/workflows/mobile-smoke.ymlaarch64-linux-android-*
  • .github/workflows/release.ymlaarch64-linux-android-* and arm-linux-androideabi-* (this job also builds armv7-linux-androideabi)

Minimal and additive: it only provides names the modern NDK dropped; nothing else in the toolchain changes.

Verification

  • Both workflow files parse as valid YAML.
  • Verified end-to-end by dispatching Mobile Build Smoke against this branch — see the run linked in a comment below. (mobile-smoke.yml does not run on PRs by design — ~25 min cold NDK build — but it supports workflow_dispatch, which reads the workflow + checks out the code from this branch, so the dispatched run exercises exactly this fix.)

Cannot be reproduced on the macOS dev host (no Linux Android NDK cross-compile); the CI Android job is the authoritative check.

…piles for Android

The Android Tauri builds — mobile-smoke `Android (debug, unsigned)` and release `Mobile / Android (aab + apk)` — have failed on main since OpenSSL was vendored unconditionally (#6279).
openssl-src builds OpenSSL from source for `aarch64-linux-android` and runs `make install_dev`, which shells out to `aarch64-linux-android-ranlib` via its `CROSS_COMPILE` prefix.
NDK r23+ (this repo pins r27) removed the legacy `<target>-ranlib` / `-ar` wrappers in favour of `llvm-ranlib` / `llvm-ar`, so the build dies with `ranlib: not found` (exit 127) at the archive-indexing step.

Symlink the legacy-named `ar`/`ranlib`/`nm`/`strip` to their `llvm-*` equivalents right after `NDK_HOME` is exported, in both the smoke and release Android jobs.
`release.yml` also builds `armv7-linux-androideabi`, so both ABI prefixes are linked there.

The same-target `CLI / aarch64-linux-android` job already passes — only the Tauri desktop/mobile build pulls the vendored `openssl-sys`, which is why this surfaced only on the mobile legs.
@houko

houko commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Verification run (Mobile Build Smoke dispatched against this branch): https://github.com/librefang/librefang/actions/runs/28225522115

The Android (debug, unsigned) job here is the authoritative check — it cross-compiles vendored OpenSSL for aarch64-linux-android, which is the exact step that was failing with aarch64-linux-android-ranlib: not found on main. Green = the symlink resolves the missing binutils.

@github-actions github-actions Bot added size/S 10-49 lines changed no-rust-required This task does not require Rust knowledge area/ci CI/CD and build tooling labels Jun 26, 2026
@houko
houko enabled auto-merge (squash) June 26, 2026 08:07
@houko
houko merged commit 5484593 into main Jun 26, 2026
33 of 34 checks passed
@houko
houko deleted the fix-android-openssl-ranlib branch June 26, 2026 08:17
houko added a commit that referenced this pull request Jun 26, 2026
…b symlink (#6338)

#6335 symlinked the legacy `<target>-ranlib` / `-ar` / `-nm` / `-strip` names to their llvm equivalents inside the NDK bin directory, but that directory is not on `$PATH`, so the Android Tauri builds still failed with `aarch64-linux-android-ranlib: not found` (exit 127).

The CI log shows why the symlink alone was not enough: openssl-src invokes Configure as `env -u CROSS_COMPILE AR="<abs>/llvm-ar" ... RANLIB="aarch64-linux-android-ranlib"` — it passes AR as an absolute path but RANLIB as a bare command name, so RANLIB is resolved through a `$PATH` lookup that never included the NDK bin directory.

Append `$NDK_BIN` to `$GITHUB_PATH` in the symlink step (mobile-smoke.yml aarch64 job, release.yml aarch64 + armv7 job) so the bare-name RANLIB resolves to the symlink. The symlinks themselves are unchanged.

Verification: cannot reproduce the Android cross-compile locally (Linux-only, NDK r27 host toolchain); the fix is grounded in the run-28226134802 log line `RANLIB="aarch64-linux-android-ranlib"` (bare name) versus `AR="<abs>/llvm-ar"` (absolute), and `AR` resolving from exactly the `$NDK_BIN` dir we symlink into. Both workflow files pass `yaml.safe_load`.

Co-authored-by: Evan <[email protected]>
@houko houko mentioned this pull request Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI/CD and build tooling no-rust-required This task does not require Rust knowledge size/S 10-49 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant