From 53919f73c5e142309a7bc184b6a537854dfd51df Mon Sep 17 00:00:00 2001 From: jwinterm Date: Tue, 19 May 2026 07:30:13 -0400 Subject: [PATCH] CI: tolerate missing Android i686 ABI; brew-first CocoaPods install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Android: - monero_c prebuilt bundle doesn't ship i686-linux-android (32-bit x86 Android — essentially extinct, sim/emulators use x86_64). Was failing loud on the missing target. Now: missing target = skip + log; only the truly-modern ABIs (arm64-v8a, x86_64) are REQUIRED. armeabi-v7a (32-bit ARM) is shipped if available but not required. The resulting APK is universal across whichever ABIs got staged. iOS: - 'sudo gem install cocoapods' was hitting a password prompt because the Gitea runner user has no passwordless sudo configured (rightly). Switched to brew-first install (Homebrew lives in its own prefix, no sudo needed on Mac). Falls back to 'gem install --user-install' (no sudo) if brew is somehow unavailable. The whole step is still no-op if 'pod' is already on PATH. --- .github/workflows/build-android.yml | 30 +++++++++++++++++++--- .github/workflows/build-ios-sim.yml | 16 ++++++++++-- .github/workflows/build-ios-testflight.yml | 14 ++++++++-- 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 7c8d73692..8ebfa1d83 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -101,26 +101,50 @@ jobs: MONERO_C_TAG=$(cd scripts/monero_c && git describe --tags) BUNDLE_DIR="scripts/monero_c/release/$MONERO_C_TAG" - # monero_c target dir → Android ABI dir + # monero_c target dir → Android ABI dir. i686 (32-bit x86) is + # essentially dead on real Android devices; the monero_c bundle + # doesn't ship it. Missing target = log + skip, not fatal. The + # required modern ABIs (arm64-v8a, x86_64) MUST exist or we fail. declare -A ABI_MAP=( [aarch64-linux-android]=arm64-v8a [armv7a-linux-androideabi]=armeabi-v7a [i686-linux-android]=x86 [x86_64-linux-android]=x86_64 ) + REQUIRED_ABIS=(arm64-v8a x86_64) + declare -A FOUND_ABI for target in "${!ABI_MAP[@]}"; do abi="${ABI_MAP[$target]}" + if [[ ! -d "$BUNDLE_DIR/$target" ]]; then + echo "SKIP: $target not in bundle (Android ABI $abi will not be shipped)" + continue + fi mkdir -p "android/app/src/main/jniLibs/$abi" + ok=true for coin in monero wownero; do src="$BUNDLE_DIR/$target/lib${coin}_wallet2_api_c.so" if [[ -f "$src" ]]; then cp -v "$src" "android/app/src/main/jniLibs/$abi/" else - echo "MISSING: $src — fail loud, the bundle layout may have changed" - exit 1 + echo "SKIP: $src missing (skipping $abi)" + ok=false + break fi done + if $ok; then + FOUND_ABI[$abi]=1 + else + rm -rf "android/app/src/main/jniLibs/$abi" + fi + done + + # Fail loudly only if a required ABI is missing. + for required in "${REQUIRED_ABIS[@]}"; do + if [[ -z "${FOUND_ABI[$required]:-}" ]]; then + echo "FATAL: required ABI $required is missing — monero_c bundle layout has changed" + exit 1 + fi done echo "=== jniLibs contents ===" diff --git a/.github/workflows/build-ios-sim.yml b/.github/workflows/build-ios-sim.yml index 9a4f8385b..b94c1f645 100644 --- a/.github/workflows/build-ios-sim.yml +++ b/.github/workflows/build-ios-sim.yml @@ -58,8 +58,20 @@ jobs: - name: Install CocoaPods (if missing) run: | - if ! command -v pod >/dev/null; then - sudo gem install cocoapods --no-document + if command -v pod >/dev/null; then + pod --version + exit 0 + fi + # Prefer Homebrew on macOS — no sudo, installs into its own prefix. + if command -v brew >/dev/null; then + brew install cocoapods + else + # Fallback: user-local gem install (no sudo). + export GEM_HOME="$HOME/.gem" + export PATH="$GEM_HOME/bin:$PATH" + echo "GEM_HOME=$HOME/.gem" >> "$GITHUB_ENV" + echo "$HOME/.gem/bin" >> "$GITHUB_PATH" + gem install --user-install cocoapods --no-document fi pod --version diff --git a/.github/workflows/build-ios-testflight.yml b/.github/workflows/build-ios-testflight.yml index 88e0222e6..4acd81922 100644 --- a/.github/workflows/build-ios-testflight.yml +++ b/.github/workflows/build-ios-testflight.yml @@ -61,8 +61,18 @@ jobs: - name: Install CocoaPods (if missing) run: | - if ! command -v pod >/dev/null; then - sudo gem install cocoapods --no-document + if command -v pod >/dev/null; then + pod --version + exit 0 + fi + if command -v brew >/dev/null; then + brew install cocoapods + else + export GEM_HOME="$HOME/.gem" + export PATH="$GEM_HOME/bin:$PATH" + echo "GEM_HOME=$HOME/.gem" >> "$GITHUB_ENV" + echo "$HOME/.gem/bin" >> "$GITHUB_PATH" + gem install --user-install cocoapods --no-document fi pod --version