Skip to content

Test Iroh on Intel iOS Simulator - #8485

Merged
azooz2003-bit merged 1 commit into
mainfrom
feat-iroh-x86-simulator-gate
Jul 19, 2026
Merged

azooz2003-bit merged 1 commit into
mainfrom
feat-iroh-x86-simulator-gate

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Jul 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • boot a unique iOS Simulator in the Intel Sonoma compatibility lane
  • run CMUXMobileCore and CmuxIrohTransport package tests as x86_64
  • require nonzero passing tests, an x86_64 result device, and x86_64 test binaries

Testing

  • CMUX_EXPECTED_SIMULATOR_ARCH=arm64 ./scripts/ci/run-iroh-ios-simulator-package-tests.sh (226 CMUXMobileCore tests and 407 CmuxIrohTransport tests passed in an isolated local iOS Simulator)
  • bash -n scripts/ci/run-iroh-ios-simulator-package-tests.sh
  • bash tests/test_ci_self_hosted_guard.sh
  • workflow YAML parsed with Ruby Psych
  • git diff --check

Issues


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Adds a CI step to run CMUXMobileCore and CmuxIrohTransport tests on an x86_64 iOS Simulator in the Intel Sonoma compatibility lane. Ensures tests actually run on x86_64 and fail fast if the runtime, device, or binaries don’t match.

  • New Features
    • New script scripts/ci/run-iroh-ios-simulator-package-tests.sh creates a fresh iOS Simulator, downloads an iOS runtime if missing, and boots it.
    • Runs package tests for CMUXMobileCore and CmuxIrohTransport with ONLY_ACTIVE_ARCH=YES and the expected arch.
    • Validates .xcresult: all tests passed, nonzero count, and device architecture is x86_64.
    • Verifies built test binaries contain the expected architecture via lipo.
    • Integrates into .github/workflows/ci-macos-compat.yml and executes only when matrix.expected_arch == 'x86_64' via CMUX_EXPECTED_SIMULATOR_ARCH.

Written for commit a05d628. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Tests
    • Added automated iOS Simulator package testing to macOS compatibility checks.
    • Tests now validate simulator architecture, runtime availability, successful execution, test results, and binary compatibility.
    • Improved coverage helps detect platform-specific issues before release.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c21bdb3e-8b20-45cb-9772-2d29cff09dc6

📥 Commits

Reviewing files that changed from the base of the PR and between fd6199b and a05d628.

📒 Files selected for processing (2)
  • .github/workflows/ci-macos-compat.yml
  • scripts/ci/run-iroh-ios-simulator-package-tests.sh

📝 Walkthrough

Walkthrough

Changes

iOS Simulator Compatibility

Layer / File(s) Summary
Conditional CI workflow wiring
.github/workflows/ci-macos-compat.yml
Adds an x86_64-only step that invokes the iOS simulator package test script.
Simulator runtime and device provisioning
scripts/ci/run-iroh-ios-simulator-package-tests.sh
Validates host architecture, ensures an iOS runtime, creates and boots a compatible simulator, and cleans it up on exit.
Package test execution and architecture validation
scripts/ci/run-iroh-ios-simulator-package-tests.sh
Runs both package test targets, validates XCTest results and simulator architecture, and checks the test binaries with lipo.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CIWorkflow
  participant TestScript
  participant Simulator as iOS Simulator
  participant XcodeBuild as xcodebuild
  participant Validators as xcresulttool and lipo
  CIWorkflow->>TestScript: Invoke for x86_64 matrix entry
  TestScript->>Simulator: Ensure runtime, create, and boot device
  TestScript->>XcodeBuild: Run CMUXMobileCore and CmuxIrohTransport tests
  XcodeBuild-->>TestScript: Produce test results and binaries
  TestScript->>Validators: Validate results and architectures
Loading

Suggested reviewers: lawrencecchen, austinywang

