Skip to content

ci(e2e-pay): fix iOS build — mobile_scanner has no x86_64 simulator slice#399

Merged
ignaciosantise merged 3 commits into
developfrom
ci/fix-ios-mobile-scanner-x86_64
Jul 2, 2026
Merged

ci(e2e-pay): fix iOS build — mobile_scanner has no x86_64 simulator slice#399
ignaciosantise merged 3 commits into
developfrom
ci/fix-ios-mobile-scanner-x86_64

Conversation

@ignaciosantise

Copy link
Copy Markdown
Collaborator

Problem

The iOS E2E Pay lane (pay-tests-ios) has been failing since #398 (QR scanner → mobile_scanner) merged. It fails at the Build Runner.app step:

GeneratedPluginRegistrant.m:24:9: error: Module 'mobile_scanner' not found
** BUILD FAILED **

(failing run)

Root cause

The build uses -destination "generic/platform=iOS Simulator" with no arch pin, so xcodebuild builds both arm64 and x86_64 simulator slices. mobile_scanner pulls in Google MLKitBarcodeScanning, which ships no x86_64 simulator slice (Apple-Silicon simulator only). The x86_64 compile of GeneratedPluginRegistrant.o then can't find the mobile_scanner module → BUILD FAILED.

Android was unaffected; only the iOS lane broke.

Fix

Pin the simulator build to arm64 (via -destination ...,arch=arm64 + EXCLUDED_ARCHS[sdk=iphonesimulator*]=x86_64). The CI runner (macos-latest-xlarge) is Apple Silicon, so arm64 is the only slice the emulator lane needs.

🤖 Generated with Claude Code

… error

PR #398 (QR scanner → mobile_scanner) broke the iOS E2E Pay lane. The build
uses `-destination "generic/platform=iOS Simulator"`, which builds both arm64
and x86_64 simulator slices. mobile_scanner pulls in Google
MLKitBarcodeScanning, which ships no x86_64 simulator slice, so the x86_64
compile fails with `Module 'mobile_scanner' not found` and BUILD FAILED.

Pin the simulator build to arm64 (via destination arch + EXCLUDED_ARCHS). The
runner is Apple Silicon, so arm64 is the only slice the emulator lane needs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 2, 2026 16:37
@claude

claude Bot commented Jul 2, 2026

Copy link
Copy Markdown

Claude finished @ignaciosantise's task in 1m 50s —— View job


Review Complete

  • Gather context
  • Read changed workflow file
  • Spawn breaking changes subagent
  • Spawn data classification subagent
  • Compile review findings

✅ No issues found

The fix is correct and well-reasoned:

  • Root cause is accurately diagnosed: generic/platform=iOS Simulator triggers a fat (arm64 + x86_64) simulator build; MLKitBarcodeScanning (pulled by mobile_scanner) ships no x86_64 slice, causing GeneratedPluginRegistrant.o to fail to find the module.
  • Both mitigations are appropriate: arch=arm64 in -destination pins xcodebuild's target; EXCLUDED_ARCHS[sdk=iphonesimulator*]=x86_64 ensures the build setting is enforced at the Xcode level too. Belt-and-suspenders is intentional here since one can be overridden by a transitive pod.
  • No regression risk: macos-latest-xlarge (and macos-26-xlarge) are Apple Silicon runners, so arm64 is the only slice the simulator lane ever needs.
  • Comment quality: The inline comment on the step clearly explains the why for future maintainers.
  • No breaking changes (CI-only, no public API surface affected).
  • No data classification concerns (no new secrets or sensitive data introduced).
  • No pull_request_target usage (no workflow security issues).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the iOS E2E Pay CI build break introduced after migrating the QR scanner to mobile_scanner, by ensuring the simulator build targets only the arm64 slice (since MLKit’s barcode scanning pod does not include an x86_64 simulator slice).

Changes:

  • Pin xcodebuild simulator destination to arch=arm64.
  • Exclude x86_64 for iphonesimulator builds to avoid generating an unsupported fat simulator binary.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci_e2e_pay_tests.yml Outdated
Comment on lines 332 to 335
-destination "generic/platform=iOS Simulator,arch=arm64" \
-derivedDataPath ../build/ios-ddcache \
EXCLUDED_ARCHS[sdk=iphonesimulator*]=x86_64 \
CODE_SIGNING_ALLOWED=YES \
ignaciosantise and others added 2 commits July 2, 2026 14:06
`arch=arm64` is not a valid key on a *generic* iOS Simulator destination, so
xcodebuild errored with "Unable to find a destination matching the provided
destination specifier". Revert to the plain generic destination and rely on
`EXCLUDED_ARCHS[sdk=iphonesimulator*]=x86_64` to drop the unsupported x86_64
slice (MLKitBarcodeScanning via mobile_scanner ships no x86_64 sim slice).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…4-sim slice)

Verified locally: mobile_scanner pulls in GoogleMLKit, whose .frameworks are
fat binaries carrying an arm64-*device* slice and an x86_64-*simulator* slice
but NO arm64-simulator slice. On the Apple Silicon runner the default arm64
simulator build fails to link MLKit:

  ld: building for 'iOS-simulator', but linking in object file
  (MLImage.framework/MLImage[arm64](GMLImage.o)) built for 'iOS'

x86_64 is the only working simulator slice (runs via Rosetta 2). EXCLUDED_ARCHS
=arm64 alone doesn't help because arm64 is the standard sim arch here, so pin
ARCHS=x86_64 with ONLY_ACTIVE_ARCH=NO. Confirmed `** BUILD SUCCEEDED **` and a
non-fat x86_64 Runner.app locally with Xcode 26.2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ignaciosantise ignaciosantise marked this pull request as draft July 2, 2026 17:27
@ignaciosantise ignaciosantise marked this pull request as ready for review July 2, 2026 18:06
@claude

claude Bot commented Jul 2, 2026

Copy link
Copy Markdown

Claude finished @ignaciosantise's task in 1m 43s —— View job


Incremental Review

  • Gather context
  • Read workflow file
  • Assess Copilot shell-globbing finding
  • Final update

🔄 Incremental Review: Checking Copilot's shell-globbing flag from the first review round.

Copilot finding — EXCLUDED_ARCHS[sdk=iphonesimulator*]=x86_64 needs quoting: Resolved / No longer applicable. That build setting was present in an intermediate commit (a88a6af) but was dropped. The final code uses ARCHS=x86_64 + ONLY_ACTIVE_ARCH=NO — plain KEY=VALUE tokens with no shell-special characters, so no quoting issue exists.

The current fix (.github/workflows/ci_e2e_pay_tests.yml:338-339) is correct:

  • ARCHS=x86_64 pins the architecture; MLKit ships an x86_64-simulator slice but no arm64-simulator slice, so arm64 would fail to link on the Apple Silicon runner.
  • ONLY_ACTIVE_ARCH=NO prevents xcodebuild from restricting to the runner's native arch (arm64), ensuring the x86_64 slice is actually built.

✅ No new issues found in latest commits

@ignaciosantise ignaciosantise merged commit 34d14d5 into develop Jul 2, 2026
12 of 13 checks passed
@ignaciosantise ignaciosantise deleted the ci/fix-ios-mobile-scanner-x86_64 branch July 2, 2026 18:35
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants