-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Xcode 12.5+ build of iPhone Simulator on Apple M1 (#32284)
Summary: Since Apple released its own silicon M1, an ARM64, the react-native build is broken or at least not as effective as it should. This PR stops excluding `arm64` simulator (this is not needed on the M1 neither on Intel devices) and removes the problematic `$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)` from `LIBRARY_SEARCH_PATHS`, since on Xcode 12.5 and 13.0 this folder contains only `i386/x86_64` binaries and will fail compilation. Instead this PR forces `$(SDKROOT)/usr/lib/swift` while it removes the incorrect directory. Ideally we could just remove `LIBRARY_SEARCH_PATHS` altogether if `$(inherited)` and `$(SDKROOT)/usr/lib/swift` were the only entries, but it would require us a **newer CocoaPods**, since that was fixed with `1.11` (see CocoaPods/CocoaPods@6985cbf). Since we don't enforce that, lets keep the `$(SDKROOT)/usr/lib/swift` and call it done. Last but not least, deprecate the `__apply_Xcode_12_5_M1_post_install_workaround()` as it's not needed anymore, at least with recent versions of the dependencies, no patching is required with RCT-Folly, neither we need to force `IPHONEOS_DEPLOYMENT_TARGET=11.0` ## Changelog [iOS] [Fixed] - Xcode 12.5+ build of iPhone Simulator on Apple M1 [iOS] [Changed] - Do not exclude the arm64 iphonesimulator [iOS] [Deprecated] - __apply_Xcode_12_5_M1_post_install_workaround() Pull Request resolved: #32284 Test Plan: * Build `packages/rn-tester` on M1 and see it still works properly * Run `pod install` on x86_64 and arm64 (m1) and see the `project.pbxproj` is not changed ## References: * Closes #31480 * The initial fix ac4ddec * Upgrading CocoaPods to 1.11 would bring us CocoaPods/CocoaPods@6985cbf and we could avoid adding `$(SDKROOT)/usr/lib/swift` ourselves Reviewed By: lunaleaps Differential Revision: D31248460 Pulled By: fkgozali fbshipit-source-id: 5a0d69593e889e296a2ba2e7b4387ecbd56fc08d
- Loading branch information
1 parent
132d1d0
commit a1c445a
Showing
5 changed files
with
42 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a1c445a
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.
@fkgozali just noticed you forgot to remove
__apply_Xcode_12_5_M1_post_install_workaround
fromtemplate/ios/Podfile
, this will result in theputs "__apply_Xcode_12_5_M1_post_install_workaround() is not needed anymore"
being called in new projectsa1c445a
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.
Sorry I missed that. We can fix forward (or feel free to send another PR and I'll merge it)
a1c445a
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.
@fkgozali #32296 there I also have the other commit to warn if Rosetta2 is in use, harmless, but you may drop if you think that should not get in for 0.66
a1c445a
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.
jus noticed this too for 1st time on new proj 0.67.0-rc.0, before upgrading to 0.67.0-rc.3
looking ahead before doing so
#32296
ac4ddec
03a0907
looks like its still needed after all 🔄