Skip to content

fix(ios): pin runner build roots under derived data - #3158

Merged
thymikee merged 1 commit into
callstack:mainfrom
okwasniewski:oskar/ios-xctestrun-redirected-build-products
Oct 3, 2026
Merged

thymikee merged 1 commit into
callstack:mainfrom
okwasniewski:oskar/ios-xctestrun-redirected-build-products

Conversation

@okwasniewski

@okwasniewski okwasniewski commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

From e2e feedback: on a host whose Xcode settings use a custom or legacy build location, the runner build failed with "Failed to locate .xctestrun after build". -derivedDataPath alone does not override that preference, so products landed outside the runner cache directory.

The daemon runner build and scripts/build-xcuitest-apple.sh now pass SYMROOT, OBJROOT, and SHARED_PRECOMPS_DIR pinned to the default layout under the derived path. These are location settings, not compiler recipe, so they stay out of the cache-identity build settings.

6 files touched. Rebase onto main resolved conflicts with the ARCHS resolver and the xcuitest-build-settings.ts refactor; the new test's fake build now seeds a certifiable product bundle.

Validation

Tested commit: 86fd3f4277d76d48b1fe1f8d9acd4ad6d0d7f3bc (on upstream/main 9a245d0).

  • New runner-artifact-build-location.test.ts (fake xcodebuild honoring a custom build location): fails with the pin removed, passes with it; also asserts cache reuse without rebuild.
  • scripts/__tests__/runner-isolation-diagnostics.test.ts: script passes the three pinned roots.
  • pnpm check:affected --run --base upstream/main: all runnable checks passed (447 files / 3344 related tests, xctest-selection, packaged-runner-swift).
  • Live, iOS 27 sim (pre-rebase head) with an xcodebuild wrapper injecting IDEBuildLocationStyle=Custom: before, build failed to locate .xctestrun; after, tap works, a second run reuses the cache, and the normal path still works.

Review in cubic

A custom or legacy build location in Xcode settings redirected runner
products outside -derivedDataPath, so the xctestrun was never found.
Pass SYMROOT, OBJROOT, and SHARED_PRECOMPS_DIR explicitly in the daemon
build and build-xcuitest-apple.sh.
Copilot AI balanced review requested due to automatic review settings October 3, 2026 12:13

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Re-trigger cubic

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation and regression coverage are coherent; only a non-blocking stale documentation invariant remains.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Pins Apple runner build outputs beneath DerivedData, preventing custom Xcode locations from breaking .xctestrun discovery and cache reuse.

Changes:

  • Adds shared build-location settings to daemon builds.
  • Pins equivalent roots in the standalone build script.
  • Adds regression coverage for argument propagation and cache reuse.
File Description
scripts/​build-xcuitest-apple.sh Pins script build roots under DerivedData.
scripts/​__tests__/​runner-isolation-diagnostics.test.ts Verifies pinned script arguments.
packages/​platform-apple/​src/​runner/​runner-cache.ts Re-exports the location resolver.
packages/​platform-apple/​src/​runner/​runner-cache-metadata.ts Defines pinned build-location settings.
packages/​platform-apple/​src/​runner/​runner-artifact.ts Applies settings to daemon builds.
packages/​platform-apple/​src/​runner/​__tests__/​runner-artifact-build-location.test.ts Covers custom locations and cache reuse.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +147 to +149
SYMROOT="$DERIVED_PATH/Build/Products" \
OBJROOT="$DERIVED_PATH/Build/Intermediates.noindex" \
SHARED_PRECOMPS_DIR="$DERIVED_PATH/Build/Intermediates.noindex/PrecompiledHeaders" \
@thymikee

thymikee commented Oct 3, 2026

Copy link
Copy Markdown
Member

The PR is ready at 86fd3f4. Not blocking, and you can take or leave these: the script respells the build layout (Build/Products, Intermediates.noindex, PrecompiledHeaders) that the daemon takes from resolveRunnerBuildLocationSettings, so the two can drift, and the comment at lines 128-130 of build-xcuitest-apple.sh and the xcuitest-build-settings.ts header are now stale (emitting the location settings from that file would give one owner); the daemon test's fake xcodebuild reads only SYMROOT, so asserting the OBJROOT and SHARED_PRECOMPS_DIR args too would cover a dropped setting; and the script passes AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH through without path.resolve as the daemon does, so I wonder whether a relative override would give a relative SYMROOT that Xcode resolves against the project directory (I could not confirm this without Xcode).

The Copilot thread on the stale script comment still applies: #3158 (comment).

Smoke Tests (run 37122186426) was still running when I checked, so I can't call CI green yet. It builds the runner through build-xcuitest-apple.sh, but the pinned paths match the default layout, so I expect it to pass. I did not run Xcode or the new tests, and I did not check the author's live run. The tested SHA in the PR body also differs from the head. Smoke Tests must finish green before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 3, 2026
@thymikee
thymikee merged commit 46403db into callstack:main Oct 3, 2026
14 checks passed
thymikee added a commit to hassantsyed/agent-device that referenced this pull request Oct 3, 2026
…lugin

* origin/main: (628 commits)
  fix(ios): pin runner build roots under derived data (callstack#3158)
  feat: add managed provider plugin infrastructure (callstack#3121)
  fix(ios): report keyboard focus from the AX bridge's is-editing trait (callstack#3163)
  feat(devices): report model and osVersion (callstack#3119)
  fix: guard alert deadline before native tap synthesis (callstack#3113)
  feat(install-source): accept archive URLs from any public host (callstack#3110)
  test: keep uptime responsive behind busy runner work (callstack#3114)
  fix(apple): read the launch confirmation whenever the open cannot see the app (callstack#3115)
  fix(host-kit): keep extracted directories owner-accessible (callstack#3111)
  fix(daemon): run Apple tools with the requesting client's DEVELOPER_DIR (callstack#3109)
  fix(daemon): fence daemon.json removal to its owning process (callstack#3102)
  fix(snapshot): stop sibling-sized chrome containers from covering their own region (callstack#2996) (callstack#3097)
  fix(ios): stop reading windows past the one the runner resolved (callstack#3103)
  refactor(daemon): apply one dispatch-disclosure rule to returned and thrown failures (callstack#3099)
  chore: drop unused production exports and suppress dynamic consumers (callstack#3100)
  docs(help): document wait readiness and restart exhaustion (callstack#3098)
  docs: simplify Host to fresh Simlock devices and lease recovery (callstack#3095)
  feat(capture): report the display rotation a screenshot was rendered in (callstack#3088)
  refactor(snapshot): preserve normalized node attributes through presentation (callstack#3092)
  refactor(help): colocate fold guidance and extract workflows (callstack#3093)
  ...

# Conflicts:
#	README.md
#	package.json
#	packages/kernel/src/snapshot.ts
#	src/__tests__/eager-closure-budgets.ts
#	src/cli/commands/connection-presentation.ts
#	src/commands/schema/cli-help.ts
#	src/commands/schema/command-overrides.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants