Skip to content

Commit 9f686f2

Browse files
kittenmeta-codesync[bot]
authored andcommitted
Fix regression stopping --project-directory from working (#55204)
Summary: This is a fix for a regression in #54948 found by Kudo. Passing an absolute path for `react_native_path` was non-functional before and the change was meant to fix this. This however used `Pathname.pwd.join(path)` since I assumed that'd be the intention for a relative path. However, my assumption was that `pod install` would only ever be run in the installation root and hence be equivalent to `Pod::Config.instance.installation_root` most of the time. This broke: `pod install --project-directory ios` (and the likes), since I wasn't aware of the `--project-directory` argument before. To fix this, we should construct the absolute path and join from `Pod::Config.instance.installation_root` as well. **Note to self:** Needs a pick into `0.84.0` due to being a regression (will file a pick request after this is merged) ## Changelog: [IOS] [FIXED] Regression from #54948 preventing `pod install --project-directory` from working properly Pull Request resolved: #55204 Test Plan: - Run `pod install` in `rn-tester` to validate Reviewed By: vzaidman Differential Revision: D90870064 Pulled By: cipolleschi fbshipit-source-id: 4a7bc0320afda29373791f206b31e57ae48b0b8c
1 parent 2e9b7fb commit 9f686f2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/react-native/scripts/react_native_pods.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def use_react_native! (
7575
error_if_try_to_use_jsc_from_core()
7676
warn_if_new_arch_disabled()
7777

78-
react_native_path = Pathname.pwd.join(path)
78+
react_native_path = Pod::Config.instance.installation_root.join(path)
7979
prefix = react_native_path.relative_path_from(Pod::Config.instance.installation_root)
8080

8181
hermes_enabled= true
@@ -106,7 +106,7 @@ def use_react_native! (
106106
# that has invoked the `use_react_native!` function.
107107
ReactNativePodsUtils.detect_use_frameworks(current_target_definition)
108108

109-
CodegenUtils.clean_up_build_folder(path, $CODEGEN_OUTPUT_DIR)
109+
CodegenUtils.clean_up_build_folder(react_native_path, $CODEGEN_OUTPUT_DIR)
110110

111111
# We are relying on this flag also in third parties libraries to proper install dependencies.
112112
# Better to rely and enable this environment flag if the new architecture is turned on using flags.

0 commit comments

Comments
 (0)