Repository navigation
fix(mobile): build iOS from checkout paths with spaces - #37058
Conversation
…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.
|
No actionable comments were generated in the recent review.
|
| Check name | Status | Explanation |
|---|---|---|
| Title check | The title clearly and concisely describes the main change: fixing iOS builds when the checkout path contains spaces. | |
| Description check | 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 | [#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 | 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 | 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.
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 inmobile/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(andPROJECT_ROOT) unquoted throughbash -l -c, so the build died withbash: /tmp/orca: No such file or directory. The script also ranbasename $PROJECT_DIRunquoted, which returns the first word instead ofPods, so it exited 0 without writingEXConstants.bundle/app.config. That's the launch crash in the report.mobile/plugins/ios-bundle-phase-quoted-script-path.js(new config plugin, wired inmobile/app.json): Expo SDK 55's project template runsreact-native-xcode.shfrom 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/mobilefailed 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.configis 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
basenameline through a plugin that rewrites the script innode_modulesat prebuild time. On this machine a build from a path with a space still fails at the podspec'sbash -l -cphase 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):After (same path, this branch, fresh install on an iOS 27 simulator):
(screenshot removed: contained real product data)
Testing
On macOS with Xcode 27 and the iOS 27 simulator, I ran
expo prebuild --clean,pod installand a Releasexcodebuildfor the iOS simulator in each case:/tmp/orca space 36443/orcaon main: fails at the EXConstants app.config phase./private/tmp/orca: No such file or directory).BUILD SUCCEEDED,EXConstants.bundle/app.configpresent, fresh install launches to the pairing screen.BUILD SUCCEEDED,app.configpresent, launches.shellScriptline, apart from the random UUIDs prebuild generates on every run.pnpm install --frozen-lockfilesucceeds 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
Notes
mobile/ios/stays generated; nothing native is checked in.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)