fix: "Time.h:52:17: error: typedef redefinition with different types" when a folder in the file path has a space #34510
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
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 ased
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 thesed
error is gone.Run the build, the error should be gone.