Skip to content

ci(mobile): put NDK bin on PATH so openssl-src finds the legacy ranlib symlink#6338

Merged
houko merged 3 commits into
mainfrom
ci/android-ndk-ranlib-path
Jun 26, 2026
Merged

ci(mobile): put NDK bin on PATH so openssl-src finds the legacy ranlib symlink#6338
houko merged 3 commits into
mainfrom
ci/android-ndk-ranlib-path

Conversation

@houko

@houko houko commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Problem

The Android Tauri builds — mobile-smoke Android (debug, unsigned) and release Mobile / Android — have been failing on main since OpenSSL was vendored (#6279).
#6335 was meant to fix this but only got halfway: the latest main push still fails with aarch64-linux-android-ranlib: not found (exit 127), e.g. run 28226134802.

Root cause

#6335 symlinked the legacy <target>-ranlib / -ar / -nm / -strip names to their llvm-* equivalents inside the NDK bin directory, but never put that directory on $PATH.

The CI log shows why the symlink alone is not enough — openssl-src invokes Configure as:

env -u CROSS_COMPILE AR="<abs>/llvm-ar" CC="<abs>/aarch64-linux-android26-clang" RANLIB="aarch64-linux-android-ranlib" perl ./Configure ...

It passes AR as an absolute path (resolves fine) but RANLIB as a bare command name. The bare name is resolved through a $PATH lookup, and the NDK bin directory — where the aarch64-linux-android-ranlib symlink lives — was not on $PATH. So make install_dev exits 127.

That AR resolves from exactly the $NDK_BIN directory we symlink into is what confirms the symlink itself is valid (not dangling); the only missing piece is PATH visibility.

Fix

Append $NDK_BIN to $GITHUB_PATH in the existing "Symlink legacy NDK binutils" step, so the bare-name RANLIB resolves to the symlink.

  • .github/workflows/mobile-smoke.yml — aarch64 job
  • .github/workflows/release.yml — aarch64 + armv7 job

The symlinks themselves are unchanged; this only makes them findable.

Verification

  • The Android cross-compile is Linux-only (NDK r27 host toolchain) and cannot be reproduced locally, so the fix is grounded directly in the failing run's log: RANLIB="aarch64-linux-android-ranlib" (bare) vs AR="<abs>/llvm-ar" (absolute), with AR resolving from the same $NDK_BIN we symlink into.
  • Both workflow files pass yaml.safe_load.
  • The real verification is the Android jobs on this PR going green.

Note (separate, transient)

The Test / Security job on the same main push failed independently with a transient crates.io download error (OpenSSL SSL_read: SSL_ERROR_SYSCALL while fetching ed25519-dalek) — infrastructure, not code. That run's failed jobs were re-run; no change required here.

…b symlink

#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`.
@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 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix itself looks correct — the root cause analysis (bare RANLIB resolved via PATH, absolute AR isn't) matches the CI log and the echo "$NDK_BIN" >> "$GITHUB_PATH" one-liner is the right fix.

One prose-style note (CLAUDE.md "Prose wrapping" rule): the paragraph this PR modifies in both workflow files column-wraps mid-sentence.
The project rule is one sentence per line in any prose block being touched.
The new last sentence currently spans four lines:

      # "ranlib: not found" (exit 127). Symlink the legacy names to the llvm
      # equivalents AND put the NDK bin dir on PATH: openssl-src passes RANLIB
      # to Configure as a bare command name (unlike AR, which it passes as an
      # absolute path), so the symlink is only resolvable via a PATH lookup.

Sentence-based form would put "ranlib: not found" (exit 127). and the Symlink… sentence on separate lines (the earlier sentences in the unchanged portion of the block have the same issue, but those aren't touched by this PR so they're out of scope here).
This doesn't affect correctness — just flagging so the author is aware before the maintainer reviews style.


Generated by Claude Code

@houko
houko merged commit bebc950 into main Jun 26, 2026
31 checks passed
@houko
houko deleted the ci/android-ndk-ranlib-path branch June 26, 2026 12:36
@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