Skip to content
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

Update Yoga.podspec: fixes archiving for Mac Catalyst #42847

Closed

Conversation

kesha-antonov
Copy link
Contributor

Hi

Summary:

When I tried to archive macos catalyst app in Xcode I got errors:

Screenshot 2024-02-05 at 00 03 32

This PR fixes archiving by linking PrivateHeaders in yoga.framework

Screenshot 2024-02-05 at 01 03 48 Screenshot 2024-02-05 at 01 05 18

Prev PR here #42159

Changelog:

[IOS] [FIXED] - fixed archiving for Mac Catalyst

Test Plan:

Try archive react-native tester app for macos catalyst in Xcode

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Feb 4, 2024
@cipolleschi
Copy link
Contributor

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:

  1. Try to apply a similar fix to yoga and archive again to verify that it works
    or
  2. Create a reproducer using this repo so I can try it myself and provide the right fix, please? 🙏

@kesha-antonov
Copy link
Contributor Author

kesha-antonov commented Feb 5, 2024

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:

  1. Try to apply a similar fix to yoga and archive again to verify that it works
    or
  2. 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:


On other levels it is private headers:
spec.private_header_files = Dir.glob(all_header_files) - Dir.glob(public_header_files)

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?

@kesha-antonov
Copy link
Contributor Author

kesha-antonov commented Feb 5, 2024

The difference that in repro app Search Paths are correct by default.

Screenshot 2024-02-05 at 13 30 43

When I add ENV['USE_FRAMEWORKS'] = 'static' to Podfile it changes to

Screenshot 2024-02-05 at 13 34 44

Then it starts to fail archiving. Even with proposed fix

Screenshot 2024-02-05 at 13 39 58

@kesha-antonov
Copy link
Contributor Author

@cipolleschi
Copy link
Contributor

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... :/

@cipolleschi
Copy link
Contributor

I think I found the actual issue... If we look at the step done for building:

Build for Release Archive
Screenshot 2024-02-19 at 14 57 22 Screenshot 2024-02-19 at 14 58 36

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.

@cipolleschi
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@kesha-antonov
Copy link
Contributor Author

I think I found the actual issue... If we look at the step done for building:

| Build for Release | Archive |

| --- | --- |

| Screenshot 2024-02-19 at 14 57 22 | Screenshot 2024-02-19 at 14 58 36 |

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

facebook-github-bot pushed a commit to facebook/yoga that referenced this pull request Feb 22, 2024
Summary:
Hi

When I tried to archive macos catalyst app in Xcode I got errors:

<img width="977" alt="Screenshot 2024-02-05 at 00 03 32" src="https://github.com/kesha-antonov/react-native/assets/11584712/b83f75a5-b42f-42e4-9afa-1e2527501baa">

This PR fixes archiving by linking PrivateHeaders in yoga.framework

<img width="399" alt="Screenshot 2024-02-05 at 01 03 48" src="https://github.com/kesha-antonov/react-native/assets/11584712/089080ad-b1dc-4703-9273-d8aa3253205e">

<img width="1404" alt="Screenshot 2024-02-05 at 01 05 18" src="https://github.com/kesha-antonov/react-native/assets/11584712/5263cb80-8a53-4a51-bcfc-9d3a2ba739b4">

Prev PR here facebook/react-native#42159

## Changelog:

[IOS] [FIXED] - fixed archiving for Mac Catalyst

X-link: facebook/react-native#42847

Reviewed By: NickGerleman

Differential Revision: D53920474

Pulled By: cipolleschi

fbshipit-source-id: 0534d9aa9d249e4e0c35ada0464c38c291be7f84
Copy link

This pull request was successfully merged by @kesha-antonov in 767330f.

When will my fix make it into a release? | Upcoming Releases

@github-actions github-actions bot added the Merged This PR has been merged. label Feb 22, 2024
NickGerleman pushed a commit to facebook/yoga that referenced this pull request Feb 23, 2024
Summary:
Hi

When I tried to archive macos catalyst app in Xcode I got errors:

<img width="977" alt="Screenshot 2024-02-05 at 00 03 32" src="https://github.com/kesha-antonov/react-native/assets/11584712/b83f75a5-b42f-42e4-9afa-1e2527501baa">

This PR fixes archiving by linking PrivateHeaders in yoga.framework

<img width="399" alt="Screenshot 2024-02-05 at 01 03 48" src="https://github.com/kesha-antonov/react-native/assets/11584712/089080ad-b1dc-4703-9273-d8aa3253205e">

<img width="1404" alt="Screenshot 2024-02-05 at 01 05 18" src="https://github.com/kesha-antonov/react-native/assets/11584712/5263cb80-8a53-4a51-bcfc-9d3a2ba739b4">

Prev PR here facebook/react-native#42159

## Changelog:

[IOS] [FIXED] - fixed archiving for Mac Catalyst

X-link: facebook/react-native#42847

Reviewed By: NickGerleman

Differential Revision: D53920474

Pulled By: cipolleschi

fbshipit-source-id: 0534d9aa9d249e4e0c35ada0464c38c291be7f84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants