Skip to content

fix(mobile): build iOS from checkout paths with spaces - #37058

Merged
AmoabaKelvin merged 2 commits into
mainfrom
ios-build-path-spaces-36443
Nov 1, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
ios-build-path-spaces-36443

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​66 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​58

ELI5

If your Orca checkout sits in a folder whose name has a space (say AI Workspace/orca), the iOS app wouldn't build, or built without its app config and crashed on launch. Two Xcode build scripts used the folder path without quotes, so the space split it in two. This PR quotes those paths, the same way newer Expo releases do.

What Changed

  • mobile/patches/[email protected] (new pnpm patch, registered in mobile/pnpm-workspace.yaml, lockfile hash only): backports expo-constants 58's quoting to the "Generate app.config for prebuilt Constants.manifest" phase. The podspec passed $PODS_TARGET_SRCROOT/../scripts/get-app-config-ios.sh (and PROJECT_ROOT) unquoted through bash -l -c, so the build died with bash: /tmp/orca: No such file or directory. The script also ran basename $PROJECT_DIR unquoted, which returns the first word instead of Pods, so it exited 0 without writing EXConstants.bundle/app.config. That's the launch crash in the report.
  • mobile/plugins/ios-bundle-phase-quoted-script-path.js (new config plugin, wired in mobile/app.json): Expo SDK 55's project template runs react-native-xcode.sh from the "Bundle React Native code and images" phase through an unquoted backtick substitution, so the JS bundling step split the path too. The plugin wraps that call in double quotes, matching Expo's SDK 58 template.

Before: a Release simulator build from /tmp/orca space 36443/orca/mobile failed at the EXConstants phase. With the expo-constants patch alone, it got past that and failed at the bundle phase. After: it builds, Orca.app/EXConstants.bundle/app.config is present, and the app launches. Paths without spaces build and launch the same as before.

Why

Each quoting fix sits where its script lives. The expo-constants script and podspec come from the package, so a pnpm patch is the only place to change them, and the repo already patches Expo packages this way. The bundle phase comes from expo/template.tgz, which a package patch can't reach cleanly (it's a tarball), so it goes in a config plugin next to our other iOS prebuild plugins. Both changes are exactly what upstream later shipped (expo-constants 58.0.x and the SDK 58 template), so they turn into no-ops or get dropped when we move to SDK 58.

#36444 only fixes the basename line through a plugin that rewrites the script in node_modules at prebuild time. On this machine a build from a path with a space still fails at the podspec's bash -l -c phase and then at the bundle phase, so that change on its own doesn't get the app to build.

Linked Issue

Fixes #36443

Visual Proof

Before (main, Release simulator build from /tmp/orca space 36443/orca/mobile):

PhaseScriptExecution [CP-User]\ Generate\ app.config\ for\ prebuilt\ Constants.manifest ...
bash: /tmp/orca: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **

After (same path, this branch, fresh install on an iOS 27 simulator):

(screenshot removed: contained real product data)

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

On macOS with Xcode 27 and the iOS 27 simulator, I ran expo prebuild --clean, pod install and a Release xcodebuild for the iOS simulator in each case:

  • From /tmp/orca space 36443/orca on main: fails at the EXConstants app.config phase.
  • Same path with the patch only: fails at "Bundle React Native code and images" (/private/tmp/orca: No such file or directory).
  • Same path with both changes: BUILD SUCCEEDED, EXConstants.bundle/app.config present, fresh install launches to the pairing screen.
  • From this worktree (no spaces) with both changes: BUILD SUCCEEDED, app.config present, launches.
  • A prebuild with and without the plugin differs only in the bundle phase's shellScript line, apart from the random UUIDs prebuild generates on every run.
  • pnpm install --frozen-lockfile succeeds on the updated lockfile. The changed-file quality gate passes.

No automated test: the fix lives in vendored build scripts and a generated Xcode project, and PR CI doesn't build iOS. A unit test of the string replace wouldn't prove the build works; the real builds above do.

AI Disclosure

Review

