Skip to content

Commit

Permalink
fix(ios): fix Time.h patch not being applied (#32961)
Browse files Browse the repository at this point in the history
Summary:
The path to `Time.h` is currently hard-coded and does not take into
consideration the `--project-directory` flag when running `pod install`.

## Changelog

[iOS] [Fixed] - Fix `Time.h` patch not being applied when running `pod install --project-directory=ios`

Pull Request resolved: #32961

Test Plan:
```
git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version main
yarn
cd example
pod install --project-directory=ios
../scripts/xcodebuild.sh ios/Example.xcworkspace build
```

Reviewed By: christophpurrer

Differential Revision: D33748789

Pulled By: lunaleaps

fbshipit-source-id: b125734eba30e552ae139e7ecd4e634c8fa1bcd7
  • Loading branch information
tido64 authored and facebook-github-bot committed Jan 24, 2022
1 parent c48e5ac commit 60cef85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -646,5 +646,6 @@ def __apply_Xcode_12_5_M1_post_install_workaround(installer)
# "Time.h:52:17: error: typedef redefinition with different types"
# We need to make a patch to RCT-Folly - remove the `__IPHONE_OS_VERSION_MIN_REQUIRED` check.
# See https://github.com/facebook/flipper/issues/834 for more details.
`sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' Pods/RCT-Folly/folly/portability/Time.h`
time_header = "#{Pod::Config.instance.installation_root.to_s}/Pods/RCT-Folly/folly/portability/Time.h"
`sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' #{time_header}`
end

0 comments on commit 60cef85

Please sign in to comment.