diff --git a/.forgejo/workflows/android-ci.yml b/.forgejo/workflows/android-ci.yml index 94aeaeb..d91a327 100644 --- a/.forgejo/workflows/android-ci.yml +++ b/.forgejo/workflows/android-ci.yml @@ -111,8 +111,13 @@ jobs: set -euo pipefail export DEBIAN_FRONTEND=noninteractive apt-get update + # `cmake` is for RandomX, the C++ half of the in-process chain daemon: + # without it `randomx-rs`'s build script panics with "failed to execute + # command: No such file or directory … is `cmake` not installed?" and the + # Gradle task dies on "cargo finished with non-zero exit value 101". apt-get install -y --no-install-recommends \ - openjdk-17-jdk-headless python3 unzip curl ca-certificates file build-essential pkg-config git + openjdk-17-jdk-headless python3 unzip curl ca-certificates file build-essential pkg-config git \ + cmake if [ ! -x /opt/android-sdk/cmdline-tools/latest/bin/sdkmanager ]; then mkdir -p /opt/android-sdk/cmdline-tools curl -fsSL "$ANDROID_CMDLINE_TOOLS_URL" -o /tmp/cmdline-tools.zip @@ -186,6 +191,12 @@ jobs: aapt dump badging "$apk" | sed -n '1,20p' || true echo "=== sizes ===" wc -c "$apk" "$aar" + # The cross-compile volume this build just grew. The cuprated graph is + # ~152 crates plus a C++ RandomX build, so the number is the disk cost + # of the feature on the runner, next to the wall clock above. + echo "=== cargo target volume (after this build) ===" + du -sh /cargo-target 2>/dev/null || true + du -sh /cargo-target/aarch64-linux-android/release 2>/dev/null || true } | tee dist/android-ci-verify.log INNER chmod +x .ci-android-verify.sh diff --git a/.forgejo/workflows/android-release.yml b/.forgejo/workflows/android-release.yml index fac345a..3218c00 100644 --- a/.forgejo/workflows/android-release.yml +++ b/.forgejo/workflows/android-release.yml @@ -225,8 +225,13 @@ jobs: set -euo pipefail export DEBIAN_FRONTEND=noninteractive apt-get update + # `cmake` is for RandomX, the C++ half of the in-process chain daemon + # (`cuprate-daemon`, built into the SDK): without it `randomx-rs`'s build + # script panics with "is `cmake` not installed?" and the Gradle task dies + # on "cargo finished with non-zero exit value 101". Same as android-ci.yml. apt-get install -y --no-install-recommends \ - openjdk-17-jdk-headless python3 unzip curl ca-certificates file build-essential pkg-config git + openjdk-17-jdk-headless python3 unzip curl ca-certificates file build-essential pkg-config git \ + cmake mkdir -p /root/.android cp /src/.ci-android/onionwire-release.jks /root/.android/onionwire-release.jks cp /src/.ci-android/onionwire-release.env /root/.android/onionwire-release.env diff --git a/android/CUPRATE_DAEMON.md b/android/CUPRATE_DAEMON.md index 6b426d0..a61619d 100644 --- a/android/CUPRATE_DAEMON.md +++ b/android/CUPRATE_DAEMON.md @@ -53,7 +53,7 @@ script emits `rustc-link-lib=static=stdc++` against the NDK's *stub* -Wl,--exclude-libs,libc++abi.a ``` -Three more things the build has to get right, each of which fails as something +Four more things the build has to get right, each of which fails as something else: 1. **`ANDROID_NDK` must be exported**, not only `ANDROID_NDK_HOME` / `NDK_HOME`. @@ -70,6 +70,14 @@ else: **host**-targeted, where `-lc++_static` breaks the link. Setting the per-target variable also *replaces* the `target..rustflags` in `~/.cargo/config.toml`, so the sysroot `-L` it carried is repeated in the list. +4. **The build image needs `cmake`.** RandomX is built by `randomx-rs`'s build + script through `cmake-rs`, and both Android workflows' `debian:bookworm` + containers install their own package list. Without `cmake` the build gets + ~11 minutes in, compiles 400-odd crates, and then dies with a `randomx-rs` + build-script panic — *failed to execute command: No such file or directory … + is `cmake` not installed?* — surfacing as Gradle's "cargo finished with + non-zero exit value 101", which reads like a Rust error and is not one. + `android-ci.yml` and `android-release.yml` both install it. ## What ends up in the APK