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

[visionOS] Add local podspecs to override supported platforms #2047

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

Saadnajmi
Copy link
Collaborator

@Saadnajmi Saadnajmi commented Jan 20, 2024

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary:

This PR is part of a series of PRs for adding support for visionOS to the repository. See #2019 .

The way cocoapods works, the platforms a pod targets must be specified in its' pod spec, otherwise the generated Xcodeproj target won't output that platform's static library. AKA, if Pod A targets {:iOS => 13.4, :osx => 10.15}, then targets that output libA-iOS.a and libA-macOS.a will be generated, but not targets that output libA-visionOS.a. For most pod dependencies of react native, we set the platforms using min_supported_versions helper method, which we can override to return as many platforms as we want. However, there are a few pods where we don't control the podspec because we're getting it from the cocoapods registry. Without updating the pod in its own repo, we wouldn't be able to override the platforms, even if we're perfectly able to compile for said platform. In our case, that would be:

  • main:
    • SocketRocket
  • 0.73 and 0.72:
    • SocketRocket
    • fmt

Rather than wait for those repos to update (SocketRocket has been taking a while), we can instead make local podspecs, stick in the folder third_party_podspecs, and reference them in our ruby methods. Let's do that.

We don't need to add fmt.podspec for main because facebook@bb9ed0e already did so. For the back ports to 0.73-stable and 0.72-stable, I will cherry-pick that change with the caveat it is newer than the version of fmt used on those branches before. I tried to downgrade to 6.2.1... but then it failed to build. This is a library for formatting print statements and iostream, which should be relatively safe to upgrade.

Changelog:

[IOS] [CHANGED] - Add local podspecs to override supported platforms

Test Plan:

CI should pass.

@Saadnajmi Saadnajmi merged commit 740732e into microsoft:main Jan 23, 2024
17 checks passed
@Saadnajmi Saadnajmi deleted the local-podspecs branch January 23, 2024 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants