From 9c1c1bced57959aeca9f42030c0d1650a58727f3 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 15 Oct 2026 17:30:29 +0100 Subject: [PATCH] Retry RNTester build after Apple clang frontend crash --- .github/actions/test-ios-rntester/action.yml | 37 ++++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/actions/test-ios-rntester/action.yml b/.github/actions/test-ios-rntester/action.yml index d6a4b4604ba3..c133e8115144 100644 --- a/.github/actions/test-ios-rntester/action.yml +++ b/.github/actions/test-ios-rntester/action.yml @@ -129,19 +129,34 @@ runs: - name: Build RNTester shell: bash run: | - xcodebuild \ - -scheme "RNTester" \ - -workspace packages/rn-tester/RNTesterPods.xcworkspace \ - -configuration "${{ inputs.flavor }}" \ - -sdk "iphonesimulator" \ - -destination "generic/platform=iOS Simulator" \ - -derivedDataPath "/tmp/RNTesterBuild" + build_rntester() { + local log_file="$1" + xcodebuild \ + -scheme "RNTester" \ + -workspace packages/rn-tester/RNTesterPods.xcworkspace \ + -configuration "${{ inputs.flavor }}" \ + -sdk "iphonesimulator" \ + -destination "generic/platform=iOS Simulator" \ + -derivedDataPath "/tmp/RNTesterBuild" 2>&1 | tee "$log_file" + } - echo "Print path to *.app file" - APP_PATH=$(find "/tmp/RNTesterBuild" -type d -name "*.app") + build_log="$(mktemp)" + if build_rntester "$build_log"; then + : + elif grep -Fq "clang: error: unable to execute command: Segmentation fault: 11" "$build_log" && \ + grep -Fq "clang: error: clang frontend command failed due to signal" "$build_log"; then + echo "::warning::Apple clang frontend crashed; retrying RNTester build once." + rm -rf "/tmp/RNTesterBuild" + build_rntester "${build_log}.retry" + else + exit 1 + fi + + echo "Print path to *.app file" + APP_PATH=$(find "/tmp/RNTesterBuild" -type d -name "*.app") - echo "App found at $APP_PATH" - echo "app-path=$APP_PATH" >> $GITHUB_ENV + echo "App found at $APP_PATH" + echo "app-path=$APP_PATH" >> $GITHUB_ENV - name: 'Run Tests: iOS Unit and Integration Tests' if: ${{ inputs.run-unit-tests == 'true' }} shell: bash