🚥 Pre-merge checks | ✅ 25
✅ Passed checks (25 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the main change: adding Intel iOS Simulator testing for Iroh.
Description check ✅ Passed The description covers Summary and Testing well; missing template sections like Demo Video, Review Trigger, and Checklist are non-critical here.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PASS: The commit only changes a workflow and a bash CI script; no .swift files or production Swift code were modified.
Cmux Swift Blocking Runtime ✅ Passed PR changes only a workflow YAML and a Bash CI script; no Swift files were modified, so the Swift blocking-runtime rule is not applicable.
Cmux Browser Automation Off-Main ✅ Passed PASS: diff only adds macOS CI and iOS simulator test plumbing; it doesn't touch browser socket automation routing, WebKit/AppKit waits, or policy tests.
Cmux Expensive Synchronous Load ✅ Passed Only a workflow YAML and a bash CI script changed; no Swift production code or main-actor load path was added.
Cmux Cache Substitution Correctness ✅ Passed No production Swift/TS/JS diff is present; the PR only changes CI workflow/Bash, so cache-substitution correctness is not applicable.
Cmux No Hacky Sleeps ✅ Passed The PR adds no fixed sleeps/polling in the new shell script; it waits on simctl bootstatus via a bounded timeout, and the workflow sleep predates this diff.
Cmux Algorithmic Complexity ✅ Passed Only CI/test code changed; the script’s scans and sort are over small simulator runtime/device lists, not scalable user data, so the rule isn’t violated.
Cmux Swift Concurrency ✅ Passed Diff only changes a workflow and a Bash CI script; no cmux-owned Swift code or new legacy async patterns were introduced.
Cmux Swift @Concurrent ✅ Passed No Swift files changed; the PR only touches workflow YAML and a Bash CI script, so the Swift @concurrent rule is not applicable.
Cmux Swift Package Boundaries ✅ Passed Only a workflow file and a shell script changed; no Swift source was touched, so the package-boundary rule is not applicable.
Cmux Swiftpm Lockfiles ✅ Passed Diff only changes a workflow step and adds a CI script; no Package.swift, xcodeproj, .gitignore, or Package.resolved changes are present.
Cmux Swift Logging ✅ Passed No production Swift files changed; the PR only adds a workflow step and a Bash CI script, so the Swift logging rule isn’t implicated.
Cmux User-Facing Error Privacy ✅ Passed The only new messages are CI/dev-only logs; no end-user-facing copy exposes vendor names, secrets, or raw upstream data.
Cmux Full Internationalization ✅ Passed Only a CI workflow and test script changed; no user-facing Swift/web/message/catalog/Info.plist text or locale files were added.
Cmux Swiftui State Layout ✅ Passed Diff only changes a workflow YAML and a Bash CI script; no SwiftUI source or state/layout patterns are introduced.
Cmux Architecture Rethink ✅ Passed No Swift source changes; the new CI simulator lane is test-only platform bridging and uses allowed synchronization, not architectural symptom-patching.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed No Swift/window code changed; the diff only touches a workflow YAML and a Bash CI script, so the auxiliary-window shortcut rule is not applicable.
Cmux Source Artifacts ✅ Passed Changed paths are a workflow config and a hand-written CI shell script; neither adds artifact files or scratch directories to source control.
Cmux No Test Or Debug Seam In Production Source ✅ Passed Diff touches only a workflow YAML and CI shell script; no Swift files under production Sources/ paths were changed.
Cmux No Ambient Global State ✅ Passed The PR only changes a workflow YAML and a Bash CI script; no production Swift code or new ambient global state is added.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-iroh-x86-simulator-gate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces a new CI job step and script (run-iroh-ios-simulator-package-tests.sh) to boot a uniquely-named iOS Simulator on the Intel Sonoma x86_64 lane and run CMUXMobileCore and CmuxIrohTransport package tests, with post-run checks that enforce a nonzero pass count, correct result-device architecture via xcresulttool, and correct binary architecture via lipo.

  • Workflow change gates the new step on matrix.expected_arch == 'x86_64', matching the existing Intel Sonoma matrix entry; env-var wiring is correct.
  • The script is well-structured: it uses set -euo pipefail, registers a cleanup trap after the simulator is created (so no orphaned simulators on failure), and uses the existing run_with_timeout.py abstraction for the boot-wait rather than a fixed sleep.
  • One minor observability gap: after xcodebuild -downloadPlatform iOS, the repeated has_ios_runtime call exits silently under set -e if the runtime is still absent.

Confidence Score: 4/5

Safe to merge — the script is well-guarded, uses a real event-based boot wait, and cleans up the simulator on exit regardless of outcome.

The only finding is a missing diagnostic message when the post-download has_ios_runtime check still fails, which affects CI log readability but not correctness. The core logic — simulator lifecycle, architecture enforcement, and test result validation — is sound.

scripts/ci/run-iroh-ios-simulator-package-tests.sh — the post-download runtime re-check at line 47 exits silently on failure.

Important Files Changed

Filename Overview
.github/workflows/ci-macos-compat.yml Adds one new step to the x86_64 Intel Sonoma matrix lane that invokes the new iOS Simulator test script; the guard condition and env-var wiring are correct.
scripts/ci/run-iroh-ios-simulator-package-tests.sh New CI script that boots a unique iOS Simulator, runs CMUXMobileCore and CmuxIrohTransport package tests as x86_64, and verifies architecture via xcresulttool and lipo; well-structured with cleanup trap and no hacky sleeps, but has a silent failure path when the platform download still yields no runtime.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[CI: matrix.expected_arch == x86_64] --> B[run-iroh-ios-simulator-package-tests.sh]
    B --> C{iOS runtime available?}
    C -- No --> D[xcodebuild -downloadPlatform iOS]
    D --> E{Runtime available now?}
    E -- No --> F[exit 1 silent]
    E -- Yes --> G[Create unique iOS Simulator]
    C -- Yes --> G
    G --> H[trap cleanup EXIT]
    H --> I[simctl boot + bootstatus via run_with_timeout.py]
    I --> J[run_package_tests CMUXMobileCore]
    J --> K[xcresulttool arch + pass checks]
    K --> L[lipo binary arch check]
    L --> M[run_package_tests CmuxIrohTransport]
    M --> N[xcresulttool + lipo checks]
    N --> O[cleanup: simctl shutdown + delete]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[CI: matrix.expected_arch == x86_64] --> B[run-iroh-ios-simulator-package-tests.sh]
    B --> C{iOS runtime available?}
    C -- No --> D[xcodebuild -downloadPlatform iOS]
    D --> E{Runtime available now?}
    E -- No --> F[exit 1 silent]
    E -- Yes --> G[Create unique iOS Simulator]
    C -- Yes --> G
    G --> H[trap cleanup EXIT]
    H --> I[simctl boot + bootstatus via run_with_timeout.py]
    I --> J[run_package_tests CMUXMobileCore]
    J --> K[xcresulttool arch + pass checks]
    K --> L[lipo binary arch check]
    L --> M[run_package_tests CmuxIrohTransport]
    M --> N[xcresulttool + lipo checks]
    N --> O[cleanup: simctl shutdown + delete]
Loading

Reviews (1): Last reviewed commit: "ci: test Iroh in Intel iOS Simulator" | Re-trigger Greptile

Comment on lines +44 to +48
if ! has_ios_runtime; then
echo "No available iOS Simulator runtime; downloading the iOS platform."
xcodebuild -downloadPlatform iOS
has_ios_runtime
fi

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.

P2 Silent failure after platform download — if the iOS runtime is still not found after xcodebuild -downloadPlatform iOS, set -e causes the script to exit with code 1 from the Python subprocess but no message is printed to stderr. A developer reading CI logs would see a bare non-zero exit with no context about why the post-download check failed.

Suggested change
if ! has_ios_runtime; then
echo "No available iOS Simulator runtime; downloading the iOS platform."
xcodebuild -downloadPlatform iOS
has_ios_runtime
fi
if ! has_ios_runtime; then
echo "No available iOS Simulator runtime; downloading the iOS platform."
xcodebuild -downloadPlatform iOS
if ! has_ios_runtime; then
echo "iOS Simulator runtime still not available after downloading the iOS platform." >&2
exit 1
fi
fi

@azooz2003-bit
azooz2003-bit merged commit 11038e6 into main Jul 19, 2026
9 of 11 checks passed
@azooz2003-bit
azooz2003-bit deleted the feat-iroh-x86-simulator-gate branch July 19, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant