-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Fix missing path escape patterns in Xcode scripts for projects with spaces #53194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing these
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D79993537. |
@cipolleschi merged this pull request in 94623ca. |
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? |
…paces (facebook#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: facebook#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
…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
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? |
… 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
… 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
… 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
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 asNo 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
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 inexpo/expo
that need fixing too)