fix(release): make the local iOS runner xctestrun portable
Merged
TH
1d ago+450+450+012345678901234567890123456789-112-112-012345678901234567890123456789
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:
- Strips the
/private__TESTROOT__prefix. - Drops only
SourceFilesCommonPathPrefix. - Drops the checker only in the
.simruntime/Contents/Resources/RuntimeRootlayout. - 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 beDYLD_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 -lintand matchesplutilformatting byte for byte. - One output is byte-identical to the xctestrun that reached
AGENT_DEVICE_RUNNER_LISTENER_READYon a fresh iOS 27.0 simulator. - A 1.6 MB xctestrun with 30,000
SourceFilesfails withENOBUFSat the default buffer and packages at this head. - CI checks are pending.
š¤ Generated with Claude Code