Files
chanora/Cargo.toml
T
EdisonJwa 477394d83e 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.
2026-05-18 14:48:16 +08:00

82 lines
3.2 KiB
TOML

# Chanora — top-level Cargo workspace.
#
# Layout authority: DEC-022 in
# docs/governance/product-decision-register.md, which adopts the
# README's sketch as canonical:
#
# apps/chanora_flutter/ — Flutter application (separate toolchain)
# core/chanora_core/ — top-level Rust API + orchestration
# crates/chanora_protocol/ — tsclientlib isolation
# crates/chanora_state/ — snapshot, deltas, reducers
# crates/chanora_audio/ — capture, DSP, Opus, jitter, mixer
# crates/chanora_storage/ — bookmarks, settings, identity refs
# crates/chanora_diagnostics/ — logs, redaction, export
# crates/chanora_bridge/ — Flutter/Rust typed DTOs + glue
#
# The Flutter app is not part of this Cargo workspace; it is owned by
# Gradle / Xcode / Flutter tooling under apps/chanora_flutter/.
#
# Non-promotion reminder (proof-of-concept-plan.md §4): nothing under
# poc/ is product code. The crates here are blank scaffolds at this
# stage; promotion of PoC code happens crate-by-crate with explicit
# audit-trail commits.
[workspace]
resolver = "2"
members = [
"core/chanora_core",
"crates/chanora_protocol",
"crates/chanora_state",
"crates/chanora_audio",
"crates/chanora_storage",
"crates/chanora_diagnostics",
"crates/chanora_bridge",
]
# Excludes: the PoC trees stay outside the product workspace so that
# `cargo check --workspace` at the root does not pull in PoC builds.
exclude = [
"poc/tsclientlib-connect-spike",
"poc/secure-storage-spike",
"poc/sqlite-storage-spike",
"poc/diagnostics-redaction-spike",
"poc/audio-capture-playback-spike",
"poc/audio-capture-playback-android-spike",
"poc/flutter_rust_bridge_hello",
"apps/chanora_flutter",
]
[workspace.package]
version = "0.2.0-beta.1"
edition = "2021"
rust-version = "1.95"
authors = ["The Chanora Project Contributors"]
license = "MIT OR Apache-2.0" # DEC-020
repository = "https://github.com/anomalyco/opencode"
publish = false # not on crates.io
readme = "README.md"
# Shared dependency pinnings. Members refer to these via
# `package.dependencies.<x>.workspace = true` so versions stay aligned.
[workspace.dependencies]
thiserror = "2"
tracing = "0.1"
serde = { version = "1", features = ["derive"] }
# DEC-032 exit step: override the `cmake` crate with the fork carrying
# cmake-rs PR #257 (https://github.com/rust-lang/cmake-rs/pull/257).
# The patch forwards `ANDROID_ABI` and `ANDROID_PLATFORM` environment
# variables (set per-invocation by cargo-ndk >= 4.x and reinforced by
# our SDD-118 item 5 cleanEnv map) to the child `cmake` invocation as
# `-D` variables, so audiopus_sys's libopus CMake build picks up the
# correct per-ABI target on multi-ABI Android builds. Without it the
# child cmake falls through to the NDK toolchain file's default and
# armeabi-v7a / x86_64 fail to compile.
#
# Pinned by exact commit SHA (the `android-build` branch tip on
# pr2502/cmake-rs as of 2026-05-18) so the patch is reproducible.
# Re-evaluate and remove once PR #257 merges and a fresh `cmake`
# release lands on crates.io (current upstream is 0.7.2).
[patch.crates-io]
cmake = { git = "https://github.com/pr2502/cmake-rs", rev = "bdad5edc569d82151922c5c6c4685b1563f12aa1" }