From 3c8c2e96820b217af8d58cd7fcd3efa882101f22 Mon Sep 17 00:00:00 2001 From: kess Date: Mon, 12 Oct 2026 22:18:09 -0500 Subject: [PATCH] ci: harden iOS SwiftPM dependency resolution Retry 'xcodebuild -list' up to 3 times and clear a stale ~/Library/Caches/org.swift.swiftpm between attempts, to avoid transient 'cannot change to .../swift-rs-*: No such file or directory' failures. --- .github/workflows/verify.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 5c214be..9f2bcd0 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -139,7 +139,12 @@ jobs: - name: run Swift tests on iOS Simulator working-directory: ios run: | - xcodebuild -list -json + for attempt in 1 2 3; do + if xcodebuild -list -json; then break; fi + echo "SwiftPM resolution failed (attempt $attempt); clearing cache and retrying" + rm -rf "$HOME/Library/Caches/org.swift.swiftpm" "$HOME/Library/org.swift.swiftpm" || true + sleep 10 + done SCHEME="$(xcodebuild -list -json | python3 -c "import json,sys; d=json.load(sys.stdin); r=d.get('workspace') or d.get('project') or {}; s=r.get('schemes') or []; print(s[0] if s else '')")" SIM="$(xcrun simctl list devices available | grep -m1 -E '^[[:space:]]+iPhone' | sed -E 's/^[[:space:]]+//; s/ \(.*//')" echo "scheme=$SCHEME simulator=$SIM"