From cf43f9c24b3898c4a1f58a4dc2d8c7b3255e247f Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Wed, 22 Mar 2023 10:21:14 -0700 Subject: [PATCH] fix: update paths in React-rncore.podspec (#36571) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36571 Changelog: [Internal] The problem is related to the way we use `js_srcs_dir` & `output_dir` options, one requires just relative path from current ruby script, other requires relative path from iOS root project (where the Podfile located) output_dir was introduced in D43304641 resulted into the issue, described in https://discord.com/channels/514829729862516747/1087736932953509958 allow-large-files Reviewed By: cipolleschi Differential Revision: D44294112 fbshipit-source-id: 47fcf510e203d0880e1f92ab6ead09f4b79cb4dd --- .../ReactCommon/React-rncore.podspec | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactCommon/React-rncore.podspec b/packages/react-native/ReactCommon/React-rncore.podspec index 88ae8f51bcfbaa..a58fc56f2e0c4f 100644 --- a/packages/react-native/ReactCommon/React-rncore.podspec +++ b/packages/react-native/ReactCommon/React-rncore.podspec @@ -16,7 +16,15 @@ else source[:tag] = "v#{version}" end -react_native_path = ".." +# We are using two different paths for react native because of the way how js_srcs_dir and output_dir options are used +# output_dir option usage was introduced in https://github.com/facebook/react-native/pull/36210 +# React-rncore.podspec is the only podspec in the project that uses this option +# We should rethink this approach in T148704916 + +# Relative path to react native from iOS project root (e.g. /../node_modules/react-native) +react_native_dependency_path = ENV['REACT_NATIVE_PATH'] +# Relative path to react native from current podspec +react_native_sources_path = '..' Pod::Spec.new do |s| s.name = "React-rncore" @@ -33,10 +41,10 @@ Pod::Spec.new do |s| use_react_native_codegen!(s, { - :react_native_path => react_native_path, - :js_srcs_dir => "#{react_native_path}/Libraries", + :react_native_path => react_native_sources_path, + :js_srcs_dir => "#{react_native_sources_path}/Libraries", :library_name => "rncore", :library_type => "components", - :output_dir => "#{react_native_path}/react-native/ReactCommon" + :output_dir => "#{react_native_dependency_path}/ReactCommon" }) end