-
Notifications
You must be signed in to change notification settings - Fork 25k
[iOS][FIXED] fix the path of the script phase #45208
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
[iOS][FIXED] fix the path of the script phase #45208
Conversation
cipolleschi
left a comment
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.
Hi @imWildCat, thanks for taking a stab at this and to create reproducers.
Tampering with the scriptPhases is not a good solution, it feels more like a patch.
Let's see if we can find a better solutions first!
yeah, sure! please feel free to close this PR if a better solution comes |
|
You're super close to the solution. This line needs adjusting: iff --git a/packages/react-native/scripts/cocoapods/autolinking.rb b/packages/react-native/scripts/cocoapods/autolinking.rb
index fec826c541e..9508625fc4c 100644
--- a/packages/react-native/scripts/cocoapods/autolinking.rb
+++ b/packages/react-native/scripts/cocoapods/autolinking.rb
@@ -168,7 +168,7 @@ def link_native_modules!(config)
# Support passing in a path relative to the root of the package
if phase["path"]
- phase["script"] = File.read(File.expand_path(phase["path"], package["root"]))
+ phase["script"] = File.read(File.expand_path(phase["path"], package[:root]))
phase.delete("path")
endDo you want to update your diff? |
|
@blakef done. thank you so much! |
|
Update: I did some test runs on my repro repo This does not seem to work (https://github.com/imWildCat-archived/react-native-075-rc2-regression-ios-linking-script-phase/actions/runs/9700745283/job/26772863511): diff --git a/before.txt b/after.txt
index fec826c..9508625 100644
--- a/before.txt
+++ b/after.txt
@@ -168,7 +168,7 @@ def link_native_modules!(config)
# Support passing in a path relative to the root of the package
if phase["path"]
- phase["script"] = File.read(File.expand_path(phase["path"], package["root"]))
+ phase["script"] = File.read(File.expand_path(phase["path"], package[:root]))
phase.delete("path")
end |
|
Yup, I was testing the same. This works: if phase["path"]
- phase["script"] = File.read(File.expand_path(phase["path"], package[:root]))
+ phase["script"] = File.read(File.expand_path(phase["path"], package[:path]))
phase.delete("path")
end |
|
sorry for the back and forth |
|
no worries at all! thanks! test run (green) |
|
@blakef has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
This pull request was successfully merged by imWildCat in e320ab4. When will my fix make it into a release? | How to file a pick request? |
|
committed @ e320ab4 |
|
@imWildCat thank you so much for spotting this and more importantly the PR with fix 🎉 |
My pleasure! Thanks a lot to the maintainers for the suggestions and prompt review! |
Summary: Since 0.75-rc.x, I cannot run pod install because of an linking issue of react native firebase. reactwg/react-native-releases#341 (comment) ## Changelog: [IOS][FIXED] Auto linking script of script phase Pull Request resolved: #45208 Test Plan: Full demo of this fix: <https://github.com/imWildCat-archived/react-native-075-rc2-regression-ios-linking-script-phase> Reviewed By: christophpurrer Differential Revision: D59125585 Pulled By: blakef fbshipit-source-id: be96d3b207eff67c5e0d777203e7fc0d10103fc0
Summary: A previous attempt at fixing this issue used a relative path (#45208), this doesn't work if the user runs bundle install outside of the `ios/` folder, using the `--project-directory=ios` argument. ## Changelog: [iOS][Fixed] support bundle install from outside the ios folder using --project-directory Pull Request resolved: #46186 Test Plan: Ran the command in a project with `react-native-firebase/app` using the `--project-directory`, confirmed that it's fixed when using the absolute path. closes: reactwg/react-native-releases#341 Reviewed By: cipolleschi Differential Revision: D61719821 Pulled By: blakef fbshipit-source-id: d83429dd29c9e8cc066ab9843ad95fdfc0af8dea
Summary: A previous attempt at fixing this issue used a relative path (#45208), this doesn't work if the user runs bundle install outside of the `ios/` folder, using the `--project-directory=ios` argument. ## Changelog: [iOS][Fixed] support bundle install from outside the ios folder using --project-directory Pull Request resolved: #46186 Test Plan: Ran the command in a project with `react-native-firebase/app` using the `--project-directory`, confirmed that it's fixed when using the absolute path. closes: reactwg/react-native-releases#341 Reviewed By: cipolleschi Differential Revision: D61719821 Pulled By: blakef fbshipit-source-id: d83429dd29c9e8cc066ab9843ad95fdfc0af8dea
Summary:
Since 0.75-rc.x, I cannot run pod install because of an linking issue of react native firebase.
reactwg/react-native-releases#341 (comment)
Changelog:
[IOS][FIXED] Auto linking script of script phase
Test Plan:
Full demo of this fix: https://github.com/imWildCat-archived/react-native-075-rc2-regression-ios-linking-script-phase