fix(ios): build one simulator arch for --remote and key iOS simulator builds by arch - #1834
Merged
Merged
Conversation
… builds by arch A --remote build uses the generic simulator destination, where Xcode compiles every ARCHS value. Pass ARCHS=<arch> ONLY_ACTIVE_ARCH=YES, reading the arch from the agent-device daemon /health hostArch and defaulting to arm64. The iOS simulator cache key now ends in the arch for single-arch builds, in the CLI and in @stim-cli/expo-build-cache. Closes #1803
A remote run keys the remote simulator arch, which a plan cannot read without a session, matching the android.remote refusal.
Expo --device generic compiles every ARCHS value, so it keeps the unsuffixed key. Also scope the plan guide's CAS and no-device refusals to Android.
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.
Description
stim ios --remote proxy|easbuilds with-destination 'generic/platform=iOS Simulator'because no remote UDID exists at build time (#1212 boots the remote device after the build). With a generic destination Xcode forcesONLY_ACTIVE_ARCH=NOand compiles everyARCHSvalue, so a remote build compiled arm64 and x86_64 for a simulator that runs one of them: about twice the xcodebuild time,.appsize and DerivedData (numbers in #1803).Separately, the iOS simulator cache key carried no architecture, so an arm64-only Debug build, an Intel Mac's x86_64-only build and a fat build all shared
<fp>-debug-sim, locally and in the Expo build cache provider.Solution
One slice for
--remote. The generic destination stays; the build addsARCHS=<arch> ONLY_ACTIVE_ARCH=YES, the only thing that narrows a generic build.<arch>is the agent-device/healthhostArch(callstack/agent-device#3048,upstream.hostArchfirst when talking to a proxy), read once per run. A missing or unknown value, an error, or no answer in 3 s meansarm64, so today, before any agent-device release reports the field, every remote getsarm64.EAS never gets a
/healthread: its daemon URL only exists onceeas simcreates the session, which since #1212 happens after the build. EAS hosts are Apple silicon (checked in #1803), soarm64is correct there.Arch in the iOS simulator key, mirroring Android's ABI component:
<fp>-debug-sim-arm64(-x86-64on an Intel Mac, fromprocess.arch)--remote(any configuration)<fp>-<config>-sim-<remote arch><fp>-release-sim, unchanged<fp>-debug-device, unchangedExisting iOS Debug simulator cache entries miss once after this lands. A local non-Debug simulator build stays fat (#608), and I kept its key unsuffixed rather than adding
-universal: no suffix already means "the ARCHS the project lists", as on Android, and Release entries stay valid.@stim-cli/expo-build-cachekeysexpo run:iosDebug simulator builds on the host arch the same way (--device genericstays unsuffixed, since it compiles every ARCHS; a simulator named with--device <name>keys ason-<name>with no arch, as before, because the name cannot tell a simulator from a phone), and remote build-cache providers now receivearchinrunOptions, as Android passesabi.stim ios --plannow refuses theios.remotesetting withSTIM_BAD_ARG, as it already did forandroid.remote: the run keys the remote arch, which a plan cannot read without a session. No setting or flag is added.Test plan
stim ios --remote proxyinstall. A local proxy would let agent-device pick a simulator on this shared machine that Stim does not own, and an EAS session is billed.xcodebuild -showBuildSettingsonapps/mobile(Xcode 27.0, arm64, targetStim, generic destination): Debug and Release both resolveARCHS = arm64 x86_64; addingARCHS=arm64 ONLY_ACTIVE_ARCH=YESgivesarm64, andARCHS=x86_64 ...givesx86_64.ARCHS=arm64 ONLY_ACTIVE_ARCH=YES, fresh DerivedData, no compilation cache):BUILD SUCCEEDED,lipo -archsgivesarm64forStim.app/StimandExpoCamera.framework,.app172 MB, DerivedData 4.4 GB. The same build without the settings (what--remotedid before):x86_64 arm64, 341 MB, 9.5 GB. Wall times were 339 s single-arch and 380 s fat, but the machine load differed a lot between the runs (load average about 80-225 vs 40-80), so the times don't compare; the A/B in ios --remote compiles arm64 and x86_64 for a one-arch simulator; iOS sim cache key has no arch #1803 measured 151 s vs 285 s.readRemoteSimulatorArchagainst a real loopbackagent-device proxy0.21.12:/agent-device/healthreturns nohostArch, and the reader returnsarm64; a closed port also returnsarm64./healthparser and reader (proxyupstream, absent, unknown arch, error, bad JSON, timeout), the xcodebuild argv with and without an arch,stim ios --remote proxy|easreading/healthonce and building/keying that arch, the key table, and the CLI andexpo-build-cacheresolving the same iOS entries (cache-packages.test.ts).Fixes #1803