react-native
react-native copied to clipboard
Update Yoga.podspec: fixes archiving for Mac Catalyst
Hi
Summary:
When I tried to archive macos catalyst app in Xcode I got errors:
This PR fixes archiving by linking PrivateHeaders in yoga.framework
Prev PR here https://github.com/facebook/react-native/pull/42159
Changelog:
[IOS] [FIXED] - fixed archiving for Mac Catalyst
Test Plan:
Try archive react-native tester app for macos catalyst in Xcode
Hi @kesha-antonov, thanks for opening the issue. Setting the Header search paths for Yoga fixes the issue but it is not the right fix. The problem with Catalyst is that it stores the headers in the wrong folder when archiving for Mac Catalyst. The right fix is to set the right folder for the Public haders, similarly to what we did for Fabric.
Could you either:
- Try to apply a similar fix to yoga and archive again to verify that it works or
- Create a reproducer using this repo so I can try it myself and provide the right fix, please? 🙏
Hi @kesha-antonov, thanks for opening the issue. Setting the Header search paths for Yoga fixes the issue but it is not the right fix. The problem with Catalyst is that it stores the headers in the wrong folder when archiving for Mac Catalyst. The right fix is to set the right folder for the Public haders, similarly to what we did for Fabric.
Could you either:
- Try to apply a similar fix to yoga and archive again to verify that it works or
- Create a reproducer using this repo so I can try it myself and provide the right fix, please? 🙏
Hi,
yeah, I tried what you propose but it doesn't work unfortunately I'll make reproduction
Also I don't think that problem in Public Headers since XCode shows error that it can't import files that are located as Private Headers
We make headers as public for root directory: https://github.com/facebook/react-native/blob/1c5877ae5d24b06c8ceb1afb52c978bc79e079d0/packages/react-native/ReactCommon/yoga/Yoga.podspec#L57 On other levels it is private headers: https://github.com/facebook/react-native/blob/1c5877ae5d24b06c8ceb1afb52c978bc79e079d0/packages/react-native/ReactCommon/yoga/Yoga.podspec#L64
So for what you propose to work we need to write public_header_files = 'yoga/**/*.h'
Or make Private Headers visible as I proposed
What do you think?
The difference that in repro app Search Paths are correct by default.
When I add ENV['USE_FRAMEWORKS'] = 'static' to Podfile it changes to
Then it starts to fail archiving. Even with proposed fix
@cipolleschi I've made the repro here: https://github.com/kesha-antonov/react-native-mac_catalyst_archiving_issue_05_02_2024
Hi @kesha-antonov, thanks for spending the time on this and sorry for the late reply. I'm investigating the issue using your reproducer (thank you again for preparing it, it is super helpful).
You are right in saying that the problem is with Private headers rather than public ones.
I'm so confused because building for Release works properly but Archive fails... and AFAIK, the archive command will first build for release and the create the package... so, it is very unclear and weird that one works and the other doesn't... :/
I think I found the actual issue... If we look at the step done for building:
| Build for Release | Archive |
|---|---|
Basically, Archive does not create a folder for PrivateHeaders and does not symlink it, but I could not find how to specify that not with Xcode and not with Cocoapods.
I think this could be a bug in Xcode or in Cocoapods, to be honest.
As a workaround, while we investigate this issue, I think we can move forward with this fix (I verified too that it works). I hope we could fix this properly (or that Cocoapods/Apple) will fix it for us
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
I think I found the actual issue... If we look at the step done for building:
| Build for Release | Archive |
| --- | --- |
|
|
|
Basically, Archive does not create a folder for PrivateHeaders and does not symlink it, but I could not find how to specify that not with Xcode and not with Cocoapods.
I think this could be a bug in Xcode or in Cocoapods, to be honest.
Thanks for the explanation. Didn't look at the logs there
I hope that Apple will fix it if it's Xcode's issue
This pull request was successfully merged by @kesha-antonov in 767330f21885e668bc0d9b5b3063113d0446bcbc.
When will my fix make it into a release? | Upcoming Releases