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: "Time.h:52:17: error: typedef redefinition with different types" when a folder in the file path has a space #34510

Conversation

gaberogan
Copy link
Contributor

@gaberogan gaberogan commented Aug 26, 2022

Summary

The sed workaround here in __apply_Xcode_12_5_M1_post_install_workaround:
https://github.com/facebook/react-native/blob/main/scripts/react_native_pods.rb#L293-L298
does not work when the react native project has a parent folder with a space in the the name, for example:
/Users/myuser/Some Folder/my-project/ios/Pods/RCT-Folly/folly/portability/Time.h
This is because the sed command thinks that the part after the space is a separate argument.
This bug caused one of our engineers to not be able to run our React Native project through no fault of his own, so I would like to propose this change to help other engineers avoid this in the future.

Changelog

Add single quotes around the file parameter in the sed command

[iOS] [Fixed] - Fixed Time.h:52:17: error when a folder in the file path has a space

Test Plan

Checkout the main branch.
Create a React Native project in a folder that has a space in the name.
When you run pod install, you should notice a sed error indicating that the text replacement failed.
Run the build to reproduce the Time.h:52:17: error.
Checkout this branch.
Run pod install and notice the sed error is gone.
Run the build, the error should be gone.

@facebook-github-bot
Copy link
Contributor

Hi @gaberogan!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@gaberogan gaberogan changed the title Fix "Time.h:52:17: error: typedef redefinition with different types" when the project folder name has a space fix: "Time.h:52:17: error: typedef redefinition with different types" when the project folder name has a space Aug 26, 2022
@gaberogan gaberogan changed the title fix: "Time.h:52:17: error: typedef redefinition with different types" when the project folder name has a space fix: "Time.h:52:17: error: typedef redefinition with different types" when a folder in the file path has a space Aug 26, 2022
@react-native-bot react-native-bot added Bug Platform: iOS iOS applications. labels Aug 26, 2022
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,617,912 +0
android hermes armeabi-v7a 7,032,163 +0
android hermes x86 7,917,973 +0
android hermes x86_64 7,891,590 +0
android jsc arm64-v8a 9,495,694 +0
android jsc armeabi-v7a 8,273,317 +0
android jsc x86 9,433,479 +0
android jsc x86_64 10,026,464 +0

Base commit: 2452c5f
Branch: main

@analysis-bot
Copy link

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

Base commit: 9ac437f
Branch: main

@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 Aug 26, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 26, 2022
@facebook-github-bot
Copy link
Contributor

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

@cipolleschi
Copy link
Contributor

Thanks @gaberogan for submitting the fix.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @gaberogan in 9e169da.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 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. Platform: iOS iOS applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants