Skip to content

fix(mobile): define PODS_ROOT for ShareExtension so ccache wrapper resolves - #4857

Merged
iscekic merged 1 commit into
mainfrom
fix/mobile-eas-ccache-path
Jul 29, 2026
Merged

fix(mobile): define PODS_ROOT for ShareExtension so ccache wrapper resolves#4857
iscekic merged 1 commit into
mainfrom
fix/mobile-eas-ccache-path

Conversation

@iscekic

@iscekic iscekic commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the failing iOS build in kilo-app Release run 30430285185: unable to spawn process '/../../../../node_modules/.pnpm/react-native@0.86.0_.../node_modules/react-native/scripts/xcode/ccache-clang.sh' (No such file or directory) (in target 'ShareExtension' from project 'Kilo').

Root cause

  • ios.ccacheEnabled: true (app.config.ts) → react_native_post_install(:ccache_enabled => true) writes CC/CXX/LD/LDPLUSPLUS = $(REACT_NATIVE_PATH)/scripts/xcode/ccache-*.sh project-wide on Kilo.xcodeproj when ccache exists on the builder.
  • REACT_NATIVE_PATH is ${PODS_ROOT}/../../../.., and CocoaPods only defines PODS_ROOT for pod-integrated targets.
  • The ShareExtension target (created by expo-share-intent, no Podfile integration) has no Pods xcconfig → PODS_ROOT empty → CC expands to /../../../../node_modules/... → spawn fails.
  • The main Kilo target gets PODS_ROOT from its Pods xcconfig, which is why only the extension failed.
  • Repo inputs were identical to yesterday's green build; the EAS default iOS image gained ccache, which activated this latent breakage.

Fix

Define PODS_ROOT = $(SRCROOT)/Pods on the ShareExtension target build configs — exactly what CocoaPods would set if the target were pod-integrated — in the existing local plugin wrapper apps/mobile/plugins/withExpoShareIntent.js. One build setting; ccache keeps working everywhere.

Gotchas handled: withXcodeProject mods run in reverse registration order (ours registers before upstream so it runs after target creation); the stored target name is quoted with no comment entry (raw-name match with quote tolerance); the value is written quoted because ( and ) are array delimiters in pbxproj syntax.

Verification

Reproduced and fixed locally (macOS + ccache + CocoaPods, same as EAS builders):

  • Before: xcodebuild -showBuildSettings -target ShareExtension showed CC = /../../../../node_modules/.pnpm/... — byte-identical to the EAS error.
  • After: CC/LD/CXX/LDPLUSPLUS resolve to the real node_modules/.pnpm/react-native@0.86.0_.../scripts/xcode/ccache-*.sh (verified the file exists and is executable).
  • End to end: xcodebuild -scheme ShareExtension build spawns ccache-clang.sh (as the link driver) and produces ShareExtension.appex successfully. (Residual failures in that isolated invocation are the host app target's pod module maps, an artifact of building the extension scheme without building pods first — not related.)
  • pnpm format && pnpm typecheck && pnpm lint && pnpm check:unused (apps/mobile) + root pnpm format + git diff --check all clean.

EAS re-verification happens automatically on merge — the release job is gated to refs/heads/main, so it can't be exercised from this branch.

…solves

react_native_post_install sets CC/CXX/LD/LDPLUSPLUS project-wide to
$(REACT_NATIVE_PATH)/scripts/xcode/ccache-*.sh when ccache exists on the
builder (EAS images ship it) and apple.ccacheEnabled is set.
REACT_NATIVE_PATH expands through ${PODS_ROOT}, which CocoaPods only
defines for pod-integrated targets. ShareExtension links no pods, so
PODS_ROOT expanded empty, CC became /../../../../node_modules/... and
the EAS iOS build died with "unable to spawn process".

Define PODS_ROOT=$(SRCROOT)/Pods on the extension target the way
CocoaPods would, so the inherited compiler wrapper path resolves.
@iscekic iscekic self-assigned this Jul 29, 2026
@kilo-code-bot

kilo-code-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the single-file Xcode project mod that sets PODS_ROOT on the ShareExtension target; the logic (target lookup, quoting, mod-registration order, and error handling for missing target/config) is sound and I found no high-confidence bugs or security issues in the changed lines.

Files Reviewed (1 files)
  • apps/mobile/plugins/withExpoShareIntent.js

Reviewed by claude-sonnet-5 · Input: 16 · Output: 4K · Cached: 310.8K

Review guidance: REVIEW.md from base branch main

@iscekic
iscekic requested a review from jeanduplessis July 29, 2026 12:16
@iscekic
iscekic enabled auto-merge (squash) July 29, 2026 12:19
@iscekic
iscekic merged commit c1f31cc into main Jul 29, 2026
21 checks passed
@iscekic
iscekic deleted the fix/mobile-eas-ccache-path branch July 29, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants