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:
EdisonJwa
2026-05-18 14:48:16 +08:00
parent 167aef5760
commit 477394d83e
4 changed files with 58 additions and 14 deletions
+30 -3
View File
@@ -231,12 +231,38 @@ release but is not an open decision:
|---|---|
| Decision ID | DEC-032 |
| Title | Temporary reduction of Android `abiFilters` to `arm64-v8a` only during P0 smoke-test cycle. |
| Status | **Active (temporary deviation)** |
| Status | **Resolved (canonical three-ABI set restored)** |
| Owner | Build/Toolchain |
| Restore-by | P0 release gate (must be restored before any P0 release upload). |
| Date recorded | 2026-05-18 |
| Date resolved | 2026-05-18 |
| Supersedes | None (temporary deviation from SDD-073 item 4 and SDD-118 item 3; does NOT supersede them). |
**Resolution (2026-05-18).** All four exit criteria below are met.
The propagation gap (criterion 1) is closed by a workspace
`[patch.crates-io]` stanza pinning the `cmake` crate to a fork
carrying cmake-rs PR #257
(<https://github.com/rust-lang/cmake-rs/pull/257>), which forwards the
`ANDROID_ABI` and `ANDROID_PLATFORM` environment variables (set per-
invocation by `cargo-ndk` 4.x and reinforced by the SDD-118 item 5
cleanEnv map) to the child `cmake` invocation as `-D` variables. The
fork is pinned by exact commit SHA
(`bdad5edc569d82151922c5c6c4685b1563f12aa1` on `pr2502/cmake-rs`,
branch `android-build`) for reproducibility — see the
`[patch.crates-io]` block in the workspace root `Cargo.toml`. Per-ABI
`cargo ndk --platform 28 -t <abi> build -p chanora_bridge` now passes
cleanly for all three ABIs (criterion 2). `abiFilters` in
`apps/chanora_flutter/android/app/build.gradle.kts` is restored to
`{arm64-v8a, armeabi-v7a, x86_64}` and the `TODO(x86_64/armv7
follow-up)` comment removed (criterion 3). The SDD-118 item 10
release-inspection assertion exercises every staged `.so` (including
`libc++_shared.so` per SDD-118 item 6 extended) for all three ABIs
again — no code change required, that assertion is driven by the
restored `abiFilters` set (criterion 4). Upstream tracking: re-
evaluate the `[patch.crates-io]` override once PR #257 merges and a
fresh `cmake` crates.io release lands; at that point the patch
should be removed in favour of a plain dep bump.
**Context.** SDD-073 item 4 and SDD-118 item 3 mandate the canonical
three-ABI set `{arm64-v8a, armeabi-v7a, x86_64}` for the Android AAB.
`apps/chanora_flutter/android/app/build.gradle.kts:72-79` currently has
@@ -314,7 +340,7 @@ reduced set while the cmake-rs propagation fix is in flight.
| Decision ID | Decision | Recommended decision | Status | Owner | Why it matters |
|---|---|---|---|---|---|
| DEC-032 | Android `abiFilters` set during P0 smoke-test cycle | Temporarily reduced to `arm64-v8a` only; restore to canonical three-ABI set `{arm64-v8a, armeabi-v7a, x86_64}` (per SDD-073 item 4 / SDD-118 item 3) before any P0 release upload | **Active (temporary deviation)** | Build/Toolchain | Affects who can install the AAB (armv7 + x86_64 currently blocked); P0 release gate cannot pass until restored; documents the SDD-073 / SDD-118 deviation site so it is not silently shipped. |
| DEC-032 | Android `abiFilters` set during P0 smoke-test cycle | Canonical three-ABI set `{arm64-v8a, armeabi-v7a, x86_64}` (per SDD-073 item 4 / SDD-118 item 3) restored 2026-05-18 after the `audiopus_sys` + `cmake-rs` + NDK toolchain-file `ANDROID_ABI` propagation gap was closed via a workspace `[patch.crates-io]` override pinning `cmake` to a fork carrying cmake-rs PR #257 | **Resolved** | Build/Toolchain | Multi-ABI install support restored; P0 release-gate ABI blocker cleared. Re-evaluate the `[patch.crates-io]` override once cmake-rs PR #257 merges and a fresh release lands. |
**§5 row (impact matrix).**
@@ -326,10 +352,11 @@ reduced set while the cmake-rs propagation fix is in flight.
| Decision ID | Owner | Decision | Status | Date | Notes |
|---|---|---|---|---|---|
| DEC-032 | Build/Toolchain | Temporary reduction of Android `abiFilters` to `arm64-v8a` only during P0 smoke-test cycle | Active (temporary deviation) | 2026-05-18 | Restore to canonical three-ABI set before any P0 release. Root cause: `audiopus_sys` + `cmake-rs` + NDK toolchain-file `ANDROID_ABI` propagation gap. Exit criteria (4 items) listed in DEC-032 detail entry. SDD-073 item 4 / SDD-118 item 3 unchanged. |
| DEC-032 | Build/Toolchain | Temporary reduction of Android `abiFilters` to `arm64-v8a` only during P0 smoke-test cycle | Resolved (2026-05-18) | 2026-05-18 | Canonical three-ABI set restored 2026-05-18. Root cause (`audiopus_sys` + `cmake-rs` + NDK toolchain-file `ANDROID_ABI` propagation gap) closed by a workspace `[patch.crates-io]` override pinning the `cmake` crate to fork `pr2502/cmake-rs` @ `bdad5edc569d82151922c5c6c4685b1563f12aa1` carrying cmake-rs PR #257 (forwards `ANDROID_ABI` / `ANDROID_PLATFORM` env vars as `-D` variables to the child cmake). All four exit criteria met. Follow-up: drop the `[patch.crates-io]` override once PR #257 merges and a fresh `cmake` release lands. SDD-073 item 4 / SDD-118 item 3 unchanged. |
### Change history
| Version | Date | Description |
|---|---|---|
| 0.9.8 | 2026-05-18 | Added DEC-032: temporary reduction of Android `abiFilters` to `arm64-v8a` only during the P0 smoke-test cycle. Status: Active (temporary deviation) from SDD-073 item 4 / SDD-118 item 3, which both remain unchanged. Restore-by gate: any P0 release upload must restore the canonical three-ABI set `{arm64-v8a, armeabi-v7a, x86_64}` and satisfy the SDD-118 item 10 release-inspection assertion (including the `libc++_shared.so` co-staging per SDD-118 item 6 extended). Root cause: `audiopus_sys` + `cmake-rs` + NDK toolchain-file `ANDROID_ABI` propagation gap. Owner: Build/Toolchain. Cross-references: SDD-073 item 4, SDD-118 item 3 (+ item 6 extended, item 10), `apps/chanora_flutter/android/app/build.gradle.kts:72-79` (in-source TODO), audit task ses_1c7645e36ffeY007MaYPep4wqs, traceability matrix v0.9.9 addendum §D. No prior decision row mutates. |
| 0.9.8.1 | 2026-05-18 | DEC-032 **Resolved**: canonical three-ABI set `{arm64-v8a, armeabi-v7a, x86_64}` restored in `apps/chanora_flutter/android/app/build.gradle.kts`. Root cause closed by a workspace `[patch.crates-io]` stanza in the repo-root `Cargo.toml` pinning the `cmake` crate to fork `pr2502/cmake-rs` @ commit `bdad5edc569d82151922c5c6c4685b1563f12aa1` (branch `android-build`), which carries cmake-rs PR #257 forwarding the `ANDROID_ABI` and `ANDROID_PLATFORM` environment variables (set per invocation by `cargo-ndk` 4.x and reinforced by the SDD-118 item 5 cleanEnv map) to the child `cmake` invocation as `-D` variables. Verification (host: Linux): `cargo ndk --platform 28 -t arm64-v8a build -p chanora_bridge`, `... -t armeabi-v7a ...`, and `... -t x86_64 ...` all pass cleanly. `cargo check --workspace --all-targets` passes on the host target. SDD-073 item 4 / SDD-118 item 3 unchanged (canonical intent was always the three-ABI set). Follow-up: re-evaluate the `[patch.crates-io]` override once cmake-rs PR #257 merges and a fresh `cmake` release lands; at that point switch to a plain dep bump and remove the override. No prior decision row mutates. |