-
Notifications
You must be signed in to change notification settings - Fork 58
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
Workaround RNReanimated pod install
failure
#5908
Workaround RNReanimated pod install
failure
#5908
Conversation
The issue is due to RNReanimated looking for react-native in the node_modules relative to its location, which is how most projects would be setup. Unfortunately, our projects is not standard. When running `pod install` or `pod update`, we'd get: ``` Installing RNReanimated 2.17.0 (was 2.9.1-wp-4) internal/modules/cjs/loader.js:934 throw err; ^ Error: Cannot find module 'react-native/package.json' Require stack: - /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/[eval] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15) at Function.resolve (internal/modules/cjs/helpers.js:113:19) at [eval]:1:9 at Script.runInThisContext (vm.js:134:12) at Object.runInThisContext (vm.js:310:38) at internal/process/execution.js:81:19 at [eval]-wrapper:6:22 at evalScript (internal/process/execution.js:80:60) at internal/main/eval_string.js:27:3 { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/[eval]' ] } [!] Invalid `RNReanimated.podspec` file: no implicit conversion of nil into String. # from /var/folders/dq/cdqxvx3s5ps75564rpmb_dc00000gn/T/d20230627-89428-abwplk/RNReanimated.podspec:5 # ------------------------------------------- # reanimated_package_json = JSON.parse(File.read(File.join(__dir__, "package.json"))) > config = find_config() # assert_no_multiple_instances(config) # ------------------------------------------- ```
Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job! |
This reverts commit ccfd998.
Using only our custom specs, the build failed with ``` Multiple commands produce '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/CallbackWrapper.h' - Target 'ReactCommon' (project 'Pods') has copy command from '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/ReactCommon/react/bridging/CallbackWrapper.h' to '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/CallbackWrapper.h' - Target 'ReactCommon' (project 'Pods') has copy command from '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/ReactCommon/react/nativemodule/core/ReactCommon/CallbackWrapper.h' to '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/CallbackWrapper.h' ``` However, with this setup the build fails with: ``` /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/../../gutenberg/node_modules/react-native/React/FBReactNativeSpec/../../scripts/xcode/with-environment.sh: line 35: .xcode.env: command not found /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/../../gutenberg/node_modules/react-native/React/FBReactNativeSpec/../../scripts/xcode/with-environment.sh: line 35: node: command not found [Warning] You need to configure your node path in the environment. You can set it up quickly by running: echo 'export NODE_BINARY=' > .xcode.env in the ios folder. This is needed by React Native to work correctly. We fallback to the DEPRECATED behavior of finding . This will be REMOVED in a future version. You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/../../gutenberg/node_modules/react-native/React/FBReactNativeSpec/../../scripts/xcode/with-environment.sh: line 41: /scripts/find-node-for-xcode.sh: No such file or directory [Error] Could not find node. It looks like that the .xcode.env or .xcode.env.local ```
This way, users can override what CocoaPods does without modifying the codebase via the `.local` file.
# This should already be set by the Podfile and seems to work locally, but somethog does not work in CI. | ||
# See https://buildkite.com/automattic/gutenberg-mobile/builds/6327#0188fad1-932d-4a37-9d84-811937d8af18/435-455 | ||
export REACT_NATIVE_NODE_MODULES_DIR="$PWD/../gutenberg/node_modules" | ||
echo "+++ :bug: RN location" | ||
echo "$REACT_NATIVE_NODE_MODULES_DIR" | ||
|
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.
I think this can be removed now. Most likely, the problem in CI was that we didn't have the node_modules
Otherwise, we're getting a compilation failure. See wordpress-mobile/WordPress-iOS@eadad98#commitcomment-119894859
Hermes is the new JavaScript engine in React Native which comes enabled in the version we upgraded to, 0.71. See https://reactnative.dev/docs/hermes Notice the hack in the `Podfile` from facebook/react-native#35863
b77ceee
to
f1fde4c
Compare
Closing in favor of #5912, which implements all of this changes and support toggling the Hermes engine. |
Closed in favor of #5912, which implements all of this changes and support toggling the Hermes engine.
Points RNReanimated to a custom branch to work around 2.17.0 issue
The issue is due to RNReanimated looking for react-native in the
node_modules
relative to its location, which is how most projects would be setup. Unfortunately, our projects is not standard.When running
pod install
orpod update
, we'd get: