Repository navigation
Feature/ios simulator - #442
Merged
Merged
Conversation
ViroKit links three libraries that had no arm64 simulator slice. ios/build_ios_simulator_libs.sh builds LinearMath (Bullet 2.87) and protobuf-lite 3.2.0 from source (protobuf with -Dgoogle=google_public, the namespace the device build uses) and adds the slices to the existing x86_64 archives. GVR Audio is closed source, so retag_for_simulator.py relabels its arm64 device objects as iOS Simulator objects into Libraries/GVRAudioSDK/simulator; the code is the same on both. The simulator search paths find that GVR build first, and the device libreactvisioncca.a is no longer on the unconditional search path, where the simulator link found it before its own slice.
The "Lipo Framework and Copy to Bridge" phase now builds viro/ios/dist/ViroRenderer/ViroKit.xcframework, replacing only the slice of the platform it built and keeping the other, so device and simulator builds can run in either order. It skips a simulator build lacking arm64 or x86_64, since an app's Release simulator build asks for both and CocoaPods refuses a slice missing either. The phase runs after [CP] Copy Pods Resources, so the ARCore resource bundles are in every staged copy, and takes the framework's Info.plist as an input: a clean build otherwise staged the framework before its plist existed. The Jenkins phase lipos only when the two builds share no architecture, and ViroKit.podspec vendors the xcframework.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build ViroKit for the iOS Simulator
ViroKit only built for devices, so any app using Viro failed to link for the iOS Simulator. This adds a simulator build (arm64 and x86_64) and stages ViroKit into viro as
ViroKit.xcframework, with a device slice and a simulator slice.Changes
Simulator libraries. ViroKit links three libraries that had no arm64 simulator build:
ios/build_ios_simulator_libs.shbuilds them from source and adds the arm64 slices to the existingx86_64archives. protobuf is built with-Dgoogle=google_public, the namespace ViroKit links against.ios/retag_for_simulator.pyrelabels its arm64 device objects as iOS Simulator objects, inLibraries/GVRAudioSDK/simulator. The relabelled objects have the same code, relocations, symbols and data as the device build; only the platform label differs.Search paths. The simulator finds that GVR build first. The device
libreactvisioncca.ais no longer on the search path used by every SDK, where the simulator link found it before its own build.Staging. "Lipo Framework and Copy to Bridge" now builds
viro/ios/dist/ViroRenderer/ViroKit.xcframework:[CP] Copy Pods Resources, so the ARCore resource bundles are in every staged copy.Info.plistas an input. On a build from clean, it used to copy the framework before the plist existed.ViroKit.podspecvendors the xcframework.Testing
Info.plist.ViroKit.framework. Apart from the GVR Audio library, the only difference between the device and simulator builds is ARCore's Core ML executor, which ARCore's own simulator build lacks.Notes
ios/Libraries.