From 5d0a8cb0c216ec45571f8ccc74c0d1e01e803151 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 24 Sep 2026 11:57:31 +0200 Subject: [PATCH 1/2] fix(build): Prevent update-android.sh from failing on SIGPIPE The Android dependency updater failed on main with: scripts/update-android.sh: line 28: echo: write error: Broken pipe Failed to find expectedSentryAndroidVersion in ../sentry.gradle.kts The version check used `echo "$sentryGradleContent" | grep -q ...` under `set -o pipefail`. `grep -q` exits on the first match and closes the pipe; because sentry.gradle.kts is ~54KB with the match near the top, `echo` can lose the race and get SIGPIPE. With pipefail the pipeline reports echo's non-zero status, so `if !` inverts into the failure branch even though the string is present. This is timing dependent, hence green locally but red in CI. Grep the file directly so there is no writer to receive SIGPIPE. Also adds a temporary workflow to verify the fix on the PR branch (to be removed before merge). Co-Authored-By: Claude Opus 4.8 --- .../workflows/verify-update-android-fix.yml | 32 +++++++++++++++++++ scripts/update-android.sh | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/verify-update-android-fix.yml diff --git a/.github/workflows/verify-update-android-fix.yml b/.github/workflows/verify-update-android-fix.yml new file mode 100644 index 0000000000..a8643cf493 --- /dev/null +++ b/.github/workflows/verify-update-android-fix.yml @@ -0,0 +1,32 @@ +# TEMPORARY: verifies the SIGPIPE/pipefail fix in scripts/update-android.sh. +# Reproduces the `update-deps` failure environment (ubuntu-latest) by running the +# real `set-version` path in a loop to stress the race. REMOVE before merging. +name: TEMP Verify update-android fix + +on: + push: + branches: + - fix/update-android-sigpipe + +jobs: + verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Stub the stubs updater (skip the heavy gradle jar build) + run: | + cat > scripts/update-android-stubs.sh <<'EOF' + #!/usr/bin/env bash + echo "[stub] skipping gradle jar build: $*" + EOF + chmod +x scripts/update-android-stubs.sh + + - name: Run set-version repeatedly to stress the pipefail/SIGPIPE race + run: | + for i in $(seq 1 50); do + echo "--- iteration $i ---" + scripts/update-android.sh set-version 8.58.0 + done + grep -q 'expectedSentryAndroidVersion = "8.58.0"' packages/core/sentry.gradle.kts + echo "OK: sentry.gradle.kts bumped and no broken-pipe failure across 50 runs" diff --git a/scripts/update-android.sh b/scripts/update-android.sh index 5cee31c885..68b4991969 100755 --- a/scripts/update-android.sh +++ b/scripts/update-android.sh @@ -25,7 +25,7 @@ set-version) # Update sentry.gradle.kts version check to match sentryGradleFile='../sentry.gradle.kts' sentryGradleContent=$(cat $sentryGradleFile) - if ! echo "$sentryGradleContent" | grep -q 'expectedSentryAndroidVersion'; then + if ! grep -q 'expectedSentryAndroidVersion' "$sentryGradleFile"; then echo "Failed to find expectedSentryAndroidVersion in $sentryGradleFile" exit 1 fi From 70db1dd79b47aff9d0c2a64ee8e602690b9783dd Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 24 Sep 2026 12:04:14 +0200 Subject: [PATCH 2/2] Remove temporary CI check --- .../workflows/verify-update-android-fix.yml | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 .github/workflows/verify-update-android-fix.yml diff --git a/.github/workflows/verify-update-android-fix.yml b/.github/workflows/verify-update-android-fix.yml deleted file mode 100644 index a8643cf493..0000000000 --- a/.github/workflows/verify-update-android-fix.yml +++ /dev/null @@ -1,32 +0,0 @@ -# TEMPORARY: verifies the SIGPIPE/pipefail fix in scripts/update-android.sh. -# Reproduces the `update-deps` failure environment (ubuntu-latest) by running the -# real `set-version` path in a loop to stress the race. REMOVE before merging. -name: TEMP Verify update-android fix - -on: - push: - branches: - - fix/update-android-sigpipe - -jobs: - verify: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Stub the stubs updater (skip the heavy gradle jar build) - run: | - cat > scripts/update-android-stubs.sh <<'EOF' - #!/usr/bin/env bash - echo "[stub] skipping gradle jar build: $*" - EOF - chmod +x scripts/update-android-stubs.sh - - - name: Run set-version repeatedly to stress the pipefail/SIGPIPE race - run: | - for i in $(seq 1 50); do - echo "--- iteration $i ---" - scripts/update-android.sh set-version 8.58.0 - done - grep -q 'expectedSentryAndroidVersion = "8.58.0"' packages/core/sentry.gradle.kts - echo "OK: sentry.gradle.kts bumped and no broken-pipe failure across 50 runs"