Enable fat binaries with arm64 and x86_64 support#505
Enable fat binaries with arm64 and x86_64 support#505tom-un merged 3 commits intomicrosoft:masterfrom
Conversation
|
| puts ' adding arm64e to ' + config.name | ||
| end | ||
| end | ||
| # TODO(macOS ISS#2323203): the internal Microsoft build pipeline needs macOS arm64 slices |
There was a problem hiding this comment.
I am definitely very naive about how this stuff is supposed to work, but if someone takes a dependency on react-native they don't necessarily take a dependency on RNTester, right? So how would a fix in RNTester's podfiles cause clients to end up with arm64 slices? Should we be doing this somewhere in the shared libraries instead?
There was a problem hiding this comment.
A consumer of the repo will have dependencies on the *.podspec's in this repo. The Podfile in the RNTester folder is only used by the test app here. External repos would have to replicate what the RNTester Podfile is doing if they wanted macOS arm64 fat slices ahead of released Xcode defaults.
There was a problem hiding this comment.
So this proves out that RN can build fat binaries. A follow up change has to go in to enable that in CI loops and then any consumers could use either the x86_64 bits or the arm64 bits in their project.
There was a problem hiding this comment.
But before this week, updating the CI wouldn’t have successful builds for arm64- this is the final evidence that we can in fact run RN on a silicon machine.
There was a problem hiding this comment.
And revealed the need to tweak the ss.osx.exclude_files filter in React-Core.podspec which is goodness.
There was a problem hiding this comment.
There was also a fix earlier this week that we needed just to get Xcode 12 universal building for either architecture in the first place
| # TODO(macOS ISS#2323203): the internal Microsoft build pipeline needs macOS arm64 slices | ||
| if target.platform_name == :osx | ||
| target.build_configurations.each do |config| | ||
| (config.build_settings['ARCHS'] ||= ['$(ARCHS_STANDARD)']) << 'arm64' |
There was a problem hiding this comment.
This may not be necessary. In standard Xcode 12, ARCHS_STANDARD includes arm64. This definitely won't hurt anything though.
There was a problem hiding this comment.
I based it off what we did for our CI loops in FluentUI-Apple where we explicitly set the ARCHS to arm64
Please select one of the following
Summary
This adds support for Apple's ARM based processors on macOS.
To build this locally, one needs to be sure that RNTester-macOS and all dependent libs have the Build Active Architecture Only flag set. Our CI loops set this automatically on every build, so this should start producing fat binaries from CI once we enable the build machines to run Xcode Universal 12.
Test Plan
Tested this by manually setting the build active architecture only flag to NO and transferring the built project to a Silicon machine. It's able to launch and run and the controls appear equally interactive as they do with an x86_64 build on an intel machine.
I then rebuilt for only x86_64 and moved that project to the Silicon machine to check and that fails to launch, verifying we have a separate, working build for arm64 machines.
Microsoft Reviewers: Open in CodeFlow