From 143c06707509f70ad4a92ea74478bde0160e3a54 Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Thu, 5 Nov 2026 07:55:21 +0100 Subject: [PATCH 1/5] apple: keep test selection labels off the deps attribute so the rules_apple aspect skips them (part of #6597) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_011u9TXHDZrfmzFQ2WT8QAKK --- apple/ios/app.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apple/ios/app.bzl b/apple/ios/app.bzl index 18203c1e5f..df2faf5d04 100644 --- a/apple/ios/app.bzl +++ b/apple/ios/app.bzl @@ -649,7 +649,7 @@ def apple_ios_app( def _test_selection_impl(ctx): failures = test_errors(ctx.attr.device_type, ctx.attr.os_version, ctx.attr.deployment) - failures.extend(test_source_errors(ctx.attr.srcs, ctx.attr.deps)) + failures.extend(test_source_errors(ctx.attr.srcs, ctx.attr.dep_labels)) if len(failures) > 0: fail("; ".join(failures)) return [CcInfo()] @@ -666,7 +666,7 @@ _test_selection = rule( doc = "Simulator device type to run tests on, such as iPhone 16.", mandatory = True, ), - "deps": attr.string_list( + "dep_labels": attr.string_list( doc = "Label texts of test modules.", mandatory = True, ), @@ -699,7 +699,7 @@ def apple_ios_app_test( device_type = device_type, os_version = os_version, srcs = [label_text(src) for src in srcs], - deps = [label_text(dep) for dep in deps], + dep_labels = [label_text(dep) for dep in deps], tags = ["manual"], testonly = True, visibility = ["//visibility:private"], From 0e4ff7acaad13f48676c8912dcd0ef7de64e64a5 Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Thu, 5 Nov 2026 08:06:01 +0100 Subject: [PATCH 2/5] apple: build Swift fixture libraries only through the iOS app, export test uses a valid simulator app (part of #6597) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_011u9TXHDZrfmzFQ2WT8QAKK --- apple/ios/BUILD.bazel | 2 +- apple/tests/fixtures/swift_app/BUILD.bazel | 6 ++++++ apple/tests/fixtures/swift_app/main/BUILD.bazel | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apple/ios/BUILD.bazel b/apple/ios/BUILD.bazel index b994e6e495..5bea82691e 100644 --- a/apple/ios/BUILD.bazel +++ b/apple/ios/BUILD.bazel @@ -582,7 +582,7 @@ failure_test( apple_ios_export( name = "export_simulator", - app = ":simulator_app", + app = "//apple/tests/fixtures/swift_app:ledger_app", ) failure_test( diff --git a/apple/tests/fixtures/swift_app/BUILD.bazel b/apple/tests/fixtures/swift_app/BUILD.bazel index 722bfe6b01..8f6289f242 100644 --- a/apple/tests/fixtures/swift_app/BUILD.bazel +++ b/apple/tests/fixtures/swift_app/BUILD.bazel @@ -14,6 +14,7 @@ _MACOS_ARM64 = [ rust_static_library( name = "ledger_rust", + tags = ["manual"], srcs = ["ledger.rs"], edition = "2021", target_compatible_with = _MACOS_ARM64, @@ -27,12 +28,14 @@ rustfmt_test( swift_interop_hint( name = "ledger_core_hint", + tags = ["manual"], module_name = "LedgerCore", target_compatible_with = _MACOS_ARM64, ) cc_library( name = "ledger_core", + tags = ["manual"], visibility = ["//apple/tests/fixtures/swift_app/main:__pkg__"], hdrs = ["ledger.h"], aspect_hints = [":ledger_core_hint"], @@ -41,6 +44,7 @@ cc_library( swift_library( name = "ledger_kit", + tags = ["manual"], visibility = ["//apple/tests/fixtures/swift_app/main:__pkg__"], srcs = ["LedgerKit.swift"], module_name = "LedgerKit", @@ -49,6 +53,7 @@ swift_library( swift_library( name = "ledger_xctests", + tags = ["manual"], testonly = True, srcs = ["LedgerAppTests.swift"], module_name = "LedgerAppTests", @@ -69,6 +74,7 @@ apple_ios_app( resources = ["entries.txt"], tags = ["manual"], version = "1.4", + visibility = ["//apple/ios:__pkg__"], ) apple_ios_app( diff --git a/apple/tests/fixtures/swift_app/main/BUILD.bazel b/apple/tests/fixtures/swift_app/main/BUILD.bazel index f3d89ae059..d4d20aa214 100644 --- a/apple/tests/fixtures/swift_app/main/BUILD.bazel +++ b/apple/tests/fixtures/swift_app/main/BUILD.bazel @@ -3,6 +3,7 @@ load("//swift/rules:defs.bzl", "swift_library") swift_library( name = "ledger_main", + tags = ["manual"], srcs = ["LedgerAppDelegate.swift"], module_name = "LedgerApp", target_compatible_with = [ From 331e738ab86cc21f4f6889014751799d445cc0a2 Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Thu, 5 Nov 2026 08:23:44 +0100 Subject: [PATCH 3/5] apple: let the Swift fixture libraries build for the iOS simulator platform (part of #6597) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_011u9TXHDZrfmzFQ2WT8QAKK --- apple/tests/fixtures/swift_app/BUILD.bazel | 9 +++++---- apple/tests/fixtures/swift_app/main/BUILD.bazel | 6 ++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apple/tests/fixtures/swift_app/BUILD.bazel b/apple/tests/fixtures/swift_app/BUILD.bazel index 8f6289f242..a137830d2c 100644 --- a/apple/tests/fixtures/swift_app/BUILD.bazel +++ b/apple/tests/fixtures/swift_app/BUILD.bazel @@ -3,6 +3,7 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@rules_shell//shell:sh_test.bzl", "sh_test") load("@rules_swift//swift:swift_interop_hint.bzl", "swift_interop_hint") load("//apple/ios:app.bzl", "apple_ios_app", "apple_ios_app_test") +load("//apple/ios:cell.bzl", "APPLE_HOSTS") load("//cc/rules:defs.bzl", "cc_library") load("//rust/rules:defs.bzl", "rust_static_library", "rustfmt_test") load("//swift/rules:defs.bzl", "swift_library") @@ -30,7 +31,7 @@ swift_interop_hint( name = "ledger_core_hint", tags = ["manual"], module_name = "LedgerCore", - target_compatible_with = _MACOS_ARM64, + target_compatible_with = APPLE_HOSTS, ) cc_library( @@ -39,7 +40,7 @@ cc_library( visibility = ["//apple/tests/fixtures/swift_app/main:__pkg__"], hdrs = ["ledger.h"], aspect_hints = [":ledger_core_hint"], - target_compatible_with = _MACOS_ARM64, + target_compatible_with = APPLE_HOSTS, ) swift_library( @@ -48,7 +49,7 @@ swift_library( visibility = ["//apple/tests/fixtures/swift_app/main:__pkg__"], srcs = ["LedgerKit.swift"], module_name = "LedgerKit", - target_compatible_with = _MACOS_ARM64, + target_compatible_with = APPLE_HOSTS, ) swift_library( @@ -57,7 +58,7 @@ swift_library( testonly = True, srcs = ["LedgerAppTests.swift"], module_name = "LedgerAppTests", - target_compatible_with = _MACOS_ARM64, + target_compatible_with = APPLE_HOSTS, deps = [ ":ledger_core", ":ledger_kit", diff --git a/apple/tests/fixtures/swift_app/main/BUILD.bazel b/apple/tests/fixtures/swift_app/main/BUILD.bazel index d4d20aa214..4e1b66a1c8 100644 --- a/apple/tests/fixtures/swift_app/main/BUILD.bazel +++ b/apple/tests/fixtures/swift_app/main/BUILD.bazel @@ -1,4 +1,5 @@ # gazelle:ignore +load("//apple/ios:cell.bzl", "APPLE_HOSTS") load("//swift/rules:defs.bzl", "swift_library") swift_library( @@ -6,10 +7,7 @@ swift_library( tags = ["manual"], srcs = ["LedgerAppDelegate.swift"], module_name = "LedgerApp", - target_compatible_with = [ - "@platforms//os:macos", - "@platforms//cpu:arm64", - ], + target_compatible_with = APPLE_HOSTS, visibility = ["//apple/tests/fixtures/swift_app:__pkg__"], deps = [ "//apple/tests/fixtures/swift_app:ledger_core", From 21a27b203398cb6b3418804e38610957ef3e1926 Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Thu, 5 Nov 2026 08:38:25 +0100 Subject: [PATCH 4/5] apple: let the Rust fixture library build for the iOS simulator platform (part of #6597) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_011u9TXHDZrfmzFQ2WT8QAKK --- apple/tests/fixtures/swift_app/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/tests/fixtures/swift_app/BUILD.bazel b/apple/tests/fixtures/swift_app/BUILD.bazel index a137830d2c..97f48fa279 100644 --- a/apple/tests/fixtures/swift_app/BUILD.bazel +++ b/apple/tests/fixtures/swift_app/BUILD.bazel @@ -18,7 +18,7 @@ rust_static_library( tags = ["manual"], srcs = ["ledger.rs"], edition = "2021", - target_compatible_with = _MACOS_ARM64, + target_compatible_with = APPLE_HOSTS, ) rustfmt_test( From 5f78a20cb413418dfe27dac255189401ee4c6eef Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Thu, 5 Nov 2026 08:47:42 +0100 Subject: [PATCH 5/5] apple: drop the device app from the simulator fixture, it needs the iOS device Rust target (part of #6597) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_011u9TXHDZrfmzFQ2WT8QAKK --- apple/tests/fixtures/swift_app/BUILD.bazel | 20 ------------------ .../swift_app/ledger_device.mobileprovision | Bin 3592 -> 0 bytes 2 files changed, 20 deletions(-) delete mode 100644 apple/tests/fixtures/swift_app/ledger_device.mobileprovision diff --git a/apple/tests/fixtures/swift_app/BUILD.bazel b/apple/tests/fixtures/swift_app/BUILD.bazel index 97f48fa279..5bdeb772a4 100644 --- a/apple/tests/fixtures/swift_app/BUILD.bazel +++ b/apple/tests/fixtures/swift_app/BUILD.bazel @@ -1,5 +1,4 @@ # gazelle:ignore -load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@rules_shell//shell:sh_test.bzl", "sh_test") load("@rules_swift//swift:swift_interop_hint.bzl", "swift_interop_hint") load("//apple/ios:app.bzl", "apple_ios_app", "apple_ios_app_test") @@ -78,25 +77,6 @@ apple_ios_app( visibility = ["//apple/ios:__pkg__"], ) -apple_ios_app( - name = "ledger_device", - bundle_id = "com.example.ledger.device", - deployment = "17.0", - entry = "//apple/tests/fixtures/swift_app/main:ledger_main", - library = ":ledger_rust", - platforms = ["device/arm64"], - provisioning_profile = "ledger_device.mobileprovision", - resources = ["entries.txt"], - tags = ["manual"], - version = "1.4", -) - -build_test( - name = "ledger_device_build_test", - targets = [":ledger_device"], - target_compatible_with = _MACOS_ARM64, -) - apple_ios_app_test( name = "ledger_app_test", size = "large", diff --git a/apple/tests/fixtures/swift_app/ledger_device.mobileprovision b/apple/tests/fixtures/swift_app/ledger_device.mobileprovision deleted file mode 100644 index c740bf1f2aa48c525b92af716066bd5e1208edc1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3592 zcmbVO3v?4z8gA0^Dz>bMfF96LV0nagW->{e!8UY~nLL_DGkMWOS(#)e@8`@UlSJ8t zupql4xOLG*5UX&gs0b>nxa$)X1l{$?Ls>*YKtY7Mwji*$la@YU#oe>#LYYcC9G$_EM$zX2a0BK znB^EDT@{s;P;@5bqa_^8a`nLF;Q@iskdNeqjT$IA&V~FTnz1spKa}lk)L%VfX5-e`=@(9z;i zXoS-c5)#s*+5gB!2q9Hwg8{?y8V%}C2TAcAv0#kne#+$c5y7+$pOwPb13OC=Dx- zKpm`r)J_^|_6K5#xVMSV8+_h$SPzBr>TDpY$0I?Pn~)kXSOG$_rOw$A7?~ZD)+YG`BeiMcNJtiEO(q^fI0{Ng0VET2 zIw?4W>g{z_O`MIPdZx*VWl%ZbbY)02LIF~FIFw4@6q^DmFRXNeDJqy?6**4Fh6#p^ z3nf+WL;QIxbe%vzk+7i(n$o7HMJuC?NtaH`gtaZ?IbQ`>A3_OHV-3C_@@HLI1yJ3<+F z!fjTQ=+FA1J-#@Ps{x+Sno+YF^((KgdGY=gYpzDM-i+HuCS_WJjpuBXrOAjllSo$Y z4ME-*;Y8FhWpBb-Yz4-Y|KXKrOkRTpOI^WRM1aqv)KeGwOAr` zEk;bKu%t*sS`*A?W6r!MVnuaq&Q7#6b6#Tw@Dd40%c z(P`3oGXe*^7QHEJ12xfz$xnuZPJI&g5>lMQLard3w#9u6m5<;a1;)}5n;gx>q*B_I zmWP#TUEY+@bC@L>qD`2=69OP!Nn$RwktboLl8M_Da9!A>jT*xq$U(q?Bo%<=R5%T? zO|?L>+2DpLmp+wM$Q2P*s^#+0I1#hDG)#~JkeEX2$1HXaj36Pk$zGe z$1c7%Pj&SA_Gjn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