Fix missing path escape patterns in Xcode scripts for projects with spaces - #53194
Closed
kitten wants to merge 2 commits into
Closed
Fix missing path escape patterns in Xcode scripts for projects with spaces#53194kitten wants to merge 2 commits into
kitten wants to merge 2 commits into
Conversation
Collaborator
|
3 tasks
cipolleschi
approved these changes
Aug 11, 2025
cipolleschi
left a comment
Contributor
There was a problem hiding this comment.
Thanks for fixing these
Contributor
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D79993537. |
Contributor
|
@cipolleschi merged this pull request in 94623ca. |
Collaborator
|
This pull request was successfully merged by @kitten in 94623ca When will my fix make it into a release? | How to file a pick request? |
react-native-bot
pushed a commit
that referenced
this pull request
Aug 27, 2025
…paces (#53194) Summary: When running a project in a path that contains any spaces, the scripts have several escape patterns that don't handle this path correctly. For example, `"/absolute/path/with spaces"` may be rendered as `/absolute/path/with spaces` and this shows as an output error such as `No such file or directory /absolute/path/with` This was likely a longstanding issue, but is unexpected for some beginners that first try out React Native. While it's not recommended to create a path like this, it's certainly not hard to make this mistake. ## Changelog: [IOS] [FIXED] - fix scripts for paths containing whitespaces Pull Request resolved: #53194 Test Plan: tested locally; create a React Native or Expo project in a folder containing a space (e.g. `/my/path/with spaces/new-app` and build the project. With changes applied, the build should succeed. (There's related failures in `expo/expo` that need fixing too) Reviewed By: robhogan Differential Revision: D79993537 Pulled By: cipolleschi fbshipit-source-id: b32697ce2405c403c410b3ceaed7e161e4a48537
Collaborator
|
This pull request was successfully merged by @kitten in 03952ba When will my fix make it into a release? | How to file a pick request? |
facebook-github-bot
pushed a commit
that referenced
this pull request
Sep 1, 2025
… need to be escaped (#53540) Summary: Follow-up to #53194 This wasn't previously visible in testing without prebuilds and without a release build. This doesn't show up in debug builds. When testing more against paths that contain spaces, I noticed that release builds can still run into trouble due to the use of `execSync` without escaping paths. While, in other scripts that aren't used in user-projects (afaict), we often escape with quotes and rely on `execSync` calling the shell (due to its `shell: true` default), in some scripts we don't have quote escapes. That said, since paths could in theory contain quotes, adding quotes wouldn't be sufficient. Instead, since the affected `tar` calls are really trivial, we can instead use `spawnSync` with the `shell: false` default, which escapes arguments automatically. ## Changelog: [IOS] [FIXED] - fix Node scripts related to prebuilt tarball extraction for paths containing whitespaces Pull Request resolved: #53540 Test Plan: - Create a project in a folder `with spaces` and build a release build Reviewed By: cipolleschi, cortinico Differential Revision: D81406841 Pulled By: robhogan fbshipit-source-id: 08bb06b2cd2b15dc17c2f95fab9024129deca6f3
vzaidman
pushed a commit
that referenced
this pull request
Sep 8, 2025
… need to be escaped (#53540) Summary: Follow-up to #53194 This wasn't previously visible in testing without prebuilds and without a release build. This doesn't show up in debug builds. When testing more against paths that contain spaces, I noticed that release builds can still run into trouble due to the use of `execSync` without escaping paths. While, in other scripts that aren't used in user-projects (afaict), we often escape with quotes and rely on `execSync` calling the shell (due to its `shell: true` default), in some scripts we don't have quote escapes. That said, since paths could in theory contain quotes, adding quotes wouldn't be sufficient. Instead, since the affected `tar` calls are really trivial, we can instead use `spawnSync` with the `shell: false` default, which escapes arguments automatically. ## Changelog: [IOS] [FIXED] - fix Node scripts related to prebuilt tarball extraction for paths containing whitespaces Pull Request resolved: #53540 Test Plan: - Create a project in a folder `with spaces` and build a release build Reviewed By: cipolleschi, cortinico Differential Revision: D81406841 Pulled By: robhogan fbshipit-source-id: 08bb06b2cd2b15dc17c2f95fab9024129deca6f3
react-native-bot
pushed a commit
that referenced
this pull request
Sep 9, 2025
… need to be escaped (#53540) Summary: Follow-up to #53194 This wasn't previously visible in testing without prebuilds and without a release build. This doesn't show up in debug builds. When testing more against paths that contain spaces, I noticed that release builds can still run into trouble due to the use of `execSync` without escaping paths. While, in other scripts that aren't used in user-projects (afaict), we often escape with quotes and rely on `execSync` calling the shell (due to its `shell: true` default), in some scripts we don't have quote escapes. That said, since paths could in theory contain quotes, adding quotes wouldn't be sufficient. Instead, since the affected `tar` calls are really trivial, we can instead use `spawnSync` with the `shell: false` default, which escapes arguments automatically. ## Changelog: [IOS] [FIXED] - fix Node scripts related to prebuilt tarball extraction for paths containing whitespaces Pull Request resolved: #53540 Test Plan: - Create a project in a folder `with spaces` and build a release build Reviewed By: cipolleschi, cortinico Differential Revision: D81406841 Pulled By: robhogan fbshipit-source-id: 08bb06b2cd2b15dc17c2f95fab9024129deca6f3
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
When running a project in a path that contains any spaces, the scripts have several escape patterns that don't handle this path correctly. For example,
"/absolute/path/with spaces"may be rendered as/absolute/path/with spacesand this shows as an output error such asNo such file or directory /absolute/path/withThis was likely a longstanding issue, but is unexpected for some beginners that first try out React Native. While it's not recommended to create a path like this, it's certainly not hard to make this mistake.
Changelog:
[IOS] [FIXED] - fix scripts for paths containing whitespaces
Test Plan:
tested locally; create a React Native or Expo project in a folder containing a space (e.g.
/my/path/with spaces/new-appand build the project. With changes applied, the build should succeed. (There's related failures inexpo/expothat need fixing too)