You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci: make dependency resolution resilient with or without a cache
Jobs were being killed at the job timeout with no build output at all, and
cleanup terminating orphaned git and git-remote-http processes. They were not
hung on a test or a build — they were still fetching dependencies.
Left to xcodebuild, resolution happens silently inside the build or test
invocation. SwiftPM checks out ~31 repositories one at a time through blocking
git subprocesses and prints nothing until the first compile, so a slow clone is
indistinguishable from a hang: the job emits no output, and is eventually killed
with the whole run lost.
Resolution is now an explicit step in both run_xcodebuild and
run_xcodebuild_test:
- bounded per attempt by a background watchdog, so a stalled clone is killed
rather than left to consume the job budget
- retried up to 3 times, clearing partial mirror state between attempts, since
a half-written clone is a common way for this to wedge
- logged in its own group with elapsed time, so slow is distinguishable from
stuck
- failing with an explicit "this is a dependency fetch problem, not a test
failure" rather than a bare timeout
The build and test invocations now always pass
-disableAutomaticPackageResolution. Whether the checkouts came from a warm cache
or from the step above, xcodebuild can never fall back to resolving mid-run,
which is the fallback that produced the silent hangs.
The watchdog is used because `timeout-minutes:` is rejected on steps inside a
composite action and `timeout(1)` is not installed on macOS runners.
Job timeouts go from 30 to 60 minutes, including the eight callers that
hardcoded 30 and so overrode the reusable workflow default. That is headroom for
cold fetches and for simulator startup, which has been observed taking tens of
minutes on visionOS and iOS; it is not the fix, since resolution is separately
bounded above.
Deliberately not included: cache seeding. A seeding workflow only runs once it
is on the default branch, and GitHub scopes branch caches so a cache seeded on
one branch is invisible to sibling PRs. That made it unverifiable before merge
and useless to the PRs that needed it. This change instead makes the cold path
work on its own; caching remains a speed optimisation rather than a correctness
requirement.
Verified locally against a completely empty cache (all amplify-packages entries
deleted first): resolve took 2m11s and produced 31 checkouts, then
`xcodebuild test` with resolution disabled took 1m43s and passed
(** TEST SUCCEEDED **, 31 tests), with zero fetch attempts during the test.
Also confirmed `swift package resolve` is not a faster substitute — it took
4m19s against xcodebuild's 2m11s.
0 commit comments