Skip to content

apple: an in-repo Swift iOS app builds and tests on a simulator (part of #1854) #6597

Closed

Description

@TrapsterDK

A Swift iOS app builds and runs its XCTests on an iOS simulator from rules_dx's own workspace, with no nested Bazel.

Plan (agent): size M, opus
Decision: use an in-repo fixture package built by the outer Bazel on macos_arm64. Register the Xcode C++ toolchain as a dev_dependency. Rejected: keep the nested //apple/tests:macos_swift_consumer_test. It has never passed (run 40614493224), it is slow, and #5291/#5757 remove nested apple tests.
Cause: no in-repo target builds an ios_application on macOS. rules_dx registers no Apple C++ toolchain (MODULE.bazel:490 has only @llvm). Consumers add it themselves (apple/README.md:248).
Change:

  1. MODULE.bazel:490: after @llvm, add apple_cc_configure_extension from @apple_support//crosstool:setup.bzl as dev_dependency = True and register @local_config_apple_cc_toolchains//:all as dev. Check with --toolchain_resolution_debug that macOS targets keep @llvm and iOS simulator targets get the Apple toolchain. If @llvm claims iOS, register only the iOS toolchain targets from that repo, before @llvm.
  2. New apple/tests/swift_app/BUILD.bazel with sources, all macos arm64 only:
    • a Rust rust_static_library with a C header cc_library and a swift_interop_hint
    • core swift_library and @main entry swift_library from //swift/rules:defs.bzl
    • apple_ios_app(entry=..., library=..., platforms=["simulator/arm64"])
    • apple_ios_app_test(deps=[testonly XCTest swift_library])
    • a device/arm64 apple_ios_app with a checked-in test .mobileprovision, behind a build_test
      Port the Swift sources from apple/tests/macos_swift_consumer_test.rs.
  3. Same package: an sh_test that unzips the simulator .ipa and checks CFBundleIdentifier, MinimumOSVersion, DTPlatformName=iphonesimulator, lipo -archs arm64, otool -l platform 7, and the _ledger_total symbol.
  4. Same package: failure_test negatives on the *_selection targets, macOS only: xcode_version = "9.9" (message "selects Xcode 9.9 but Bazel resolved") and device without provisioning_profile.
    Tests: on Linux, tools/dx test //apple/... //swift/... (the new targets skip as incompatible). Then evidence.yml with platforms ["macos_arm64"], scope //apple/tests/swift_app/... //apple/ios/..., test_timeout 1800. Attach executor.txt and the XCTest case names with nonzero executed counts.
    Host: macos (evidence.yml macos_arm64)
    Upstream: none expected.

Do after #6596
Part of #1854

Activity

  1. added
    P3New languages, platforms and features, last
    model:opusAgent lane: needs planning or open design, Opus
    on Nov 4, 2026
  2. TrapsterDK commented on Nov 5, 2026

    @TrapsterDK
    CollaboratorAuthor

    PR #7000: macos_arm64 evidence green. Run 41989737419: ledger_app_test (XCTest on iOS simulator) PASSED; run 41992872663: ledger_ipa_test PASSED. Remaining: device/arm64 app (needs aarch64-apple-ios Rust triple), xcode_version 9.9 negative, support matrix cells.

    Assisted by Claude.

  3. added
    model:sonnetAgent lane: scoped change with stated design, Sonnet
    needs-hostNeeds macOS, Windows, GPU, or signing secrets; not doable on Linux
    and removed
    model:opusAgent lane: needs planning or open design, Opus
    on Nov 5, 2026
  4. added a commit that references this issue on Nov 5, 2026
    7e850a6
  5. added a commit that references this issue on Nov 5, 2026
    eb1fc6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3New languages, platforms and features, lastmodel:sonnetAgent lane: scoped change with stated design, Sonnetneeds-hostNeeds macOS, Windows, GPU, or signing secrets; not doable on Linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions