fix(release): make the local iOS runner xctestrun portable

Merged
TH
1d ago
+450-112

Summary

The release local iOS runner must ship an xctestrun that names no build-host path. Xcode 27.1 writes a host-absolute SourceFilesCommonPathPrefix in each coverage entry. It also inserts libMainThreadChecker.dylib from the host's simulator runtime mount. The packager refused both, so the v0.21.45 "Publish iOS Simulator Runner" job failed (run 46443377199).

portableXctestrunXml parses the plutil XML into a tree whose scalars keep their source text. It then:

  1. Strips the /private__TESTROOT__ prefix.
  2. Drops only SourceFilesCommonPathPrefix.
  3. Drops the checker only in the .simruntime/Contents/Resources/RuntimeRoot layout.
  4. Validates the tree and writes it once.

Untouched values keep their type and text. Every other absolute path is still refused. The XML read has no buffer cap, because coverage lists every source file.

Before / after

package-ios-local-runner.mjs on an Xcode 27.1 build:

  • Before: Error: Absolute path in xctestrun: SourceFilesCommonPathPrefix. The next refusal would be DYLD_INSERT_LIBRARIES.
  • After: the staged xctestrun differs from the source only by those two values. Its only absolute path is /usr/lib/libRPAC.dylib.

Validation

Head 184c8d5.

  • pnpm exec vitest run --project unit-core scripts/__tests__/ios-local-runner-xctestrun.test.ts: 5 passed, including integer 9007199254740993 and <real>30</real> unchanged.
  • fallow audit: no issues.
  • On 4 local Xcode 27.1 xctestruns, the output passes plutil -lint and matches plutil formatting byte for byte.
  • One output is byte-identical to the xctestrun that reached AGENT_DEVICE_RUNNER_LISTENER_READY on a fresh iOS 27.0 simulator.
  • A 1.6 MB xctestrun with 30,000 SourceFiles fails with ENOBUFS at the default buffer and packages at this head.
  • CI checks are pending.

šŸ¤– Generated with Claude Code