-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Use relative installation root instead of absolute to avoid embedding absolute paths in pods project #33187
Conversation
… absolute paths in pods project Also removes a leading space from each path
Base commit: a0511a1 |
Base commit: a0511a1 |
This seems to fail because of a cyclic dependency between rntester and codegen. I don't really know if this is related and/or how to fix this. |
I think the best reviewer here is @dmitryrykun as he was looking into relative path support for iOS inside our cocoapods setup 👍 |
@dmitryrykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@danilobuerger Just a heads up that @dmitryrykun is off this week so this will take a bit longer 👍 |
@danilobuerger these changes break the build of RNTester (and potentially any project with turbo modules). I'll take look into what's going on there, but it may take a while. Any help is appreciated. |
@dmitryrykun It looks like a real cyclic dependency in Xcode to me: Target "ScreenshotManager" depends on Target "React" depends on Target "React-RCTAnimation" depends on Target "React-Codegen". Task "React-Codegen" has a Build Phase "Compile Sources" with an Input file:
This Input file is listed as an Output file in "ScreenshotManager" Build Phase "[CP-User] Generate Specs". This PR fixed the paths so that Xcode saw the dependency cycle. |
@dmitryrykun Changing ScreenshotManagers dependency from React to React-Core seems to successfully build. However, I am unsure if this is correct? |
I remember a while back there was a massive change from dependency React => React-Core in third party libraries. I found #29633 (comment) maybe the ScreenshotManager was just forgotten? |
This resolves a cyclic dependency between generating the spec and codegen using it and something relying on codegen transitively via the React dependency See facebook#29633 (comment) for an explanation
This is advised by apple: Dependency Order Build targets in parallel according to their dependencies. Choose this option, not Manual Order. Manual Order Build targets serially in the order listed in the scheme, underutilizing your Mac’s multiple processors. This option is deprecated. Don’t use it. See https://developer.apple.com/documentation/xcode/customizing-the-build-schemes-for-a-project?changes=latest_minor
@dmitryrykun all checks are green now. Hopefully this is the right approach. It would be nice to get this into 0.68 so that we don't have hardcoded absolute paths in a lot of projects that could potentially break and lead to hard to debug issues. |
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.
Great job, thank you for getting it done!
@dmitryrykun 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 @danilobuerger in 42b01a3. When will my fix make it into a release? | Upcoming Releases |
… absolute paths in pods project (#33187) Summary: Use relative installation root instead of absolute to avoid embedding absolute paths in pods project Also removes a leading space from each path. Before: <img width="799" alt="155846827-94c474b7-8a79-45fc-a900-8860a94fb318" src="https://user-images.githubusercontent.com/996231/155847731-de128759-bff5-4d1f-a59a-377298055d85.png"> After: <img width="745" alt="Screenshot 2022-02-26 at 15 58 32" src="https://user-images.githubusercontent.com/996231/155847739-b783debc-a805-4ce7-a88a-33f764dc5985.png"> ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [iOS] [Fixed] - Remove absolute paths from pods project Pull Request resolved: #33187 Test Plan: Pod install and view in Xcode FBReactNativeSpec -> Build Phases -> [CP-User] Generate Specs Reviewed By: ShikaSD Differential Revision: D34549541 Pulled By: dmitryrykun fbshipit-source-id: 2926b093fb87f50ef9988e23fce593348f00077d
… absolute paths in pods project (facebook#33187) Summary: Use relative installation root instead of absolute to avoid embedding absolute paths in pods project Also removes a leading space from each path. Before: <img width="799" alt="155846827-94c474b7-8a79-45fc-a900-8860a94fb318" src="https://user-images.githubusercontent.com/996231/155847731-de128759-bff5-4d1f-a59a-377298055d85.png"> After: <img width="745" alt="Screenshot 2022-02-26 at 15 58 32" src="https://user-images.githubusercontent.com/996231/155847739-b783debc-a805-4ce7-a88a-33f764dc5985.png"> ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [iOS] [Fixed] - Remove absolute paths from pods project Pull Request resolved: facebook#33187 Test Plan: Pod install and view in Xcode FBReactNativeSpec -> Build Phases -> [CP-User] Generate Specs Reviewed By: ShikaSD Differential Revision: D34549541 Pulled By: dmitryrykun fbshipit-source-id: 2926b093fb87f50ef9988e23fce593348f00077d
Summary
Use relative installation root instead of absolute to avoid embedding absolute paths in pods project
Also removes a leading space from each path.
Before:
After:
Changelog
[iOS] [Fixed] - Remove absolute paths from pods project
Test Plan
Pod install and view in Xcode FBReactNativeSpec -> Build Phases -> [CP-User] Generate Specs