Codex and a Claude reviewer both returned no findings. They compared the patch to expo-constants 58.0.14, matched the plugin against the SDK 55 and SDK 58 templates, checked that re-running prebuild is safe, and ran shell word-splitting checks on paths with no space, one space and two spaces.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • iOS build only. Android, desktop, SSH and folder workspaces are untouched.
  • The patch changes a native module's sources, so the iOS native fingerprint changes and the next mobile release needs a native build rather than an OTA update.
  • mobile/ios/ stays generated; nothing native is checked in.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…paces build

Backports the expo-constants 58 quoting of the app.config build phase
(podspec bash -l -c argument and basename $PROJECT_DIR) to 55.0.17.
Expo SDK 55's template leaves the command substitution unquoted, so the
Bundle React Native code and images phase splits a checkout path with a
space. Expo's SDK 58 template applies the same quoting.
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 85e9ff24-6625-4bdc-8a65-1197c9e9c2d5
Commits

Reviewing files that changed from the base of the PR and between 7e935c5 and 78f3107.

Files ignored due to path filters: 1
  • mobile/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 4
  • mobile/app.json
  • mobile/patches/[email protected]
  • mobile/plugins/ios-bundle-phase-quoted-script-path.js
  • mobile/pnpm-workspace.yaml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Walkthrough

The changes quote project paths in Expo Constants build scripts and add an Expo config plugin that quotes the script path in matching React Native bundle build phases. The app configuration registers the plugin, and the workspace applies the Expo Constants patch to version 55.0.17.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 78f31

No actionable merge-blocking risk remains identified for this change.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: fixing iOS builds when the checkout path contains spaces.
Description check Passed The description is complete and focused. It explains the problem, mechanism, rationale, linked issue, visual proof, testing, platform scope, native-build impact, and checklist status. The missing full…
Linked Issues check Passed [#36443] requires that iOS builds from checkout paths with spaces generate EXConstants.bundle/app.config and do not crash at launch. The core defect is the unquoted $PROJECT_DIR in basename inside scr…
Out of Scope Changes check Passed All changed files serve the iOS spaced-path build objective of #36443. mobile/patches/[email protected] fixes the EXConstants phase: basename quoting and the podspec bash -l -c quoting. mob…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Description check

Explanation

The description is complete and focused. It explains the problem, mechanism, rationale, linked issue, visual proof, testing, platform scope, native-build impact, and checklist status. The missing full-repository lint, typecheck, test, and build results are explicitly identified as not run or covered by CI.

Full details: Linked Issues check

Explanation

[#36443] requires that iOS builds from checkout paths with spaces generate EXConstants.bundle/app.config and do not crash at launch. The core defect is the unquoted $PROJECT_DIR in basename inside scripts/get-app-config-ios.sh. The PR adds mobile/patches/[email protected], registered in mobile/pnpm-workspace.yaml, which quotes PROJECT_DIR in basename. The patch also quotes PROJECT_ROOT and the script path in the podspec's bash -l -c call, which the author reports caused a separate failure on the same phase. The issue suggests a config plugin for this fix. The PR uses a pnpm patch instead. The issue's stated requirement is the outcome, not the mechanism, so this difference does not fail the requirement. The author reports a Release simulator build from a spaced path with both changes. The reported result is BUILD SUCCEEDED, app.config present, and a launch to the pairing screen. No automated test was added. The issue does not request one, and the author states that PR CI does not build iOS. The exact patch hunks were not inspected directly. The verdict relies on the change summary and the author's reported manual builds.

Full details: Out of Scope Changes check

Explanation

All changed files serve the iOS spaced-path build objective of #36443. mobile/patches/[email protected] fixes the EXConstants phase: basename quoting and the podspec bash -l -c quoting. mobile/pnpm-workspace.yaml registers that patch. mobile/plugins/ios-bundle-phase-quoted-script-path.js quotes the react-native-xcode.sh call in the 'Bundle React Native code and images' phase. The author reports that the patch alone still fails at that phase for a spaced path, so the plugin is required for the same build outcome. mobile/app.json wires the plugin into the Expo plugin list. The pr_objectives describe the bundle-phase fix as part of this PR. The lockfile change is excluded from review under ignored_files and is not assessed. No unrelated Android, desktop, SSH, or folder workspace changes appear in the change summary.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (3 skipped: 3 unsupported.)

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

[Bug]: iOS build from checkout path with spaces omits EXConstants.bundle/app.config and crashes at launch

1 participant