From 4e60f9fe4822cd298d7b91f2239862abe6816827 Mon Sep 17 00:00:00 2001 From: Daewoon Kim Date: Fri, 11 Sep 2026 11:55:35 +0900 Subject: [PATCH] =?UTF-8?q?fix(scatterlab-prebuild-android):=20=EB=B9=8C?= =?UTF-8?q?=EB=93=9C=EC=97=90=20=ED=95=84=EC=9A=94=ED=95=9C=20CMake=C2=B7N?= =?UTF-8?q?DK=20=EB=A5=BC=20=EB=9F=AC=EB=84=88=EC=97=90=20=EC=84=A4?= =?UTF-8?q?=EC=B9=98=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 디스크가 풀린 뒤 Gradle 안까지 처음 들어갔고, 거기서 죽었다 (run 34554813265): [CXX1300] CMake '3.30.5' was not found in SDK, PATH, or by cmake.dir property. zeta 앱 빌드는 prebuilt react-android AAR 을 링크할 뿐 ReactCommon 을 컴파일하지 않는다. 그래서 이 러너의 SDK 가 그 CMake 를 들고 있을 이유가 없었다 — 우리가 여기서 RN 의 C++ 를 빌드하는 첫 작업이다. 손으로 깔지 않고 워크플로에서 한다. 라벨 뒤에 머신이 여러 대이고(실행이 `actions-runner-a` 와 `runner-c` 에 각각 붙었다) 손으로 깔면 그때 본 한 대만 고쳐진다. sdkmanager 는 멱등이라 이미 깔린 머신에선 no-op 이다. sdkmanager 의 종료 코드는 설치를 조용히 건너뛴 경우에도 0 이라, 디렉터리 존재로 실제 설치를 확인한다. Co-Authored-By: Claude Opus 5 (1M context) --- .github/scatterlab/android-prebuilt.md | 1 + .../workflows/scatterlab-prebuild-android.yml | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/.github/scatterlab/android-prebuilt.md b/.github/scatterlab/android-prebuilt.md index 812ae102866..c20884c5292 100644 --- a/.github/scatterlab/android-prebuilt.md +++ b/.github/scatterlab/android-prebuilt.md @@ -65,6 +65,7 @@ env ORG_GRADLE_PROJECT_react.internal.useHermesStable=true \ - ABI는 기본값(`armeabi-v7a,arm64-v8a,x86,x86_64`)을 그대로 둔다. 소비자의 `reactNativeArchitectures`와 같아야 한다. - Debug·Release 두 variant는 `components.default` 멀티 variant 퍼블리시로 한 번에 나온다(`publish.gradle`). - 빌드는 **zeta 의 네이티브 Android 출고가 도는 러너**(`[self-hosted, zeta-app-builder]`)에서 돈다 — SDK·NDK·CMake 가 이미 있고 조직 TLS 프록시도 이미 신뢰한다. 상류처럼 `reactnativecommunity/react-native-android` 컨테이너를 쓰는 길은 막혀 있다: dind ARC 러너의 잡 컨테이너 안에서는 git 이 github.com 을 검증하지 못하고(조직이 자체 CA로 TLS를 종단한다), `volumes:` 로도 못 고친다 — dind는 **docker 데몬 쪽** 파일시스템을 마운트하지 그 CA를 가진 러너의 것을 마운트하지 않는다. `ANDROID_HOME` 은 `deploy-native.yml` 과 같은 값을 쓴다. +- 러너의 Android SDK에 `cmake;3.30.5` 와 `ndk;27.1.12297006` 이 있어야 한다. zeta 앱 빌드는 prebuilt AAR을 링크할 뿐 ReactCommon을 컴파일하지 않아 이 둘을 쓸 일이 없었다. 워크플로가 `sdkmanager` 로 직접 설치하고 설치 여부를 디렉터리 존재로 확인한다 — 라벨 뒤에 머신이 여러 대라 손으로 깔면 한 대만 고쳐진다. 버전은 `libs.versions.toml`(ndkVersion)·`ReactAndroid/build.gradle.kts`(cmakeVersion)를 따르며 **base를 올릴 때 함께 맞춘다**. - ccache를 러너에 유지한다. 없으면 매 실행이 전체 C++ 재컴파일이다. - 빌드 산출물은 수 GB다. `if: always()`로 정리한다. diff --git a/.github/workflows/scatterlab-prebuild-android.yml b/.github/workflows/scatterlab-prebuild-android.yml index 758eec8f892..f9f5f4c199d 100644 --- a/.github/workflows/scatterlab-prebuild-android.yml +++ b/.github/workflows/scatterlab-prebuild-android.yml @@ -167,6 +167,38 @@ jobs: - uses: ./.github/actions/yarn-install + # zeta's app build links the prebuilt react-android AAR and never compiles + # ReactCommon, so nothing has ever needed these on this runner - the first real run + # died with `[CXX1300] CMake '3.30.5' was not found in SDK, PATH, or by cmake.dir + # property.` (run 34554813265). Installing here rather than by hand because the + # label carries several machines (runs landed on `actions-runner-a` and `runner-c`), + # so a manual install only fixes whichever one you were looking at. + # + # Versions must match packages/react-native/gradle/libs.versions.toml (ndkVersion) + # and ReactAndroid/build.gradle.kts (cmakeVersion) - upstream builds against that + # pair. sdkmanager is idempotent, so this is a no-op once a machine is warm. + - name: Ensure the CMake and NDK ReactAndroid builds against + run: | + set -euo pipefail + SDKMANAGER="" + for candidate in "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager \ + "$ANDROID_HOME"/cmdline-tools/*/bin/sdkmanager \ + "$ANDROID_HOME"/tools/bin/sdkmanager; do + if [ -x "$candidate" ]; then SDKMANAGER="$candidate"; break; fi + done + if [ -z "$SDKMANAGER" ]; then + echo "::error::No sdkmanager under $ANDROID_HOME. This runner cannot install the CMake/NDK ReactAndroid needs." + exit 1 + fi + echo "sdkmanager: $SDKMANAGER" + yes 2>/dev/null | "$SDKMANAGER" --install 'cmake;3.30.5' 'ndk;27.1.12297006' + # Prove it landed rather than trusting sdkmanager's exit code, which stays 0 for + # a package it silently declined to install. + for required in "$ANDROID_HOME/cmake/3.30.5" "$ANDROID_HOME/ndk/27.1.12297006"; do + [ -d "$required" ] || { echo "::error::$required is still missing after sdkmanager ran"; exit 1; } + done + echo "cmake 3.30.5 and ndk 27.1.12297006 present" + # Without a warm ccache every run is a full C++ rebuild of ReactCommon. # CCACHE_DIR is set explicitly: ccache's default differs per platform, and the cache # action needs the same path the compiler actually writes to.