diff --git a/.forgejo/workflows/android-ci.yml b/.forgejo/workflows/android-ci.yml index bed8806..58df49d 100644 --- a/.forgejo/workflows/android-ci.yml +++ b/.forgejo/workflows/android-ci.yml @@ -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' diff --git a/android/CUPRATE_DAEMON.md b/android/CUPRATE_DAEMON.md index bd66299..d45b411 100644 --- a/android/CUPRATE_DAEMON.md +++ b/android/CUPRATE_DAEMON.md @@ -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-.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