From 332266bd281fad91298c3d70f2e4e01fdb92fff4 Mon Sep 17 00:00:00 2001 From: Daewoon Kim Date: Fri, 11 Sep 2026 12:02:39 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix(scatterlab-prebuild-android):=20sdkmana?= =?UTF-8?q?ger=20=EC=8A=A4=ED=85=9D=EC=9D=98=20pipefail=20=EC=9E=90?= =?UTF-8?q?=ED=95=B4=EB=A5=BC=20=EA=B3=A0=EC=B9=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 내가 넣은 SDK 설치 스텝이 그 자체로 죽었다 (run 34556521004). 로그는 "Computing updates... 100%" 직후 끊기고 다운로드 진행이 없다. 원인은 `set -o pipefail` 아래의 `yes | sdkmanager` 다. sdkmanager 가 먼저 끝나면 `yes` 가 SIGPIPE(141)로 죽고, pipefail 이 그 코드를 파이프라인 결과로 삼아 `set -e` 가 스텝을 죽인다 — 설치가 성공해도 실패로 보고된다. 라이선스 수락은 pipefail 을 끈 채 별도 파이프라인으로, 설치는 파이프 없이 돌린다. `--sdk_root` 을 명시하고, 디렉터리 확인이 실패하면 실제로 무엇이 깔려 있는지 찍어 다음 실행을 기다리지 않고 원인을 본다. Co-Authored-By: Claude Opus 5 (1M context) --- .../workflows/scatterlab-prebuild-android.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scatterlab-prebuild-android.yml b/.github/workflows/scatterlab-prebuild-android.yml index f9f5f4c199d..b3975d7f812 100644 --- a/.github/workflows/scatterlab-prebuild-android.yml +++ b/.github/workflows/scatterlab-prebuild-android.yml @@ -191,11 +191,26 @@ jobs: exit 1 fi echo "sdkmanager: $SDKMANAGER" - yes 2>/dev/null | "$SDKMANAGER" --install 'cmake;3.30.5' 'ndk;27.1.12297006' + + # `yes | sdkmanager` cannot be used under `pipefail`: when sdkmanager exits first, + # `yes` dies of SIGPIPE (141) and pipefail makes that the pipeline's status, so a + # successful install still fails the step. Accept licences in their own pipeline + # with pipefail off, then install without a pipe at all. + set +o pipefail + yes 2>/dev/null | "$SDKMANAGER" --sdk_root="$ANDROID_HOME" --licenses >/dev/null || true + set -o pipefail + + "$SDKMANAGER" --sdk_root="$ANDROID_HOME" --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; } + if [ ! -d "$required" ]; then + echo "::error::$required is still missing after sdkmanager ran" + echo "cmake dirs:"; ls -1 "$ANDROID_HOME/cmake" 2>/dev/null || echo " (none)" + echo "ndk dirs:"; ls -1 "$ANDROID_HOME/ndk" 2>/dev/null || echo " (none)" + exit 1 + fi done echo "cmake 3.30.5 and ndk 27.1.12297006 present" From 2600b9cd2693f09a1c9ba0c7f1b5b655e26b231f Mon Sep 17 00:00:00 2001 From: Daewoon Kim Date: Fri, 11 Sep 2026 12:05:36 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix(scatterlab-prebuild-android):=20?= =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EC=84=A0=EC=8A=A4=20=EC=88=98=EB=9D=BD=20?= =?UTF-8?q?=EC=8B=A4=ED=8C=A8=EB=A5=BC=20=EC=82=BC=ED=82=A4=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `|| true` 는 `yes` 의 SIGPIPE 를 삼키려고 넣었는데 진짜 라이선스 수락 실패까지 같이 삼킨다. pipefail 을 끈 상태에서는 파이프라인 상태가 마지막 명령 (sdkmanager) 것이므로 `|| true` 없이도 SIGPIPE 는 무시되고 실제 실패는 잡힌다. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/scatterlab-prebuild-android.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scatterlab-prebuild-android.yml b/.github/workflows/scatterlab-prebuild-android.yml index b3975d7f812..a10cf0366f3 100644 --- a/.github/workflows/scatterlab-prebuild-android.yml +++ b/.github/workflows/scatterlab-prebuild-android.yml @@ -194,10 +194,15 @@ jobs: # `yes | sdkmanager` cannot be used under `pipefail`: when sdkmanager exits first, # `yes` dies of SIGPIPE (141) and pipefail makes that the pipeline's status, so a - # successful install still fails the step. Accept licences in their own pipeline - # with pipefail off, then install without a pipe at all. + # successful install still fails the step. With pipefail off the pipeline reports + # sdkmanager's own status instead, so SIGPIPE is ignored and a real licence + # failure is still caught - no `|| true`, which would swallow both. set +o pipefail - yes 2>/dev/null | "$SDKMANAGER" --sdk_root="$ANDROID_HOME" --licenses >/dev/null || true + if ! yes 2>/dev/null | "$SDKMANAGER" --sdk_root="$ANDROID_HOME" --licenses >/dev/null; then + set -o pipefail + echo "::error::sdkmanager --licenses failed; cmake/ndk cannot be installed" + exit 1 + fi set -o pipefail "$SDKMANAGER" --sdk_root="$ANDROID_HOME" --install 'cmake;3.30.5' 'ndk;27.1.12297006'