test-ios: rerun CmuxiOS unit tests once when the runner's precompiled modules are stale

Merged
AZ
14d ago
+26-9

Summary

ios-simulator-build failed twice on #24572 (cmux9s-mac-mini-glaeda-4, cmuxs-mac-mini-5-glaeda-2) with:

error: file '…/cmuxios-unit-tests/<runner>/Build/Products/Debug-iphonesimulator/include/ghostty.h' has been modified since the module file '…/SwiftExplicitPrecompiledModules/GhosttyNextKit-*.pcm' was built

The owned runners keep this DerivedData per runner, so a push rebuilds only what changed. But each run copies ghostty.h again with a new mtime, which leaves the explicit PCMs from the previous run stale. Base pushes skip this lane, which is why only PRs that touch Packages/iOS or ios/ see it.

On exactly that error, the step now clears the three module caches and runs once more. Any other failure fails as before.

Changelog

none

Tests

  • YAML parses. The if ! run_tests form keeps set -e from stopping on the first failure.
  • I didn't run this lane by hand. #24572's next ios-simulator-build exercises it after this merges.

Observed / Not run

  • Observed: the error on #24572, runs 40016826289 and 40024227335.
  • Not run: actionlint (not installed locally); the hosted ci-guards job runs it.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Retries the CmuxiOS unit test step once when a runner's cached precompiled modules are stale, so the lane stops failing on the "has been modified since the module file" error.

  • The per-runner DerivedData keeps explicit precompiled modules; each run copies ghostty.h again with a new mtime, leaving them stale.
  • On that exact error, clears SwiftExplicitPrecompiledModules, ExplicitPrecompiledModules, and ModuleCache.noindex, then runs the tests once more.
  • Any other failure still fails the job as before.