Skip to content

Commit 9dd64f2

Browse files
doublegateclaude
andcommitted
build(android): opt into ABIs with -PrustynesAbis; an armeabi-v7a build for D5
Copilot on #571: run-sheet row D5 (RetroAchievements on 32-bit Android, the platform whose struct layout the time_t fix in 5aaeb64 changed) could not be run with the documented APK. That APK carries only arm64-v8a and x86_64, so a 32-bit-only device cannot install it, and a 64-bit device runs the 64-bit library and never exercises a 32-bit time_t. The build comment called armeabi-v7a "opt-in" but gave no way to opt in short of editing builtAbis. `builtAbis` now reads an optional Gradle property: `-PrustynesAbis=a,b` replaces the default list. Unset or empty, it is `arm64-v8a, x86_64` as before, so no existing build changes. The release variant's `shipAbi` is separate and untouched. Built with it: `./gradlew :app:assembleFossDebug -PrustynesAbis=armeabi-v7a` gives an APK whose only native directory is lib/armeabi-v7a/ (librustynes_mobile.so: ELF 32-bit LSB, ARM, EABI5, for Android), SHA-256 4e75ff99...cfd3b21, 39,375,703 bytes. The run sheet records it and makes D5's step install that APK and confirm `primaryCpuAbi` is armeabi-v7a before recording a result. It also notes that many recent 64-bit phones no longer run 32-bit apps, in which case D5 is NOT RUN. Not verified: that APK has not run anywhere. The x86_64 emulator cannot run ARM code, so D5 still needs a device. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014qfTKi2M3swo7qnwvYCkDj
1 parent 4499901 commit 9dd64f2

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

‎android/app/build.gradle.kts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ val uniffiGenDir: File = layout.buildDirectory.dir("generated/uniffi").get().asF
2323
// devices, x86_64 for the emulator / CI smoke test. The *release* variant then
2424
// packages arm64 only (smallest AAB — see the `release` buildType's abiFilters);
2525
// the *debug* variant keeps x86_64 so it runs on the emulator. armeabi-v7a is
26-
// opt-in (see the maintainer defaults).
27-
val builtAbis = listOf("arm64-v8a", "x86_64")
26+
// opt-in (see the maintainer defaults): pass `-PrustynesAbis=armeabi-v7a` (a
27+
// comma-separated list replaces the default) to build and package it, e.g. for
28+
// a 32-bit device run (docs/mobile-v2.9.3-run-sheet.md, row D5). The release
29+
// variant's `shipAbi` is unaffected.
30+
val builtAbis: List<String> =
31+
(findProperty("rustynesAbis") as String?)
32+
?.split(',')?.map { it.trim() }?.filter { it.isNotEmpty() }
33+
?.takeIf { it.isNotEmpty() }
34+
?: listOf("arm64-v8a", "x86_64")
2835
val shipAbi = "arm64-v8a"
2936

3037
android {

‎docs/mobile-v2.9.3-run-sheet.md‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ before installing, so the result belongs to a known build.
4343
| SHA-256 | `abb1fb4bae39c5e7a1cf60ff3ed2d15b2e4d86f5a1d5fb5e1bff12a3e5ffdfbb` |
4444
| Size | 67,310,419 bytes |
4545

46+
**For row D5 only**, a 32-bit build: `RustyNES-v2.9.3-pre-foss-debug-armeabi-v7a.apk`,
47+
built with `cd android && ./gradlew :app:assembleFossDebug
48+
-PrustynesAbis=armeabi-v7a`. It carries only `lib/armeabi-v7a/` (a 32-bit ARM
49+
ELF), so it installs on a 32-bit device, and on a 64-bit device that can still
50+
run 32-bit apps it runs the 32-bit libraries. That is what D5 needs, since the
51+
main APK would run the 64-bit ones.
52+
53+
| | |
54+
| --- | --- |
55+
| SHA-256 | `4e75ff99d81840afe8c7d2887475c906e7330b1708391a2a704144ac2cfd3b21` |
56+
| Size | 39,375,703 bytes |
57+
58+
Before recording D5, confirm the device ran the 32-bit library:
59+
`adb shell dumpsys package com.doublegate.rustynes.debug | grep primaryCpuAbi`
60+
should say `armeabi-v7a`. Many recent 64-bit phones can no longer run 32-bit
61+
apps at all; on those, record D5 as NOT RUN.
62+
4663
A later commit to the Android app, the Rust core or the bridge makes this
4764
build stale. Rebuild it and record the new checksum here before the device run.
4865

@@ -75,7 +92,7 @@ the rest.
7592
| D2 | wgpu 30, iOS | Open a game; rotate; background and foreground; change the video filter | The picture appears and returns; colours look as before |
7693
| D3 | rcheevos 12.5.0, Android | Log in to RetroAchievements in Settings; open a game that has achievements | Login shows the user name and score; the game's achievement list loads |
7794
| D4 | rcheevos 12.5.0, iOS | As D3 | As D3 |
78-
| D5 | rcheevos, 32-bit Android (only if an armeabi-v7a device is available; that ABI is opt-in) | As D3 | As D3; this is the platform whose struct layout the `time_t` fix changed |
95+
| D5 | rcheevos, 32-bit Android | Install the **armeabi-v7a** APK (see The build) and confirm `primaryCpuAbi` is `armeabi-v7a`; then as D3 | As D3; this is the platform whose struct layout the `time_t` fix changed |
7996

8097
## Android
8198

@@ -118,7 +135,7 @@ check (`BuildConfig.DEBUG`), which release builds never run.
118135
| A15 | AUD-11 | NOT RUN (needs an HD pack) | |
119136
| D1 | #570 | PASS: covered by A7 (wgpu 30, Vulkan device created on the emulator's goldfish driver) | |
120137
| D3 | #570 | NOT RUN (needs RetroAchievements credentials) | |
121-
| D5 | #570 | NOT RUN (x86_64 emulator; needs an armeabi-v7a device) | |
138+
| D5 | #570 | NOT RUN (x86_64 emulator, which cannot run ARM code; the armeabi-v7a APK is built and checksummed for the device) | |
122139

123140
## iOS
124141

0 commit comments

Comments
 (0)