Checkpoint Android dependencies and capture compiler memory evidence
android-ci / android-arm64 (push) Failing after 27m51s
android-ci / android-arm64 (push) Failing after 27m51s
This commit is contained in:
1 parent
aecbacce4c
commit
88276c09c7
6 files changed
+140
-16
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
# Read only resource counters; no environment, credentials, process arguments or kernel logs.
|
||||
set -euo pipefail
|
||||
printf 'RESOURCE_SNAPSHOT %s\n' "$(date -u +%FT%TZ)"
|
||||
while read -r key value unit; do
|
||||
case "$key" in MemTotal:|MemAvailable:|SwapTotal:|SwapFree:|CommitLimit:|Committed_AS:) printf '%s %s %s\n' "$key" "$value" "${unit:-}" ;; esac
|
||||
done < /proc/meminfo
|
||||
while IFS=: read -r hierarchy controllers relative; do
|
||||
if [[ -z "$controllers" ]]; then
|
||||
base=/sys/fs/cgroup
|
||||
names=(memory.max memory.high memory.current memory.peak memory.events memory.events.local memory.swap.max memory.swap.current)
|
||||
elif [[ ",$controllers," == *,memory,* ]]; then
|
||||
base=/sys/fs/cgroup/memory
|
||||
names=(memory.limit_in_bytes memory.usage_in_bytes memory.max_usage_in_bytes memory.failcnt memory.oom_control)
|
||||
else
|
||||
continue
|
||||
fi
|
||||
current="$(realpath -m "$base/${relative#/}")"
|
||||
case "$current" in "$base"|"$base/"*) ;; *) current="$base" ;; esac
|
||||
[[ -d "$current" ]] || current="$base"
|
||||
while :; do
|
||||
for name in "${names[@]}"; do
|
||||
if [[ -r "$current/$name" ]]; then printf '%s\n' "$current/$name"; cat "$current/$name"; fi
|
||||
done
|
||||
[[ "$current" != "$base" ]] || break
|
||||
current="${current%/*}"
|
||||
done
|
||||
done < /proc/self/cgroup
|
||||
ulimit -a
|
||||
df -Pk . /
|
||||
@@ -95,7 +95,7 @@ apt_options=(-o "Dir::Cache::archives=$tools/apt/archives" -o "Dir::State::lists
|
||||
ca-certificates openjdk-21-jdk-headless clang-18 llvm-18 lld-18 libclang-18-dev \
|
||||
cmake ninja-build git python3 curl unzip zip pkg-config build-essential \
|
||||
autoconf automake libtool bison flex gperf nasm binutils file patch rsync \
|
||||
xz-utils bzip2 zstd gettext libxml2-utils locales \
|
||||
xz-utils bzip2 zstd gettext libxml2-utils locales time \
|
||||
libc6-i386 lib32gcc-s1 lib32stdc++6 zlib1g-dev libbz2-dev liblzma-dev \
|
||||
libssl-dev libffi-dev libelf-dev libcap-dev libudev-dev libglib2.0-dev \
|
||||
libnss3-dev libnspr4-dev libdbus-1-dev libdrm-dev libgbm-dev \
|
||||
|
||||
@@ -33,9 +33,9 @@ jobs:
|
||||
CI_RUN_ID: ${{ github.run_id }}
|
||||
ANDROID_CI_PROVISION: container
|
||||
CARGO_TERM_COLOR: never
|
||||
CARGO_BUILD_JOBS: "1"
|
||||
CARGO_BUILD_JOBS: "4"
|
||||
CARGO_TARGET_DIR: ${{ github.workspace }}/.android-ci/cargo-target
|
||||
CMAKE_BUILD_PARALLEL_LEVEL: "1"
|
||||
CMAKE_BUILD_PARALLEL_LEVEL: "4"
|
||||
steps:
|
||||
- name: Resource gate before checkout, cache restore or tool installation
|
||||
id: resources
|
||||
@@ -98,6 +98,7 @@ jobs:
|
||||
|
||||
- name: Provision pinned Android tools in the job container
|
||||
if: ${{ github.event.inputs.mode != 'inventory' }}
|
||||
id: tools
|
||||
run: bash .gitea/setup-android-ci.sh
|
||||
|
||||
- name: Require exact revision and no production signing
|
||||
@@ -112,14 +113,80 @@ jobs:
|
||||
cargo run --locked -p xtask -- check-version
|
||||
cargo test --locked -p xtask
|
||||
|
||||
# Source provenance is regenerated and verified, never trusted from an Actions cache.
|
||||
- name: Build pinned WebRTC dependencies with one Ninja job
|
||||
- name: Compute source dependency cache identity
|
||||
if: ${{ github.event.inputs.mode != 'inventory' }}
|
||||
run: cargo run --locked -p xtask -- deps --target "$TARGET" --llvm-dir "$LLVM_HOME" --jobs 1
|
||||
id: dependency-key
|
||||
run: |
|
||||
python3 - <<'PY'
|
||||
import hashlib, json, os, pathlib
|
||||
policy = json.loads(pathlib.Path('native/native-deps.lock.json').read_text())
|
||||
policy.pop('builds', None)
|
||||
digest = hashlib.sha256(json.dumps(policy, sort_keys=True, separators=(',', ':')).encode())
|
||||
for name in ('.gitea/android-ci-tools.json', 'xtask/src/deps.rs', 'xtask/src/build_native.rs'):
|
||||
digest.update(name.encode() + b'\0' + pathlib.Path(name).read_bytes())
|
||||
with open(os.environ['GITHUB_OUTPUT'], 'a') as out:
|
||||
out.write('key=android-webrtc-linux-arm64-v1-' + digest.hexdigest() + '\n')
|
||||
PY
|
||||
|
||||
- name: Restore pinned WebRTC source and object checkpoint
|
||||
if: ${{ github.event.inputs.mode != 'inventory' }}
|
||||
id: webrtc-cache
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: target/native-deps/aarch64-linux-android
|
||||
key: ${{ steps.dependency-key.outputs.key }}
|
||||
|
||||
# Source provenance is regenerated and verified, never trusted from an Actions cache.
|
||||
- name: Build pinned WebRTC dependencies with bounded CI parallelism
|
||||
if: ${{ github.event.inputs.mode != 'inventory' }}
|
||||
id: dependencies
|
||||
run: cargo run --locked -p xtask -- deps --target "$TARGET" --llvm-dir "$LLVM_HOME" --jobs "$CARGO_BUILD_JOBS"
|
||||
|
||||
- name: Checkpoint verified WebRTC before application build
|
||||
if: ${{ success() && github.event.inputs.mode != 'inventory' && steps.webrtc-cache.outputs.cache-hit != 'true' }}
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: target/native-deps/aarch64-linux-android
|
||||
key: ${{ steps.dependency-key.outputs.key }}
|
||||
|
||||
- name: Checkpoint provisioned tools before application build
|
||||
if: ${{ success() && github.event.inputs.mode != 'inventory' && steps.cache.outputs.cache-hit != 'true' }}
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: |
|
||||
.android-ci/tools/downloads
|
||||
.android-ci/tools/rustup
|
||||
.android-ci/tools/cargo
|
||||
.android-ci/tools/android-sdk
|
||||
.android-ci/tools/skia-m153-0.101.2
|
||||
.android-ci/tools/gradle
|
||||
.android-ci/cargo-target
|
||||
key: ${{ steps.cache.outputs.cache-primary-key }}-checkpoint
|
||||
|
||||
- name: Build and verify full-feature test APK
|
||||
if: ${{ github.event.inputs.mode != 'inventory' }}
|
||||
run: bash .gitea/build-android-variant.sh harness
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p .android-ci/diagnostics
|
||||
bash .gitea/android-memory-report.sh | tee .android-ci/diagnostics/before.txt
|
||||
trap 'status=$?; trap - EXIT; bash .gitea/android-memory-report.sh | tee .android-ci/diagnostics/after.txt; exit "$status"' EXIT
|
||||
/usr/bin/time -v -o .android-ci/diagnostics/build-time.txt bash .gitea/build-android-variant.sh harness
|
||||
|
||||
- name: Report container memory evidence on build failure
|
||||
if: ${{ always() && steps.tools.outcome == 'success' && github.event.inputs.mode != 'inventory' }}
|
||||
run: |
|
||||
set -eu
|
||||
if [ -f .android-ci/diagnostics/build-time.txt ]; then cat .android-ci/diagnostics/build-time.txt; fi
|
||||
bash .gitea/android-memory-report.sh
|
||||
|
||||
- name: Retain native compiler resource diagnostics
|
||||
if: ${{ always() && steps.tools.outcome == 'success' && github.event.inputs.mode != 'inventory' }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android-build-resources-${{ github.sha }}
|
||||
path: .android-ci/diagnostics/*.txt
|
||||
if-no-files-found: warn
|
||||
retention-days: 7
|
||||
|
||||
- name: Upload installable Android test APK and provenance
|
||||
if: ${{ github.event.inputs.mode != 'inventory' }}
|
||||
|
||||
+3
-2
@@ -3,8 +3,9 @@
|
||||
## Unreleased
|
||||
|
||||
- Android CI now runs on trusted feature/mobile-port pushes using an isolated Ubuntu24.04 container.
|
||||
Added checksum-pinned SDK/NDK/Rust/Skia/Gradle provisioning, early disk/RAM gates, one-job compilation,
|
||||
tool/Cargo caches and SHA-labelled test APK artifacts; no automatic releases, signing or device actions.
|
||||
Added checksum-pinned SDK/NDK/Rust/Skia/Gradle provisioning, early disk/RAM gates, four-job CI compilation,
|
||||
dependency checkpoints before native build, memory evidence and SHA-labelled test APK artifacts;
|
||||
no automatic releases, production signing or device actions. Local Windows limits remain separate.
|
||||
|
||||
- Android onboarding is now a full-screen page with a one-line 48dp nickname field, visible theme
|
||||
choices, errors and Create/Cancel buttons; keyboard insets are handled before profile creation.
|
||||
|
||||
@@ -110,17 +110,24 @@ expansion, host installation, privileged Docker socket or deletion of other jobs
|
||||
checksummed pinned downloads listed in `.gitea/android-ci-tools.json`: Rust1.96.0, SDK36,
|
||||
build-tools36.0.0, NDK28.2.13676358, Gradle8.14.3, synced Skia m153-0.101.2 and bundletool.
|
||||
The output environment also supplies full NDK, ANDROID_JAR and Skia inputs needed by the real first build.
|
||||
One Cargo/Ninja job and a six-hour job deadline limit workload; Windows-only optimization overrides
|
||||
are not used. `xtask deps` regenerates dependency provenance; `build/package/verify-package` use the
|
||||
Four Cargo/Ninja/CMake jobs and a six-hour job deadline bound CI workload; the developer PC's
|
||||
one-job memory policy and Windows-only optimization overrides do not apply here. `xtask deps`
|
||||
regenerates dependency provenance; `build/package/verify-package` use the
|
||||
existing full Skia+WebRTC path. Production signing environment is rejected.
|
||||
|
||||
Tools/downloads/SDK/Skia/Gradle/Cargo caches live under ignored `.android-ci/`; Actions cache v3 keys
|
||||
include tool pins, Cargo.lock and source SHA, restoring only within the same tool/dependency prefix.
|
||||
Only successful jobs save these caches. Private signing keys and user profiles are not cached/uploaded.
|
||||
WebRTC source/object trees and completed receipts are **not** restored from Actions cache: every run
|
||||
provisions pinned WebRTC and verifies its current receipts. Thus this workflow does not yet promise
|
||||
incremental WebRTC across jobs; large persistent source caches require separate runner-admin storage.
|
||||
Gitea cache service reachability/capacity must be provided by the runner administrator.
|
||||
Tool/Cargo state is checkpointed after successful dependency provisioning, before compiling the app;
|
||||
the final successful job saves a newer checkpoint. Private signing keys and profiles are excluded.
|
||||
A separate exact-key cache keeps `target/native-deps/aarch64-linux-android`, including pinned Git
|
||||
checkouts and Ninja objects. Its key excludes completed build receipts but includes source policy,
|
||||
tool pins and dependency drivers; there is no cross-policy fallback. Every cache hit still runs
|
||||
`xtask deps`: checkouts, patches, GN inputs and artifacts are checked and current provenance is
|
||||
regenerated before use. The repository lock is never overwritten by a cached copy.
|
||||
These potentially large checkpoints require runner cache storage/capacity; cache misses remain valid
|
||||
cold builds. Before/after cgroup counters and `/usr/bin/time -v` data are retained as a separate
|
||||
`android-build-resources-<SHA>` artifact even when native compilation fails, to diagnose SIGKILL
|
||||
without assuming OOM. No host kernel logs, credentials or process argument dumps are collected.
|
||||
|
||||
The artifact is **`android-harness-arm64-<full commit SHA>`**, retained14days, containing the test APK
|
||||
and revision/hash/build/dependency/package receipts. Unsigned production APK/AAB remain available via
|
||||
|
||||
@@ -49,6 +49,25 @@ Updated **2026-11-11**. Windows baseline remains `05e8d34bcf0e24a44f76e65220293c
|
||||
Android SDK/NDK, then failed git-sync-deps with HTTPS connection errors to skia.googlesource.com
|
||||
and chromium.googlesource.com; other pinned checkouts succeeded. Added at most3 sync attempts
|
||||
against the exact same immutable inputs, retaining mandatory SHA/revision checks and fatal failure.
|
||||
- Run4844 on `aecbacc` passed all provisioning and xtask tests (10 passed), reached real WebRTC
|
||||
compilation (1483/4674 observed). User clarified the one-job limit applies only to their Windows PC;
|
||||
CI configuration changed locally to4 Cargo/Ninja/CMake jobs using the observed32CPU/≈29GiB RAM.
|
||||
Running Ninja cannot change job count via Gitea; do not cancel and discard this job's uncached
|
||||
WebRTC progress merely to increase parallelism. Publish the4-job setting after the current run;
|
||||
local `mobile-build.local.md` limits remain unchanged.
|
||||
- **Run4844 final:** WebRTC source build/provenance succeeded (34m48s), then native APK build failed
|
||||
after14m34s: `rustc teamspeach_native` terminated by **signal9/SIGKILL**, not a reported Rust type error.
|
||||
APK/package/upload did not complete. Cause is not proven OOM: no cgroup memory.events/host killer
|
||||
evidence was recorded by that revision. Local4-job configuration not pushed yet; repeating a more
|
||||
concurrent cold build without diagnosing the kill is unsafe. Added failure-only cgroup memory
|
||||
evidence output for the next run. Need runner administrator's OOM/limits evidence before choosing
|
||||
more memory or Android-specific compiler settings; Windows optimization workaround not copied.
|
||||
- Owner requested continuation. Preparing4-job CI with pre-application checkpoints: exact-policy
|
||||
WebRTC checkout/object cache saved only after successful deps, plus tool/Cargo checkpoint before
|
||||
native compilation. Cache hits still execute source/patch/fingerprint/provenance checks; cached
|
||||
repository lock is never substituted. Added before/after visible cgroup memory counters and
|
||||
time-v maximum RSS as failure-safe artifacts; these distinguish measured OOM from arbitrary SIGKILL.
|
||||
No lto/codegen override, memory-cap removal or host administration performed.
|
||||
|
||||
## First Android APK build
|
||||
|
||||
|
||||
Reference in new issue
Block a user