Merge pull request 'android-ci: echo the artifact digests and deflated native-lib sizes (evidence follow-up to #113)' (#114) from onionwire/t_f05be394-evidence-digest into main
All checks were successful
android-ci / android (push) Successful in 11m8s

Reviewed-on: #114
This commit is contained in:
sirius 2026-09-18 22:53:43 +00:00
commit 0af97e144a
3 changed files with 59 additions and 24 deletions

View file

@ -174,6 +174,12 @@ jobs:
echo "=== unzip lib ==="
unzip -l "$apk" | grep -E 'lib/.+\.so' || true
unzip -l "$apk" | grep "lib/$abi/libonionwire_sdk.so"
# `unzip -l` shows the uncompressed size only; the *deflated* entry is
# what the download actually costs, and it is not visible anywhere else
# (v0.7.0's SDK lib was 33,481,336 B raw / 12,210,154 B deflated, which
# is the ratio a reader wants when this one grows).
echo "=== native lib entries (length / method / deflated) ==="
unzip -v "$apk" | grep -E 'lib/.+\.so$'
echo "=== in-process chain daemon (cuprate-daemon) is IN this APK ==="
# The build log's "features=cuprate-daemon" line says the feature was
# *requested*; this says it is *in the artifact*. `target_max_memory` is
@ -197,6 +203,11 @@ jobs:
echo "=== classes.dex + Compose entrypoints ==="
unzip -l "$apk" | grep -E 'classes[0-9]*\.dex' | head -n3
echo "=== sha256 ==="
# `sha256sum -c` proves each artifact matches the digest the build
# recorded, but prints neither number. The digest *is* the artifact's
# identity, and an APK is not byte-reproducible across machines, so it
# cannot be derived from the tree afterwards — echo both.
cat "dist/onionwire-$version-android-$abi.apk.sha256" "dist/onionwire-sdk-$version.aar.sha256"
( cd dist && sha256sum -c "onionwire-$version-android-$abi.apk.sha256" "onionwire-sdk-$version.aar.sha256" )
echo "=== apksigner (expect debug cert: this is a verification build) ==="
apksigner verify --print-certs "$apk" | sed -n '1,6p'
@ -219,6 +230,13 @@ jobs:
docker volume create "$GRADLE_VOLUME" >/dev/null
docker rm -f "$BUILD_CONTAINER" >/dev/null 2>&1 || true
docker pull "$ANDROID_IMAGE"
# 2 GB of Gradle heap, not 1: the only budget in this build that is close
# is the single-use daemon's heap, which now has to package a 55 MB SDK
# lib (plus RandomX's 1.1 MB) through AGP's in-daemon packaging. Run 414
# died in `:app:packageRelease` with the cause hidden inside
# `PackageAndroidArtifact$IncrementalSplitterRunnable` — no "Caused by"
# line, nothing in the log — so give it room instead of guessing again.
# The runner has 15 GB and the job's peak RSS is ~3 GB.
docker create --name "$BUILD_CONTAINER" -i \
-e CARGO_TERM_COLOR=never \
-e CARGO_BUILD_JOBS="$CARGO_BUILD_JOBS" \
@ -232,7 +250,7 @@ jobs:
-e ONIONWIRE_REQUIRE_RELEASE_KEY=false \
-e RUST_TOOLCHAIN="$RUST_TOOLCHAIN" \
-e ANDROID_CMDLINE_TOOLS_URL="$ANDROID_CMDLINE_TOOLS_URL" \
-e GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx1024m -XX:MaxMetaspaceSize=384m -Dfile.encoding=UTF-8" \
-e GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
-v "$SDK_VOLUME":/opt/android-sdk \
-v "$CARGO_VOLUME":/cargo \
-v "$TARGET_VOLUME":/cargo-target \

View file

@ -299,6 +299,13 @@ jobs:
docker volume create "$GRADLE_VOLUME" >/dev/null
docker rm -f "$BUILD_CONTAINER" >/dev/null 2>&1 || true
docker pull "$ANDROID_IMAGE"
# 2 GB of Gradle heap, not 1: the only budget in this build that is close
# is the single-use daemon's heap, which now has to package a 55 MB SDK
# lib (plus RandomX's 1.1 MB) through AGP's in-daemon packaging. Run 414
# died in `:app:packageRelease` with the cause hidden inside
# `PackageAndroidArtifact$IncrementalSplitterRunnable` — no "Caused by"
# line, nothing in the log — so give it room instead of guessing again.
# The runner has 15 GB and the job's peak RSS is ~3 GB.
docker create --name "$BUILD_CONTAINER" -i \
-e CARGO_TERM_COLOR=never \
-e CARGO_BUILD_JOBS="$CARGO_BUILD_JOBS" \
@ -314,7 +321,7 @@ jobs:
-e ONIONWIRE_VERSION="$VERSION" \
-e RUST_TOOLCHAIN="$RUST_TOOLCHAIN" \
-e ANDROID_CMDLINE_TOOLS_URL="$ANDROID_CMDLINE_TOOLS_URL" \
-e GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx1024m -XX:MaxMetaspaceSize=384m -Dfile.encoding=UTF-8" \
-e GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
-v "$SDK_VOLUME":/opt/android-sdk \
-v "$CARGO_VOLUME":/cargo \
-v "$TARGET_VOLUME":/cargo-target \

View file

@ -149,31 +149,41 @@ above is the other half of the proof — request and artifact, separately checka
## What it costs in CI
The Android job runs on the `docker-amd64` runner with `CARGO_BUILD_JOBS=1` and a
warm named volume at `/cargo-target` (it is **not** the Raspberry Pi runner), so
the numbers below are one runner, one volume, built twice: once with the feature
off (the current `main` build, run 402) and once with it on (run 406, this branch).
The Android job runs on the `docker-amd64` runner (it is **not** the Raspberry Pi
runner) with `CARGO_BUILD_JOBS=1` and a warm named volume at `/cargo-target`, so
the numbers below are one runner and one volume: `main` with the feature off, and
the feature on. There are two feature-on regimes, and the second is the one a PR
author feels — the first build after the feature lands compiles the whole cuprated
graph, every later build is incremental against the same volume.
| | feature off — `main` 773dacb, run 402 | feature on — this branch, run 406 |
| | feature off — `main` 773dacb, run 402 | feature on — PR #113 head 3860c3d (merged as 8626da2), run 412 |
|---|---|---|
| Gradle | `BUILD SUCCESSFUL in 6m 10s` | `BUILD SUCCESSFUL in 44m 7s` |
| job wall clock | 484 s for the build step | 47m 45s job (20:10:02 → 20:57:46) |
| `/cargo-target` **before** the build | 3.1 G | 3.3 G |
| Gradle | `BUILD SUCCESSFUL in 6m 10s` | `BUILD SUCCESSFUL in 7m 14s` |
| job | 8m 21s | 11m 12s |
| build step | 484 s | 653 s |
| `/cargo-target` | 3.1 G before the build | 5.6 G after (2.7 G of it `aarch64-linux-android/release`) |
| `libonionwire_sdk.so` in the APK | 33,533,264 B | 55,438,112 B |
| `librandomx_rs-<hash>.so` | absent | 1,122,296 B |
| APK / AAR | 28,038,401 B / 10,377,416 B | see PR #113 |
| APK | 28,038,401 B | 34,445,514 B |
| AAR | 10,377,416 B | 15,728,039 B |
The feature multiplies the Gradle build by roughly **7×** (~6 min → ~44 min): the
cuprated graph is ~152 crates plus a C++ RandomX cross-build, and the runner has a
single cargo job. What it does *not* blow is anything else: the job's
`timeout-minutes` is 120, so 44 minutes fits with room to spare, and the extra
target-directory volume is a gigabyte-scale number, not a partition. **No
mitigation was needed** — the feature stays on the release path, and the job was
not made slower or conditional to accommodate it.
The **first** feature-on build is the expensive one: run 406, against a volume that
did not yet hold the cuprated graph, took `BUILD SUCCESSFUL in 44m 7s` and a
47m 44s job — the ~152-crate graph plus the C++ RandomX cross-build, with a single
cargo job on the runner. After that it settles to roughly **+2 minutes over the
feature-off build** (7m 14s vs 6m 10s), because only this repo's own crates
recompile.
`android-ci.yml` prints `du -sh /cargo-target` after the build and the workflow
echoes `build_wall_clock_seconds`, so the next person changing this graph reads
the cost from the run log instead of re-deriving it.
Nothing needed mitigating: the job's `timeout-minutes` is 120, so even the 44-minute
first build fits with room to spare, and the volume grows to 5.6 G on a runner
filesystem with 37 G free (the `df -h` in the run log). The feature is **not** gated
on a build variant, a label or a manual dispatch — the release path builds exactly
what CI verifies.
`android-ci.yml` prints `du -sh /cargo-target`, the length/method/deflated size of
every native lib, and both artifact digests, and the workflow echoes
`build_wall_clock_seconds`: the next person changing this graph reads the cost and
the artifact's identity out of the run log rather than re-deriving either.
## Not verified