fix(android,build): restore multi-ABI build via cmake-rs patch (DEC-032 exit)
Closes DEC-032. Restores the canonical Android ABI set
{arm64-v8a, armeabi-v7a, x86_64} per SDD-073 item 4 / SDD-118 item 3.
Root cause was the audiopus_sys + cmake-rs + NDK toolchain-file gap:
cargo-ndk 4.x sets ANDROID_ABI / ANDROID_PLATFORM as env vars per
invocation, but upstream cmake-rs 0.x does not forward them to the
child cmake invocation as -D variables, so armeabi-v7a and x86_64
configure steps fell through to the toolchain-file default and
failed to build.
Fix:
- Cargo.toml: add a workspace [patch.crates-io] stanza pinning the
cmake crate to fork pr2502/cmake-rs @ commit
bdad5edc569d82151922c5c6c4685b1563f12aa1 (branch android-build),
which carries cmake-rs PR #257
(https://github.com/rust-lang/cmake-rs/pull/257). The patch is a
9-line addition that forwards ANDROID_ABI and ANDROID_PLATFORM
from the env to the child cmake as -D variables.
- Cargo.lock: regenerated by 'cargo update -p cmake'; the lone
cmake entry now points at the fork rev.
- apps/chanora_flutter/android/app/build.gradle.kts: restore
abiFilters to {arm64-v8a, armeabi-v7a, x86_64}; remove the
TODO(x86_64/armv7 follow-up) comment.
- docs/governance/product-decision-register.md: mark DEC-032 as
Resolved (2026-05-18) with the resolution mechanism, update the
§3 / §7 rows, and append a 0.9.8.1 change-history entry.
Verification (host: Linux):
cargo update -p cmake -> pulled fork rev
cargo check --workspace --all-targets -> PASS
cargo test --workspace -> PASS (no regressions)
cargo ndk --platform 28 -t arm64-v8a build -p chanora_bridge -> PASS
cargo ndk --platform 28 -t armeabi-v7a build -p chanora_bridge -> PASS
cargo ndk --platform 28 -t x86_64 build -p chanora_bridge -> PASS
Upstream tracking: re-evaluate the [patch.crates-io] override once
cmake-rs PR #257 merges and a fresh cmake release lands on
crates.io; at that point switch to a plain dep bump and remove the
override.
This commit is contained in:
@@ -69,14 +69,15 @@ android {
|
||||
// Per-ABI delivery is handled by the AAB bundle splits below
|
||||
// (SDD-109 item 2) rather than a fat APK.
|
||||
ndk {
|
||||
// TODO(x86_64/armv7 follow-up): temporarily limited to arm64-v8a only
|
||||
// while the audiopus_sys + cmake-rs + NDK toolchain-file ANDROID_ABI
|
||||
// propagation gap is investigated for x86_64 / armeabi-v7a. The
|
||||
// smoke-test emulator is arm64-v8a; full-set Gradle build will be
|
||||
// restored once the cmake-rs `-DANDROID_ABI=<abi>` propagation fix
|
||||
// lands. See SDD-073 item 4 / SDD-118 item 3 for the canonical
|
||||
// multi-ABI intent.
|
||||
abiFilters += listOf("arm64-v8a")
|
||||
// DEC-032 RESOLVED (2026-05-18): canonical three-ABI set
|
||||
// restored after the audiopus_sys + cmake-rs + NDK toolchain-file
|
||||
// ANDROID_ABI propagation gap was closed by the workspace
|
||||
// [patch.crates-io] override pinning `cmake` to the fork
|
||||
// carrying cmake-rs PR #257 (forwards ANDROID_ABI /
|
||||
// ANDROID_PLATFORM as -D variables to the child cmake
|
||||
// invocation). See Cargo.toml [patch.crates-io] block and
|
||||
// docs/governance/product-decision-register.md DEC-032.
|
||||
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86_64")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user