Skip to content
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

fix: codegen - project paths with spaces #31141

Closed
wants to merge 3 commits into from

Conversation

mysport12
Copy link
Contributor

  • Fixed iOS codegen script incorrectly splitting root project paths that contain spaces

Summary

react-native-community/releases#214 (comment)

iOS builds were failing on 0.64.0-rc.4 for projects that contained spaces in the root directory path. The error logs pointed to the codegen script not being able to find a directory. The path was being split at a space in one of the folder names. This PR modifies the codegen script to include the spaces and use the entire project root path.

Changelog

fix: codegen script failing for iOS builds on projects with spaces in root directory path

Test Plan

Failing Test: Upgrade or init a new project and make sure that the project root directory contains a space (ex: /Users/test/cool projects/app/). With a clean install of node_modules and pods, attempt to build the project with Xcode. The build fails with an error running the script in FBReactNativeSpec (no such file or directory).

Passing Test: Include the changes presented in this PR and rerun the failing test (clean node_modules + PR patch/clean pods). The app should build.

- Fixed iOS codegen script incorrectly splitting root project paths that contain spaces
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 12, 2021
@kelset kelset requested a review from hramos March 15, 2021 15:45
@mlazari
Copy link
Contributor

mlazari commented Mar 17, 2021

I think ideally there shouldn't be any absolute paths if possible, as it makes Podfile.lock change depending on the path where the project is. See #31121

@mlazari
Copy link
Contributor

mlazari commented Mar 19, 2021

I didn't try it, but I think this PR might fix both issues: #31195

@rrrasti
Copy link

rrrasti commented Mar 19, 2021

This PR might fix #31181 and #31198.

@facebook-github-bot
Copy link
Contributor

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@pull-bot
Copy link

pull-bot commented May 6, 2021

Messages
📖

📋 Verify Changelog Format - A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

CATEGORY may be:
  • General
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Generated by 🚫 dangerJS against aea49c9

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 438a4cf

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,986,617 +0
android hermes armeabi-v7a 8,493,859 +0
android hermes x86 9,438,889 +0
android hermes x86_64 9,380,654 +0
android jsc arm64-v8a 10,605,031 +0
android jsc armeabi-v7a 10,105,321 +0
android jsc x86 10,624,040 +0
android jsc x86_64 11,207,709 +0

Base commit: 438a4cf

@facebook-github-bot
Copy link
Contributor

@hramos merged this pull request in b2e2f43.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label May 6, 2021
kelset pushed a commit that referenced this pull request Aug 11, 2021
Summary:
- Fixed iOS codegen script incorrectly splitting root project paths that contain spaces
react-native-community/releases#214 (comment)

iOS builds were failing on 0.64.0-rc.4 for projects that contained spaces in the root directory path. The error logs pointed to the codegen script not being able to find a directory. The path was being split at a space in one of the folder names. This PR modifies the codegen script to include the spaces and use the entire project root path.

## Changelog

[Internal] fix: codegen script failing for iOS builds on projects with spaces in root directory path

Pull Request resolved: #31141

Test Plan:
Failing Test: Upgrade or init a new project and make sure that the project root directory contains a space (ex: /Users/test/cool projects/app/). With a clean install of node_modules and pods, attempt to build the project with Xcode. The build fails with an error running the script in FBReactNativeSpec (no such file or directory).

Passing Test: Include the changes presented in this PR and rerun the failing test (clean node_modules + PR patch/clean pods). The app should build.

Reviewed By: mdvacca

Differential Revision: D28255539

Pulled By: hramos

fbshipit-source-id: d44011985750639bd2fabfd40ed645d4eb661bd7
@rb185264
Copy link

This issue is still happening on 0.69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants