From d01887f4d7b7e985bae6cdcba96aaffb9375ad66 Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 9 Nov 2026 10:45:03 +0100 Subject: [PATCH 1/9] msix, apple macos, appimage, android, cuda, swift: platform labels and cuda_archs (part of #9535) msix, appimage and apple_macos_app take one optional platform label read through the shared probe; single_platform_error replaces platform_arch. rust_android_apk and android_check take platform labels. cuda macros rename platforms to cuda_archs, including the gazelle directive. swift wrappers take platforms and keep the extra toolchains private. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B --- appimage/README.md | 3 ++ appimage/defs.bzl | 16 ++++----- docs/cli/commands/generate.md | 2 +- families/android/README.md | 7 ++-- families/android/packaging/BUILD.bazel | 14 ++++---- families/android/packaging/defs.bzl | 28 ++++++++++----- .../fixtures/consumer_android/BUILD.bazel | 4 +-- .../tests/fixtures/rust_apk/BUILD.bazel | 14 ++++---- families/apple/README.md | 7 ++-- families/apple/macos/BUILD.bazel | 4 +-- families/apple/macos/app.bzl | 33 +++++++++--------- families/apple/macos/app_tests.bzl | 7 +--- families/apple/platforms/BUILD.bazel | 17 ++++++++++ families/cuda/README.md | 16 ++++----- families/cuda/rules/BUILD.bazel | 6 ++-- families/cuda/rules/defs.bzl | 30 ++++++++-------- families/cuda/testing/BUILD.bazel | 2 +- families/cuda/tests/BUILD.bazel | 26 +++++++------- .../cuda/tests/fixtures/cublas/BUILD.bazel | 2 +- .../tests/fixtures/cuda-app/gpu/BUILD.bazel | 2 +- .../fixtures/cuda-app/kernels/BUILD.bazel | 2 +- families/cuda/tests/fixtures/rdc/BUILD.bazel | 8 ++--- .../cuda/tests/fixtures/saxpy/BUILD.bazel | 2 +- families/cuda/toolchain/check.bzl | 4 +-- families/msix/README.md | 8 ++--- families/msix/defs.bzl | 34 ++++--------------- families/msix/metadata_tests.bzl | 8 +---- families/msix/tests/BUILD.bazel | 24 ++----------- families/msix/validate.bzl | 8 ----- gazelle/cc/cuda.go | 10 +++--- gazelle/cc/lang.go | 14 ++++---- gazelle/cc/lang_test.go | 18 +++++----- gazelle/cc/testdata/cuda_generate/README.md | 6 ++-- .../cc/testdata/cuda_generate/pkg/BUILD.in | 2 +- .../cc/testdata/cuda_generate/pkg/BUILD.out | 2 +- .../pkg/{keepplatforms => keeparchs}/BUILD.in | 4 +-- .../{keepplatforms => keeparchs}/BUILD.out | 4 +-- .../pkg/{keepplatforms => keeparchs}/a.cu | 0 .../pkg/{keepplatforms => keeparchs}/b.cu | 0 .../testdata/cuda_generate/pkg/multi/BUILD.in | 2 +- .../cuda_generate/pkg/multi/BUILD.out | 4 +-- .../cuda_generate/pkg/newgpu/BUILD.out | 2 +- .../testdata/cuda_generate/pkg/stale/BUILD.in | 4 +-- .../cuda_generate/pkg/stale/BUILD.out | 2 +- .../cc/testdata/cuda_keep/pkg/gpu/BUILD.in | 2 +- .../cc/testdata/cuda_keep/pkg/gpu/BUILD.out | 2 +- .../testdata/cuda_keep/pkg/gpuonly/BUILD.in | 2 +- .../testdata/cuda_keep/pkg/gpuonly/BUILD.out | 2 +- .../testdata/cuda_keep/pkg/hostinc/BUILD.in | 2 +- .../testdata/cuda_keep/pkg/hostinc/BUILD.out | 2 +- gazelle/dispatch/lang_test.go | 6 ++-- libs/starlark/packaging.bzl | 11 +----- libs/starlark/platform.bzl | 10 ++++-- libs/starlark/tests/packaging_tests.bzl | 18 ++++------ quality/testdata/nvcc_syntax/BUILD.bazel | 8 ++--- .../fixtures/shared-rust-checks/repos.bzl | 2 +- swift/README.md | 4 ++- swift/platforms/transition.bzl | 27 +++++++-------- swift/platforms/transition_tests.bzl | 10 +++--- swift/rules/defs.bzl | 26 +++++++------- tools/testing/hermetic/cuda_gpu_test.rs | 2 +- 61 files changed, 255 insertions(+), 293 deletions(-) create mode 100644 families/apple/platforms/BUILD.bazel rename gazelle/cc/testdata/cuda_generate/pkg/{keepplatforms => keeparchs}/BUILD.in (60%) rename gazelle/cc/testdata/cuda_generate/pkg/{keepplatforms => keeparchs}/BUILD.out (73%) rename gazelle/cc/testdata/cuda_generate/pkg/{keepplatforms => keeparchs}/a.cu (100%) rename gazelle/cc/testdata/cuda_generate/pkg/{keepplatforms => keeparchs}/b.cu (100%) diff --git a/appimage/README.md b/appimage/README.md index 13ea4f7644..99e7f4d1f3 100644 --- a/appimage/README.md +++ b/appimage/README.md @@ -101,6 +101,9 @@ Build for arm64 from any Linux host: bazel build //pkg:app --platforms=//appimage/platforms:linux_arm64 ``` +Or set `platform = "//appimage/platforms:linux_arm64"` on the target. Unset uses the +current target platform. + The image is packaged from the arm64 target bytes. Running it needs an arm64 Linux host. diff --git a/appimage/defs.bzl b/appimage/defs.bzl index 81ec9fdae1..103ccbf0d5 100644 --- a/appimage/defs.bzl +++ b/appimage/defs.bzl @@ -1,7 +1,8 @@ """Linux AppImage packaging for target binaries.""" load("//appimage:pins.bzl", "MKSQUASHFS_VERSION", "RUNTIME_VERSION", "TOOL_VERSION") -load("//libs/starlark:packaging.bzl", "claim_dest", "data_path", "platform_arch") +load("//libs/starlark:packaging.bzl", "claim_dest", "data_path") +load("//libs/starlark:platform.bzl", "PLATFORM_ATTRS", "platform_identity", "platform_transition") load(":validate.bzl", "appimage_name_errors") AppImageInfo = provider( @@ -25,11 +26,8 @@ def _add(ctx, args, inputs, seen, kind, dest, arg, file): inputs.append(file) def _appimage_impl(ctx): - cv = platform_common.ConstraintValueInfo - arch = platform_arch(ctx.target_platform_has_constraint, ctx.attr._linux[cv], [ - ("aarch64", ctx.attr._arm64[cv]), - ("x86_64", ctx.attr._x86_64[cv]), - ]) + identity = platform_identity(ctx) + arch = identity.cpu if identity.os == "linux" else "" if not arch: fail("appimage_package " + str(ctx.label) + ": target cell this platform is unsupported: only linux_x86_64 and linux_arm64 are pinned") name = ctx.attr.app_name or ctx.label.name @@ -102,14 +100,12 @@ _appimage_package = rule( "libs": attr.label_list(doc = "Shared libraries placed under usr/lib.", allow_files = True), "notice": attr.label_list(doc = "License and NOTICE files placed under usr/share/licenses/.", allow_files = True, mandatory = True, allow_empty = False), "version": attr.string(doc = "Application version.", mandatory = True), - "_arm64": attr.label(default = "@platforms//cpu:arm64"), "_build": attr.label(default = "//appimage/packer:appimage_packer", executable = True, cfg = "exec"), - "_linux": attr.label(default = "@platforms//os:linux"), "_runtime_aarch64": attr.label(default = "@dx_appimage_tools//:runtime_aarch64", allow_single_file = True), "_runtime_x86_64": attr.label(default = "@dx_appimage_tools//:runtime_x86_64", allow_single_file = True), "_tools": attr.label(doc = "The appimagetool closure.", cfg = "exec", default = "@dx_appimage_tools//:tools"), - "_x86_64": attr.label(default = "@platforms//cpu:x86_64"), - }, + } | PLATFORM_ATTRS, + cfg = platform_transition, ) def appimage_package(name, target_compatible_with = [], **kwargs): diff --git a/docs/cli/commands/generate.md b/docs/cli/commands/generate.md index bc6eb2ae4a..e42707b969 100644 --- a/docs/cli/commands/generate.md +++ b/docs/cli/commands/generate.md @@ -76,7 +76,7 @@ Set directives as `# gazelle: ` comments in a `BUILD` file. They ap | `dx_external []` | Name the manifest or lockfile that third-party imports resolve through. | | `dx_rust_corpus true\|false` | Turn the Rust corpus targets on or off. | | `dx_rust_crates_hub ` | Load `aliases` and `all_crate_deps` for Cargo packages from the crate_universe hub `@` instead of `@crates`. The package needs a `BUILD` file. | -| `dx_cuda_platforms ...` | Set `platforms` of a generated `cuda_library`. Required for `.cu` and `.cuh` files. | +| `dx_cuda_archs ...` | Set `cuda_archs` of a generated `cuda_library`. Required for `.cu` and `.cuh` files. | | `dx_fixture_testonly true\|false` | Mark generated libraries under a `tests/`, `fixtures/` or `testdata/` directory `testonly`. Off by default. Inherited by child packages. | | `lang ` | Must list `dx_dispatch`, for example `go,dx_dispatch`. | diff --git a/families/android/README.md b/families/android/README.md index a520ad6dba..33f87d3834 100644 --- a/families/android/README.md +++ b/families/android/README.md @@ -123,7 +123,8 @@ rust_android_apk( The package links one `lib//lib_bin.so` per ABI from the static native deps and signs the APK with the debug key. Builds never use a release key. Build `:app_apk` for the installable `app_apk.apk`; -it selects the platforms named in `platforms`, and an unknown ABI fails. The +it builds for the platform labels in `platforms`, `//platforms:arm64-v8a` and +`//platforms:x86_64` by default, and any other label fails. Do not set it with `select()`. The native deps need `alwayslink = True` so `ANativeActivity_onCreate` stays exported, and `-landroid -llog` as link options when they use the NDK APIs. The default manifest launches a `NativeActivity` loading that @@ -226,7 +227,7 @@ load("@rules_dx_android//packaging:defs.bzl", "android_check") android_check( name = "aab_check", package = ":app_apk_aab_file", - platforms = ["arm64-v8a", "x86_64"], + platforms = ["@rules_dx_android//platforms:arm64-v8a", "@rules_dx_android//platforms:x86_64"], resources = ["string/app_name"], ) ``` @@ -234,7 +235,7 @@ android_check( | Attribute | Default | Meaning | | --- | --- | --- | | `package` | required | The `.apk` or `.aab` to check. | -| `platforms` | `[]` | ABIs that must ship a `base/lib//*.so`. App Bundles only. | +| `platforms` | `[]` | Platform labels whose ABI must ship a `base/lib//*.so`. App Bundles only. | | `resources` | `[]` | `type/name` resources the bundle must resolve. App Bundles only. | | `size`, `tags`, `visibility` | `"small"`, none, none | Passed to the test. | diff --git a/families/android/packaging/BUILD.bazel b/families/android/packaging/BUILD.bazel index c8a2af7711..c926471f68 100644 --- a/families/android/packaging/BUILD.bazel +++ b/families/android/packaging/BUILD.bazel @@ -76,19 +76,19 @@ failure_test( rust_android_apk( name = "bad_abi", app_id = "com.example.app", - platforms = ["mips"], + platforms = ["//platforms:mips"], deps = [], ) failure_test( name = "bad_abi_test", - expected_failure_substring = "abi 'mips' is unknown", + expected_failure_substring = "//platforms:mips' is unknown", target = ":bad_abi", ) failure_test( name = "bad_abi_aab_file_test", - expected_failure_substring = "abi 'mips' is unknown", + expected_failure_substring = "//platforms:mips' is unknown", target = ":bad_abi_aab_file", ) @@ -129,8 +129,8 @@ rust_android_apk( name = "bad_dup_abis", app_id = "com.example.app", platforms = [ - "x86_64", - "x86_64", + "//platforms:x86_64", + "//platforms:x86_64", ], deps = [], ) @@ -246,13 +246,13 @@ failure_test( android_check( name = "bad_abi_aab_check", package = "//tests/fixtures/rust_apk:dummy.apk", - platforms = ["mips"], + platforms = ["//platforms:mips"], tags = ["manual"], ) failure_test( name = "bad_abi_aab_check_test", - expected_failure_substring = "abi 'mips' is unknown", + expected_failure_substring = "//platforms:mips' is unknown", target = ":bad_abi_aab_check_selection", ) diff --git a/families/android/packaging/defs.bzl b/families/android/packaging/defs.bzl index fb36ec6032..2e9e04a838 100644 --- a/families/android/packaging/defs.bzl +++ b/families/android/packaging/defs.bzl @@ -9,7 +9,7 @@ load("@rules_shell//shell:sh_binary.bzl", "sh_binary") load("@rules_shell//shell:sh_test.bzl", "sh_test") load("//platforms:defs.bzl", "api_floor") load("//sdk:repos.bzl", "BUILD_TOOLS", "SDK_PLATFORM") -load(":repos.bzl", "abi_errors", "abi_platforms", "app_id_errors", "manifest_lib_name") +load(":repos.bzl", "ABI_PLATFORMS", "abi_errors", "abi_platforms", "app_id_errors", "manifest_lib_name") load(":validate.bzl", "android_aab_check_errors", "android_apk_manifest_errors", "android_apk_set_errors", "android_release_sign_errors", "rust_android_apk_errors") _TARGET_SDK = SDK_PLATFORM.removeprefix("android-") @@ -141,11 +141,19 @@ _apk_manifest = rule( outputs = {"manifest": "%{name}.xml"}, ) +def abis_for_platforms(platforms): + """Returns the ABI name of each platform label; an unknown label stays as its text for abi_errors.""" + if type(platforms) != "list": + return platforms + by_label = {label: abi for abi, label in ABI_PLATFORMS.items()} + labels = [str(native.package_relative_label(platform)) for platform in platforms] + return [by_label.get(label, label) for label in labels] + def rust_android_apk( name, app_id, deps, - platforms = ["arm64-v8a", "x86_64"], + platforms = [Label("//platforms:arm64-v8a"), Label("//platforms:x86_64")], activity = "android.app.NativeActivity", api_level = 0, assets = [], @@ -161,11 +169,12 @@ def rust_android_apk( **kwargs): """Packages one APK and one unsigned App Bundle from native CcInfo deps with a Rust entry point.""" inner = ":" + name + "_bin" + abis = abis_for_platforms(platforms) package = custom_package if custom_package != "" else app_id effective_api = api_level if api_level != 0 else api_floor() _apk_validation( name = name + "_validation", - abis = platforms, + abis = abis, api_level = api_level, apk_name = name, app_id = app_id, @@ -200,8 +209,8 @@ def rust_android_apk( tags = ["manual"], visibility = visibility, ) - plain = not _has_select([platforms, app_id, api_level, version_code]) - invalid = plain and len(rust_android_apk_errors(name, app_id, platforms, api_level, version_code)) > 0 + plain = not _has_select([abis, app_id, api_level, version_code]) + invalid = plain and len(rust_android_apk_errors(name, app_id, abis, api_level, version_code)) > 0 android_application( name = name + "_bundle", base_module = inner, @@ -212,7 +221,7 @@ def rust_android_apk( ) _aab_file( name = name + "_aab_file", - abis = platforms, + abis = abis, src = None if invalid else ":" + name + "_bundle", validation = ":" + name + "_validation", tags = ["manual"], @@ -233,7 +242,7 @@ def rust_android_apk( ) _rust_android_apk( name = name, - abis = platforms, + abis = abis, binary = None if invalid else inner, testonly = testonly, validation = ":" + name + "_validation", @@ -640,17 +649,18 @@ _check_selection = rule( def android_check(name, package, platforms = [], resources = [], size = "small", tags = None, target_compatible_with = None, visibility = None): """Declares a test that the package is an unsigned APK or a valid App Bundle.""" + abis = abis_for_platforms(platforms) _check_selection( name = name + "_selection", package = package, - abis = platforms, + abis = abis, resources = resources, tags = ["manual"], target_compatible_with = target_compatible_with, visibility = ["//visibility:private"], ) args = ["$(rootpath " + str(_BUNDLETOOL) + ")", "$(rootpath " + package + ")"] - for abi in platforms: + for abi in abis: args.extend(["--abi", abi]) for resource in resources: args.extend(["--resource", resource]) diff --git a/families/android/tests/fixtures/consumer_android/BUILD.bazel b/families/android/tests/fixtures/consumer_android/BUILD.bazel index 198631f591..24cd19074e 100644 --- a/families/android/tests/fixtures/consumer_android/BUILD.bazel +++ b/families/android/tests/fixtures/consumer_android/BUILD.bazel @@ -36,8 +36,8 @@ cc_library( rust_android_apk( name = "consumer_android_apk", platforms = [ - "arm64-v8a", - "x86_64", + "@rules_dx_android//platforms:arm64-v8a", + "@rules_dx_android//platforms:x86_64", ], api_level = 31, app_id = "com.example.consumer_android", diff --git a/families/android/tests/fixtures/rust_apk/BUILD.bazel b/families/android/tests/fixtures/rust_apk/BUILD.bazel index a81ac13789..47be3c3499 100644 --- a/families/android/tests/fixtures/rust_apk/BUILD.bazel +++ b/families/android/tests/fixtures/rust_apk/BUILD.bazel @@ -56,7 +56,7 @@ rust_android_apk( assets = glob(["assets/**"]), assets_dir = "assets", permissions = ["android.permission.INTERNET"], - platforms = ["arm64-v8a"], + platforms = ["//platforms:arm64-v8a"], resource_files = glob(["res/**"]), deps = [":app_jni"], ) @@ -96,7 +96,7 @@ genrule( android_check( name = "check_test_bundle_test", package = ":test_bundle.aab", - platforms = ["x86_64"], + platforms = ["//platforms:x86_64"], ) android_apk_set( @@ -149,7 +149,7 @@ rust_android_apk( "android.permission.ACCESS_NETWORK_STATE", "android.permission.VIBRATE", ], - platforms = ["x86_64"], + platforms = ["//platforms:x86_64"], resource_files = glob(["res/**"]), version_code = 7, version_name = "2.3", @@ -248,8 +248,8 @@ android_check( name = "check_app_aab_test", package = ":app_apk_aab_file", platforms = [ - "arm64-v8a", - "x86_64", + "//platforms:arm64-v8a", + "//platforms:x86_64", ], resources = ["string/app_name"], target_compatible_with = [ @@ -270,8 +270,8 @@ android_check( name = "check_app_aab_starlark_flag_test", package = ":app_apk_aab_file_x86_64_flag", platforms = [ - "arm64-v8a", - "x86_64", + "//platforms:arm64-v8a", + "//platforms:x86_64", ], target_compatible_with = [ "@platforms//os:linux", diff --git a/families/apple/README.md b/families/apple/README.md index ddb7e9b0c2..287a1a7fa7 100644 --- a/families/apple/README.md +++ b/families/apple/README.md @@ -540,7 +540,7 @@ rust_static_library( apple_macos_app( name = "ledger", srcs = ["main.m"], - platforms = ["arm64"], + platform = "@rules_dx_apple//platforms:macos_arm64", bundle_id = "com.example.ledger", version = "1.0", deployment = "14.0", @@ -550,7 +550,8 @@ apple_macos_app( ) ``` -`srcs` holds the native entry point. `library` is any target with +`platform` is optional and defaults to the current target platform; only +`macos_arm64` is accepted. `srcs` holds the native entry point. `library` is any target with `CcInfo` that links one static archive, such as `rust_static_library`. The app needs `srcs`, `library`, or both. `frameworks` takes frameworks `macos_dynamic_framework` targets, checked by bundle name under @@ -612,7 +613,7 @@ Building signs ad hoc only, whatever `--macos_signing_cert_name` says. Failures read: -- `apple_macos_app: platforms takes one of arm64` +- `apple_macos_app: arch 'x86_64' is outside macos: want arm64` - `apple_macos_app: deployment '13.0' is below 14.0` - `apple_macos_app: plugin '//app:empty' places nothing under PlugIns` - `apple_macos_app: deployment '16.0' is above the Xcode 16 'macosx' ceiling 15.0` diff --git a/families/apple/macos/BUILD.bazel b/families/apple/macos/BUILD.bazel index f3923082f2..bf4947f7cb 100644 --- a/families/apple/macos/BUILD.bazel +++ b/families/apple/macos/BUILD.bazel @@ -117,14 +117,14 @@ apple_macos_app( srcs = ["main.m"], bundle_id = "com.example.ledger", deployment = "14.0", - platforms = ["x86_64"], + platform = "//platforms:macos_x86_64", tags = ["manual"], version = "1.0", ) failure_test( name = "x86_app_test", - expected_failure_substring = "apple_macos_app: platforms takes one of arm64", + expected_failure_substring = "apple_macos_app: arch 'x86_64' is outside macos: want arm64", target = ":x86_app_selection", ) diff --git a/families/apple/macos/app.bzl b/families/apple/macos/app.bzl index b211ab3753..01a9c62236 100644 --- a/families/apple/macos/app.bzl +++ b/families/apple/macos/app.bzl @@ -7,11 +7,11 @@ load("@rules_apple//apple:versioning.bzl", "apple_bundle_version") load("@rules_cc//cc:objc_library.bzl", "objc_library") load("@rules_cc//cc/common:cc_common.bzl", "cc_common") load("@rules_cc//cc/common:cc_info.bzl", "CcInfo") +load("@rules_dx//libs/starlark:platform.bzl", "PLATFORM_ATTRS", "platform_identity") load("@rules_dx//libs/starlark:resources.bzl", "dx_heavy_resources") load("@rules_dx//libs/starlark:rlocation.bzl", "rlocation_path") load("//bundle:defs.bzl", "TOOL_PATH", "adhoc_signing_transition", "archives", "check_cell", "display", "flat_resources", "label_text", "resolved_xcode") -load("//bundle:validate.bzl", "bundle_platform_errors") -load(":validate.bzl", "MACOS_ARCHES", "macos_app_errors") +load(":validate.bzl", "macos_app_errors") _CELL = "macos/arm64" @@ -37,12 +37,16 @@ _INFO_PLIST = """ """ +def _macho_arch(ctx): + """Returns the Mach-O arch name of the platform, or "" when it is not a macOS platform.""" + identity = platform_identity(ctx) + if identity.os != "macos": + return "" + return {"aarch64": "arm64", "x86_64": "x86_64"}.get(identity.cpu, "") + def _macos_selection_impl(ctx): - selected = bundle_platform_errors("apple_macos_app", list(ctx.attr.platforms), MACOS_ARCHES) - if len(selected) > 0: - fail("; ".join(selected)) failures = macos_app_errors(struct( - arch = ctx.attr.arch, + arch = _macho_arch(ctx), bundle_id = ctx.attr.bundle_id, deployment = ctx.attr.deployment, entitlements = ctx.attr.entitlements, @@ -63,20 +67,18 @@ _macos_selection = rule( implementation = _macos_selection_impl, doc = "Fails analysis when a macOS app declaration is invalid.", attrs = { - "arch": attr.string(doc = "Target CPU architecture of the app.", mandatory = True), "bundle_id": attr.string(doc = "Reverse DNS bundle identifier of the app.", mandatory = True), "deployment": attr.string(doc = "Minimum macOS version the app supports.", mandatory = True), "entitlements": attr.string(doc = "Entitlements label text, which building rejects.", mandatory = True), "framework_imports": attr.string_list(doc = "Label texts of embedded frameworks.", mandatory = True), "library": attr.string(doc = "Label text of the Rust library the app links.", mandatory = True), - "platforms": attr.string_list(doc = "The one architecture the app is built for.", mandatory = True), "plugins": attr.string_list(doc = "Label texts of plugins placed under PlugIns.", mandatory = True), "provisioning_profile": attr.string(doc = "Provisioning profile label text, which building rejects.", mandatory = True), "resources": attr.string_list(doc = "Label texts of resource files bundled into the app.", mandatory = True), "srcs": attr.string_list(doc = "Label texts of native sources, including the entry point.", mandatory = True), "version": attr.string(doc = "Bundle version string of the app.", mandatory = True), "xcode_version": attr.string(doc = "Xcode version the app build is pinned to.", mandatory = True), - }, + } | PLATFORM_ATTRS, ) def _has(ctx, constraint): @@ -213,7 +215,7 @@ def _macos_app_check_impl(ctx): info.bundle_id, ctx.attr.version, ctx.attr.deployment, - ctx.attr.arch, + _macho_arch(ctx), xcode, str(xcode_config.sdk_version_for_platform(apple_common.platform.macos)), _lines(_framework_names(ctx.attr.frameworks)), @@ -264,7 +266,6 @@ _macos_app_check = rule( mandatory = True, providers = [AppleBundleInfo], ), - "arch": attr.string(doc = "Architecture every Mach-O file of the app must carry.", mandatory = True), "deployment": attr.string(doc = "Minimum macOS version the app supports.", mandatory = True), "frameworks": attr.label_list( doc = "Frameworks the bundle must embed under Frameworks.", @@ -287,7 +288,7 @@ _macos_app_check = rule( fragment = "apple", ), ), - }, + } | PLATFORM_ATTRS, executable = True, fragments = ["apple"], ) @@ -305,7 +306,7 @@ def apple_macos_app( bundle_id = "", version = "", deployment = "", - platforms = ["arm64"], + platform = None, xcode_version = "", entitlements = None, provisioning_profile = None, @@ -313,11 +314,9 @@ def apple_macos_app( testonly = False, visibility = None): """Builds one upstream macOS application over a Rust library, checked and ad hoc signed.""" - arch = platforms[0] if len(platforms) == 1 else "" _macos_selection( name = name + "_selection", - arch = arch, - platforms = platforms, + platform = platform, bundle_id = bundle_id, deployment = deployment, entitlements = label_text(entitlements), @@ -392,7 +391,7 @@ def apple_macos_app( _macos_app_check( name = name, app = ":" + name + "_bundle", - arch = arch, + platform = platform, deployment = deployment, frameworks = frameworks, plugins = plugins, diff --git a/families/apple/macos/app_tests.bzl b/families/apple/macos/app_tests.bzl index f3decc45e3..d5590bf2f6 100644 --- a/families/apple/macos/app_tests.bzl +++ b/families/apple/macos/app_tests.bzl @@ -1,7 +1,7 @@ """macOS application selection coverage.""" load("@rules_dx//libs/starlark:defs.bzl", "expect_equal", "starlark_test") -load("//bundle:validate.bzl", "bundle_id_errors", "bundle_platform_errors", "bundle_version_errors") +load("//bundle:validate.bzl", "bundle_id_errors", "bundle_version_errors") load(":app.bzl", "owner_relative_path") load(":validate.bzl", "macos_app_errors", "macos_default_app", "macos_plugin_errors") @@ -85,11 +85,6 @@ def _app_checks(): macos_app_errors(_app(arch = "x86_64")), ["apple_macos_app: arch 'x86_64' is outside macos: want arm64"], )) - checks.append(expect_equal( - "two platforms fail", - bundle_platform_errors("apple_macos_app", ["arm64", "x86_64"], ["arm64"]), - ["apple_macos_app: platforms takes one of arm64"], - )) checks.append(expect_equal( "provisioning profile fails", macos_app_errors(_app(provisioning_profile = "ledger.provisionprofile")), diff --git a/families/apple/platforms/BUILD.bazel b/families/apple/platforms/BUILD.bazel new file mode 100644 index 0000000000..063721da6d --- /dev/null +++ b/families/apple/platforms/BUILD.bazel @@ -0,0 +1,17 @@ +package(default_visibility = ["//visibility:public"]) + +platform( + name = "macos_arm64", + constraint_values = [ + "@platforms//cpu:arm64", + "@platforms//os:macos", + ], +) + +platform( + name = "macos_x86_64", + constraint_values = [ + "@platforms//cpu:x86_64", + "@platforms//os:macos", + ], +) diff --git a/families/cuda/README.md b/families/cuda/README.md index a620a034c0..82ed71eb7e 100644 --- a/families/cuda/README.md +++ b/families/cuda/README.md @@ -53,7 +53,7 @@ cuda_library( name = "kernels", srcs = ["saxpy.cu"], hdrs = ["saxpy.cuh", "saxpy.h"], - platforms = ["compute_89:compute_89,sm_89", "sm_120"], + cuda_archs = ["compute_89:compute_89,sm_89", "sm_120"], ) ``` @@ -63,7 +63,7 @@ cuda_library( and `visibility` work as for `cc_library`. The CUDA runtime links statically. - `cuda_binary`: a `cc_binary`. Its `.cu` and `.cuh` sources go through a - `cuda_library` with the same `platforms`. The other sources compile as C++. + `cuda_library` with the same `cuda_archs`. The other sources compile as C++. - `cuda_test`: the same as `cuda_binary`, as a `cc_test`. `defines` and `local_defines` on `cuda_binary` and `cuda_test` apply to all @@ -78,7 +78,7 @@ to nvcc. `__device__` functions can call across `.cu` files and across libraries. `rdc` supports `sm_` archs. -`platforms` is required on all four. Each entry is one of: +`cuda_archs` is required on all four. Each entry is one of: - `sm_XY`: SASS for compute capability X.Y. - `compute_XY`: PTX for X.Y, compiled for the device at load time. @@ -104,7 +104,7 @@ failing. rules_dx patches rules_cuda 0.4.0-beta1 for the windows-arm64 toolkit | --- | --- | | `dx_cuda: the CUDA Toolkit EULA (https://docs.nvidia.com/cuda/eula/index.html) is not accepted; add cuda_license.license(accept = ["cuda-eula"]) to the root MODULE.bazel` | Add the license tag to the root `MODULE.bazel`. | | `dx_cuda: unknown license ''; the only one is 'cuda-eula'` | Accept `cuda-eula`. | -| `dx_cuda: platforms is empty; set platforms, for example platforms = ["sm_89"]` | Set `platforms`. | +| `dx_cuda: cuda_archs is empty; set cuda_archs, for example cuda_archs = ["sm_89"]` | Set `cuda_archs`. | | `dx_cuda: arch '' is not supported by nvcc 13.4; supported: ...` | Use an arch from the list. | | `dx_cuda: @rules_cuda//cuda:compiler is ''; dx CUDA targets compile with nvcc only` | Remove the `@rules_cuda//cuda:compiler` setting. | | `dx_cuda: the CUDA toolkit is not the pinned redistributable (nvcc at ''); declare the cuda.redist_json and cuda.toolkit tags from the dx CUDA README` | Add the `cuda.redist_json` and `cuda.toolkit` tags from Setup. | @@ -125,7 +125,7 @@ Depend on the license-gated labels: cuda_library( name = "gemm", srcs = ["gemm.cu"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], deps = ["@rules_dx_cuda//components:cublas"], # or :cufft, :curand ) ``` @@ -147,7 +147,7 @@ load("@rules_dx_cuda//rules:defs.bzl", "cuda_test") cuda_test( name = "saxpy_gpu_test", srcs = ["saxpy_gpu_test.cu"], - platforms = ["compute_89:compute_89,sm_89", "sm_120"], + cuda_archs = ["compute_89:compute_89,sm_89", "sm_120"], min_compute_capability = "8.9", min_driver = "13.0", tags = ["manual"], @@ -167,9 +167,9 @@ when a kernel launch fails. Return 0. Set `min_compute_capability` and `min_driver` on `cuda_test` to run it on a GPU. Set both. -- `platforms`: required arch specs, as for `cuda_library`. +- `cuda_archs`: required arch specs, as for `cuda_library`. - `min_compute_capability`: lowest device compute capability, `X.Y`. - It must be at least the lowest arch in `platforms`. + It must be at least the lowest arch in `cuda_archs`. - `min_driver`: lowest CUDA driver version, `X.Y`, from `13.0` to `13.4`. The runtime version is always the pinned toolkit, 13.4. diff --git a/families/cuda/rules/BUILD.bazel b/families/cuda/rules/BUILD.bazel index 4b10f8cd9f..6f51bf4558 100644 --- a/families/cuda/rules/BUILD.bazel +++ b/families/cuda/rules/BUILD.bazel @@ -151,8 +151,8 @@ dx_wrapper_contract_tests( [], ), expect_true( - "empty platforms fail", - "platforms is empty" in arch_errors([])[0], + "empty cuda_archs fail", + "cuda_archs is empty" in arch_errors([])[0], ), expect_true( "sm_70 fails", @@ -226,7 +226,7 @@ dx_wrapper_contract_tests( ), expect_true( "cc below the lowest arch fails", - "below the lowest arch in platforms (8.9)" in gpu_requirement_errors(_SAXPY_ARCHS, "8.6", "13.0")[0], + "below the lowest arch in cuda_archs (8.9)" in gpu_requirement_errors(_SAXPY_ARCHS, "8.6", "13.0")[0], ), expect_true( "malformed cc fails", diff --git a/families/cuda/rules/defs.bzl b/families/cuda/rules/defs.bzl index 11e24bd2e9..7367dc6ba4 100644 --- a/families/cuda/rules/defs.bzl +++ b/families/cuda/rules/defs.bzl @@ -100,15 +100,15 @@ def cuda_split_srcs(srcs): host.append(src) return device, host -def cuda_library(name, srcs, platforms, hdrs = None, visibility = None, tags = None, target_compatible_with = None, rdc = False, **kwargs): - """Minimal wrapper over rules_cuda cuda_library; platforms is required and rdc enables relocatable device code.""" +def cuda_library(name, srcs, cuda_archs, hdrs = None, visibility = None, tags = None, target_compatible_with = None, rdc = False, **kwargs): + """Minimal wrapper over rules_cuda cuda_library; cuda_archs is required and rdc enables relocatable device code.""" features = _cuda_features(kwargs.pop("features", None)) compatible = cuda_target_compatible_with(target_compatible_with) _cuda_library( name = name + "_upstream", srcs = srcs, hdrs = hdrs or [], - archs = platforms, + archs = cuda_archs, rdc = rdc, tags = dx_upstream_tags(tags), target_compatible_with = compatible + _UPSTREAM_ONLY_UNDER_TRANSITION, @@ -118,7 +118,7 @@ def cuda_library(name, srcs, platforms, hdrs = None, visibility = None, tags = N ) cuda_check( name = name + "_cuda_check", - archs = platforms, + archs = cuda_archs, tags = ["manual"], target_compatible_with = compatible, testonly = kwargs.get("testonly", None), @@ -141,7 +141,7 @@ def cuda_library(name, srcs, platforms, hdrs = None, visibility = None, tags = N **forward_kwargs ) -def cuda_objects(name, srcs, platforms, hdrs = None, deps = None, visibility = None, tags = None, target_compatible_with = None, **kwargs): +def cuda_objects(name, srcs, cuda_archs, hdrs = None, deps = None, visibility = None, tags = None, target_compatible_with = None, **kwargs): """Compiles .cu sources to relocatable device objects for the deps of an rdc cuda_library, cuda_binary or cuda_test.""" features = _cuda_features(kwargs.pop("features", None)) compatible = cuda_target_compatible_with(target_compatible_with) @@ -149,7 +149,7 @@ def cuda_objects(name, srcs, platforms, hdrs = None, deps = None, visibility = N name = name + "_upstream", srcs = srcs, hdrs = hdrs or [], - archs = platforms, + archs = cuda_archs, deps = list(deps or []) + [Label("@rules_cuda//cuda:runtime")], tags = dx_upstream_tags(tags), target_compatible_with = compatible + _UPSTREAM_ONLY_UNDER_TRANSITION, @@ -159,7 +159,7 @@ def cuda_objects(name, srcs, platforms, hdrs = None, deps = None, visibility = N ) cuda_check( name = name + "_cuda_check", - archs = platforms, + archs = cuda_archs, tags = ["manual"], target_compatible_with = compatible, testonly = kwargs.get("testonly", None), @@ -182,14 +182,14 @@ def cuda_objects(name, srcs, platforms, hdrs = None, deps = None, visibility = N **forward_kwargs ) -def _cuda_executable(cc_rule, name, srcs, platforms, deps, hdrs, visibility, tags, target_compatible_with, kwargs, library_tags = None, rdc = False, cuda_copts = None): +def _cuda_executable(cc_rule, name, srcs, cuda_archs, deps, hdrs, visibility, tags, target_compatible_with, kwargs, library_tags = None, rdc = False, cuda_copts = None): device, host = cuda_split_srcs(srcs) compatible = cuda_target_compatible_with(target_compatible_with) cuda_library( name = name + "_cuda", srcs = device, hdrs = hdrs, - platforms = platforms, + cuda_archs = cuda_archs, rdc = rdc, deps = deps, defines = kwargs.get("defines", []), @@ -210,9 +210,9 @@ def _cuda_executable(cc_rule, name, srcs, platforms, deps, hdrs, visibility, tag **kwargs ) -def cuda_binary(name, srcs, platforms, deps = None, hdrs = None, visibility = None, tags = None, target_compatible_with = None, rdc = False, cuda_copts = None, **kwargs): +def cuda_binary(name, srcs, cuda_archs, deps = None, hdrs = None, visibility = None, tags = None, target_compatible_with = None, rdc = False, cuda_copts = None, **kwargs): """Compiles .cu sources with nvcc and links them into a cc_binary; cuda_copts go to nvcc.""" - _cuda_executable(_cc_binary, name, srcs, platforms, deps, hdrs, visibility, tags, target_compatible_with, kwargs, rdc = rdc, cuda_copts = cuda_copts) + _cuda_executable(_cc_binary, name, srcs, cuda_archs, deps, hdrs, visibility, tags, target_compatible_with, kwargs, rdc = rdc, cuda_copts = cuda_copts) _GPU_TAGS = ["exclusive", "external", "local", "requires-gpu"] @@ -224,7 +224,7 @@ def cuda_gpu_env(min_compute_capability, min_driver): "DX_GPU_RUNTIME": CUDA_VERSION, } -def cuda_test(name, srcs, platforms, deps = None, hdrs = None, visibility = None, tags = None, target_compatible_with = None, rdc = False, min_compute_capability = None, min_driver = None, env = None, data = None, cuda_copts = None, **kwargs): +def cuda_test(name, srcs, cuda_archs, deps = None, hdrs = None, visibility = None, tags = None, target_compatible_with = None, rdc = False, min_compute_capability = None, min_driver = None, env = None, data = None, cuda_copts = None, **kwargs): """Compiles .cu sources into a cc_test; min_compute_capability and min_driver make it a GPU test, cuda_copts go to nvcc.""" if (min_compute_capability == None) != (min_driver == None): fail("cuda_test //{}:{}: set both min_compute_capability and min_driver for a GPU test".format(native.package_name(), name)) @@ -234,12 +234,12 @@ def cuda_test(name, srcs, platforms, deps = None, hdrs = None, visibility = None if data != None: kwargs["data"] = data kwargs["testonly"] = True - _cuda_executable(_cc_test, name, srcs, platforms, deps, hdrs, visibility, tags, target_compatible_with, kwargs, rdc = rdc, cuda_copts = cuda_copts) + _cuda_executable(_cc_test, name, srcs, cuda_archs, deps, hdrs, visibility, tags, target_compatible_with, kwargs, rdc = rdc, cuda_copts = cuda_copts) return compatible = cuda_target_compatible_with(target_compatible_with) cuda_gpu_check( name = name + "_gpu_check", - archs = platforms, + archs = cuda_archs, min_compute_capability = min_compute_capability, min_driver = min_driver, tags = ["manual"], @@ -255,7 +255,7 @@ def cuda_test(name, srcs, platforms, deps = None, hdrs = None, visibility = None _cc_test, name, srcs, - platforms, + cuda_archs, list(deps or []) + [Label("//testing:gpu_main")], hdrs, visibility, diff --git a/families/cuda/testing/BUILD.bazel b/families/cuda/testing/BUILD.bazel index eba0e5adaf..9200057e0b 100644 --- a/families/cuda/testing/BUILD.bazel +++ b/families/cuda/testing/BUILD.bazel @@ -18,7 +18,7 @@ cuda_library( testonly = True, srcs = ["gpu_main.cu"], hdrs = ["gpu_test.h"], - platforms = ["compute_75"], + cuda_archs = ["compute_75"], deps = [":gpu_facts"], ) diff --git a/families/cuda/tests/BUILD.bazel b/families/cuda/tests/BUILD.bazel index 36ad7c902a..2163e9483d 100644 --- a/families/cuda/tests/BUILD.bazel +++ b/families/cuda/tests/BUILD.bazel @@ -30,7 +30,7 @@ rust_test( cuda_test( name = "saxpy_gpu_test", srcs = ["saxpy_gpu_test.cu"], - platforms = [ + cuda_archs = [ "compute_89:compute_89,sm_89", "sm_120", ], @@ -105,7 +105,7 @@ hermetic_toolchain_test( cuda_test( name = "rdc_gpu_test", srcs = ["rdc_gpu_test.cu"], - platforms = [ + cuda_archs = [ "sm_89", "sm_120", ], @@ -128,7 +128,7 @@ rust_test( ) cuda_gpu_check( - name = "gpu_cc_below_platforms", + name = "gpu_cc_below_cuda_archs", archs = ["sm_89"], min_compute_capability = "7.5", min_driver = "13.0", @@ -136,9 +136,9 @@ cuda_gpu_check( ) failure_test( - name = "gpu_cc_below_platforms_failure_test", - expected_failure_substring = "dx_cuda: min_compute_capability 7.5 is below the lowest arch in platforms (8.9)", - target = ":gpu_cc_below_platforms", + name = "gpu_cc_below_cuda_archs_failure_test", + expected_failure_substring = "dx_cuda: min_compute_capability 7.5 is below the lowest arch in cuda_archs (8.9)", + target = ":gpu_cc_below_cuda_archs", target_compatible_with = CUDA_TARGET, ) @@ -160,7 +160,7 @@ rust_test( cuda_test( name = "cublas_gpu_test", srcs = ["cublas_gpu_test.cu"], - platforms = [ + cuda_archs = [ "compute_89:compute_89,sm_89", "sm_120", ], @@ -209,23 +209,23 @@ gcc_hermetic_toolchain_test( ) cuda_library( - name = "missing_platforms", + name = "missing_cuda_archs", srcs = ["//tests/fixtures/saxpy:saxpy.cu"], - platforms = [], + cuda_archs = [], tags = ["manual"], ) failure_test( - name = "missing_platforms_failure_test", - expected_failure_substring = "dx_cuda: platforms is empty", - target = ":missing_platforms", + name = "missing_cuda_archs_failure_test", + expected_failure_substring = "dx_cuda: cuda_archs is empty", + target = ":missing_cuda_archs", target_compatible_with = CUDA_TARGET, ) cuda_library( name = "unsupported_arch", srcs = ["//tests/fixtures/saxpy:saxpy.cu"], - platforms = ["sm_70"], + cuda_archs = ["sm_70"], tags = ["manual"], ) diff --git a/families/cuda/tests/fixtures/cublas/BUILD.bazel b/families/cuda/tests/fixtures/cublas/BUILD.bazel index 7a15d52689..f7a7883574 100644 --- a/families/cuda/tests/fixtures/cublas/BUILD.bazel +++ b/families/cuda/tests/fixtures/cublas/BUILD.bazel @@ -7,7 +7,7 @@ cuda_library( name = "cublas", srcs = ["cublas_saxpy.cu"], hdrs = ["cublas_saxpy.h"], - platforms = [ + cuda_archs = [ "compute_89:compute_89,sm_89", "sm_120", ], diff --git a/families/cuda/tests/fixtures/cuda-app/gpu/BUILD.bazel b/families/cuda/tests/fixtures/cuda-app/gpu/BUILD.bazel index 097e8d74e7..229e777840 100644 --- a/families/cuda/tests/fixtures/cuda-app/gpu/BUILD.bazel +++ b/families/cuda/tests/fixtures/cuda-app/gpu/BUILD.bazel @@ -14,7 +14,7 @@ exports_files([ cuda_test( name = "gpu_test", srcs = ["gpu_test.cu"], - platforms = [ + cuda_archs = [ "compute_80:compute_80,sm_80", "sm_90", ], diff --git a/families/cuda/tests/fixtures/cuda-app/kernels/BUILD.bazel b/families/cuda/tests/fixtures/cuda-app/kernels/BUILD.bazel index 52b94f15a4..a6ed76521f 100644 --- a/families/cuda/tests/fixtures/cuda-app/kernels/BUILD.bazel +++ b/families/cuda/tests/fixtures/cuda-app/kernels/BUILD.bazel @@ -25,7 +25,7 @@ cuda_library( "common.cuh", "kernels.h", ], - platforms = [ + cuda_archs = [ "compute_80:compute_80,sm_80", "sm_90", ], diff --git a/families/cuda/tests/fixtures/rdc/BUILD.bazel b/families/cuda/tests/fixtures/rdc/BUILD.bazel index cb9a0dace4..e79eb2eba3 100644 --- a/families/cuda/tests/fixtures/rdc/BUILD.bazel +++ b/families/cuda/tests/fixtures/rdc/BUILD.bazel @@ -7,7 +7,7 @@ cuda_library( name = "scale", srcs = ["scale.cu"], hdrs = ["scale.cuh"], - platforms = [ + cuda_archs = [ "sm_89", "sm_120", ], @@ -18,7 +18,7 @@ cuda_library( name = "axpy", srcs = ["axpy.cu"], hdrs = ["axpy.h"], - platforms = [ + cuda_archs = [ "sm_89", "sm_120", ], @@ -37,7 +37,7 @@ cuda_objects( name = "scale_objects", srcs = ["scale.cu"], hdrs = ["scale.cuh"], - platforms = [ + cuda_archs = [ "sm_89", "sm_120", ], @@ -50,7 +50,7 @@ cuda_library( "axpy.h", "scale.cuh", ], - platforms = [ + cuda_archs = [ "sm_89", "sm_120", ], diff --git a/families/cuda/tests/fixtures/saxpy/BUILD.bazel b/families/cuda/tests/fixtures/saxpy/BUILD.bazel index 5194be90ff..887d1989dd 100644 --- a/families/cuda/tests/fixtures/saxpy/BUILD.bazel +++ b/families/cuda/tests/fixtures/saxpy/BUILD.bazel @@ -10,7 +10,7 @@ cuda_library( "saxpy.cuh", "saxpy.h", ], - platforms = [ + cuda_archs = [ "compute_89:compute_89,sm_89", "sm_120", ], diff --git a/families/cuda/toolchain/check.bzl b/families/cuda/toolchain/check.bzl index 4e8596236b..5d60e537ce 100644 --- a/families/cuda/toolchain/check.bzl +++ b/families/cuda/toolchain/check.bzl @@ -25,7 +25,7 @@ _TOOLCHAIN_TYPE = "@rules_cuda//cuda:toolchain_type" def arch_errors(archs): """Returns one error per arch spec token that the pinned nvcc does not support.""" if not archs: - return ["dx_cuda: platforms is empty; set platforms, for example platforms = [\"sm_89\"]"] + return ["dx_cuda: cuda_archs is empty; set cuda_archs, for example cuda_archs = [\"sm_89\"]"] errors = [] for spec in archs: for part in spec.replace(":", ",").split(","): @@ -61,7 +61,7 @@ def gpu_requirement_errors(archs, min_compute_capability, min_driver): if cc == None: errors.append("dx_cuda: min_compute_capability '" + str(min_compute_capability) + "' is not X.Y, for example \"8.9\"") elif lowest != None and cc < lowest: - errors.append("dx_cuda: min_compute_capability " + min_compute_capability + " is below the lowest arch in platforms (%d.%d)" % lowest) + errors.append("dx_cuda: min_compute_capability " + min_compute_capability + " is below the lowest arch in cuda_archs (%d.%d)" % lowest) driver = _version(min_driver) pinned = _version(CUDA_VERSION) floor = "%d.0" % pinned[0] diff --git a/families/msix/README.md b/families/msix/README.md index a7bca4e931..9a2a73e6b7 100644 --- a/families/msix/README.md +++ b/families/msix/README.md @@ -50,7 +50,7 @@ msix_package( identity_name = "Example.App", logo = "logo.png", notice = ["NOTICE.txt"], - platforms = ["arm64"], + platform = "@rules_dx_msix//platforms:windows_arm64", publisher = "CN=Example", version = "1.2.3.0", ) @@ -63,8 +63,8 @@ msix_sign( Attributes: -- `platforms`: `arm64` or `x86_64`. Builds the package and its `binary`, `libs` and `data` for - that architecture. Empty uses the current target platform. `target_compatible_with` only marks +- `platform`: a Windows platform label such as `@rules_dx_msix//platforms:windows_arm64`. Builds + the package and its `binary`, `libs` and `data` for it. Unset uses the current target platform. `target_compatible_with` only marks compatibility. Do not set it with `select()`. - `binary`: the `.exe`. Its target-configuration bytes are packaged at the package root. Every `.dll` in its runfiles, such as its `dynamic_deps`, is packaged next to it. @@ -106,7 +106,7 @@ bazel build //pkg:app bazel build //pkg:app --platforms=@rules_dx_msix//platforms:windows_arm64 ``` -The `platforms` attribute and `--platforms` do the same thing. +The `platform` attribute and `--platforms` do the same thing. The package digest changes between builds. The digests of the packaged files do not. diff --git a/families/msix/defs.bzl b/families/msix/defs.bzl index 3d339864ec..6e86898c27 100644 --- a/families/msix/defs.bzl +++ b/families/msix/defs.bzl @@ -1,9 +1,10 @@ """Windows MSIX packaging for target binaries.""" load("@rules_dx//powershell/rules:defs.bzl", "powershell_binary") -load("@rules_dx//libs/starlark:packaging.bzl", "claim_dest", "data_path", "platform_arch") +load("@rules_dx//libs/starlark:packaging.bzl", "claim_dest", "data_path") +load("@rules_dx//libs/starlark:platform.bzl", "PLATFORM_ATTRS", "platform_identity", "platform_transition") load(":pins.bzl", "MAX_VERSION_TESTED", "MIN_VERSION") -load(":validate.bzl", "PLATFORM_VALUES", "msix_alias_errors", "msix_application_errors", "msix_identity_errors", "msix_named_version_errors", "msix_platform_errors", "msix_publisher_errors", "msix_version_errors") +load(":validate.bzl", "msix_alias_errors", "msix_application_errors", "msix_identity_errors", "msix_named_version_errors", "msix_publisher_errors", "msix_version_errors") MsixInfo = provider( doc = "Identity of one MSIX package.", @@ -53,14 +54,8 @@ def _add(ctx, entries, seen, kind, dest, file): return True def _msix_impl(ctx): - errors = msix_platform_errors(ctx.attr.platforms) - if errors: - fail("msix_package " + str(ctx.label) + ": " + errors[0]) - cv = platform_common.ConstraintValueInfo - arch = platform_arch(ctx.target_platform_has_constraint, ctx.attr._windows[cv], [ - ("arm64", ctx.attr._arm64[cv]), - ("x64", ctx.attr._x86_64[cv]), - ]) + identity = platform_identity(ctx) + arch = {"aarch64": "arm64", "x86_64": "x64"}.get(identity.cpu, "") if identity.os == "windows" else "" if not arch: fail("msix_package " + str(ctx.label) + ": target cell this platform is unsupported: only windows_x86_64 and windows_arm64 are pinned") errors = ( @@ -169,17 +164,6 @@ def _msix_impl(ctx): ), ] -def _platforms_transition_impl(settings, attr): - if msix_platform_errors(attr.platforms) or not attr.platforms: - return {"//command_line_option:platforms": settings["//command_line_option:platforms"]} - return {"//command_line_option:platforms": [str(Label("//platforms:" + PLATFORM_VALUES[attr.platforms[0]]))]} - -_platforms_transition = transition( - implementation = _platforms_transition_impl, - inputs = ["//command_line_option:platforms"], - outputs = ["//command_line_option:platforms"], -) - _msix_package = rule( implementation = _msix_impl, doc = "Packages one Windows target binary and its files as an unsigned MSIX.", @@ -196,18 +180,14 @@ _msix_package = rule( "max_version_tested": attr.string(doc = "Highest Windows version tested.", default = MAX_VERSION_TESTED), "min_version": attr.string(doc = "Lowest Windows version supported.", default = MIN_VERSION), "notice": attr.label_list(doc = "License and NOTICE files placed under licenses/.", allow_files = True, mandatory = True, allow_empty = False), - "platforms": attr.string_list(doc = "One of arm64 or x86_64 to build the package for that architecture. Empty uses the current target platform. Do not set it with select()."), "publisher": attr.string(doc = "Publisher distinguished name. Must match the signing certificate subject.", mandatory = True), "publisher_display_name": attr.string(doc = "Publisher display name. Defaults to the publisher CN."), "version": attr.string(doc = "Four-part package version.", mandatory = True), - "_arm64": attr.label(default = "@platforms//cpu:arm64"), "_pack": attr.label(default = "//:pack.ps1", allow_single_file = True), "_pwsh": attr.label(default = "@rules_powershell//powershell:current_pwsh_toolchain", cfg = "exec"), - "_windows": attr.label(default = "@platforms//os:windows"), - "_x86_64": attr.label(default = "@platforms//cpu:x86_64"), - }, + } | PLATFORM_ATTRS, toolchains = [config_common.toolchain_type(TOOLCHAIN_TYPE, mandatory = False)], - cfg = _platforms_transition, + cfg = platform_transition, ) def _windowsonly_chars(target_compatible_with): diff --git a/families/msix/metadata_tests.bzl b/families/msix/metadata_tests.bzl index 75037674f6..58c177d17d 100644 --- a/families/msix/metadata_tests.bzl +++ b/families/msix/metadata_tests.bzl @@ -2,7 +2,7 @@ load("@rules_dx//libs/starlark:defs.bzl", "expect_contains", "expect_equal", "expect_true", "starlark_test") load(":defs.bzl", "compatible_with", "publisher_cn") -load(":validate.bzl", "msix_alias_errors", "msix_application_errors", "msix_identity_errors", "msix_named_version_errors", "msix_platform_errors", "msix_publisher_errors", "msix_version_errors") +load(":validate.bzl", "msix_alias_errors", "msix_application_errors", "msix_identity_errors", "msix_named_version_errors", "msix_publisher_errors", "msix_version_errors") load(":pins.bzl", "BUILDTOOLS_BIN", "BUILDTOOLS_SHA256", "BUILDTOOLS_URL", "BUILDTOOLS_VERSION", "LICENSE", "SUPPORTED_CELLS", "TOOL_ARCHES") load(":repos.bzl", "UNACCEPTED", "hub_build") @@ -35,12 +35,6 @@ def _checks(): expect_true("large version part", len(msix_version_errors("1.2.3.65536")) == 1), expect_true("text version part", len(msix_version_errors("1.2.x.0")) == 1), expect_true("empty version part", len(msix_version_errors("1..3.0")) == 1), - expect_equal("no platforms", msix_platform_errors([]), []), - expect_equal("arm64 platform", msix_platform_errors(["arm64"]), []), - expect_equal("x86_64 platform", msix_platform_errors(["x86_64"]), []), - expect_true("x86_32 platform", len(msix_platform_errors(["x86_32"])) == 1), - expect_true("two platforms", len(msix_platform_errors(["arm64", "x86_64"])) == 1), - expect_true("x64 platform", len(msix_platform_errors(["x64"])) == 1), expect_equal("good identity", msix_identity_errors("Contoso.App-2"), []), expect_true("short identity", len(msix_identity_errors("ab")) == 1), expect_true("identity with space", len(msix_identity_errors("Contoso App")) == 1), diff --git a/families/msix/tests/BUILD.bazel b/families/msix/tests/BUILD.bazel index eef67f3df9..c46f3cc378 100644 --- a/families/msix/tests/BUILD.bazel +++ b/families/msix/tests/BUILD.bazel @@ -215,7 +215,7 @@ msix_package( libs = [":cell_dll"], logo = "fixtures/logo.png", notice = ["fixtures/NOTICE.txt"], - platforms = ["arm64"], + platform = "//platforms:windows_arm64", publisher = "CN=Dx Cell, O=Dx", tags = ["manual"], version = "1.0.0.0", @@ -229,21 +229,7 @@ msix_package( libs = [":cell_dll"], logo = "fixtures/logo.png", notice = ["fixtures/NOTICE.txt"], - platforms = ["x86_64"], - publisher = "CN=Dx Cell, O=Dx", - tags = ["manual"], - version = "1.0.0.0", -) - -msix_package( - name = "bad_platforms", - binary = ":cell_exe", - data = ["fixtures/greeting.txt"], - identity_name = "Dx.Cell", - libs = [":cell_dll"], - logo = "fixtures/logo.png", - notice = ["fixtures/NOTICE.txt"], - platforms = ["x86_32"], + platform = "//platforms:windows_x86_64", publisher = "CN=Dx Cell, O=Dx", tags = ["manual"], version = "1.0.0.0", @@ -403,12 +389,6 @@ arch_on_arm64_test( target_under_test = ":cell_x86_64", ) -attribute_failure_test( - name = "bad_platforms_fails", - expected = "platforms takes one of arm64, x86_64", - target_under_test = ":bad_platforms", -) - arm64_action_test( name = "arm64_action_test", arch = "arm64", diff --git a/families/msix/validate.bzl b/families/msix/validate.bzl index 55f42f4534..9353448ca7 100644 --- a/families/msix/validate.bzl +++ b/families/msix/validate.bzl @@ -18,14 +18,6 @@ def msix_version_errors(version): """Returns why a package version is not four numbers up to 65535.""" return msix_named_version_errors("version", version) -PLATFORM_VALUES = {"arm64": "windows_arm64", "x86_64": "windows_x86_64"} - -def msix_platform_errors(platforms): - """Returns why a platforms value is not empty or one known architecture.""" - if len(platforms) == 0 or (len(platforms) == 1 and platforms[0] in PLATFORM_VALUES): - return [] - return ["platforms takes one of " + ", ".join(sorted(PLATFORM_VALUES))] - def msix_identity_errors(name): """Returns why a package identity name is invalid.""" if len(name) < 3 or len(name) > 50 or not only_chars(name, _LETTERS + _DIGITS + ".-"): diff --git a/gazelle/cc/cuda.go b/gazelle/cc/cuda.go index 3d332c328f..a4fa36a489 100644 --- a/gazelle/cc/cuda.go +++ b/gazelle/cc/cuda.go @@ -65,12 +65,12 @@ func generateCuda(args language.GenerateArgs, rep common.Reporter) language.Gene return language.GenerateResult{} } - var platforms []string + var archs []string if args.Config != nil { - platforms, _ = args.Config.Exts[platformsDirective].([]string) + archs, _ = args.Config.Exts[archsDirective].([]string) } - if len(platforms) == 0 { - rep.Fail(common.InPackage(args.Rel), "cc: %s: .cu/.cuh files need # gazelle:%s ...", args.Rel, platformsDirective) + if len(archs) == 0 { + rep.Fail(common.InPackage(args.Rel), "cc: %s: .cu/.cuh files need # gazelle:%s ...", args.Rel, archsDirective) return language.GenerateResult{} } @@ -121,7 +121,7 @@ func generateCuda(args language.GenerateArgs, rep common.Reporter) language.Gene if len(hdrs) > 0 { r.SetAttr("hdrs", hdrs) } - r.SetAttr("platforms", platforms) + r.SetAttr("cuda_archs", archs) if common.FixtureTestonly(args.Config, args.Rel) { r.SetAttr("testonly", true) } diff --git a/gazelle/cc/lang.go b/gazelle/cc/lang.go index a3eb8a263d..85f185f0d3 100644 --- a/gazelle/cc/lang.go +++ b/gazelle/cc/lang.go @@ -35,22 +35,22 @@ var ccKinds = map[string]rule.KindInfo{ }, } -const platformsDirective = "dx_cuda_platforms" +const archsDirective = "dx_cuda_archs" func configureCuda(c *config.Config, rel string, f *rule.File, rep common.Reporter) { if f == nil { return } for _, d := range f.Directives { - if d.Key != platformsDirective { + if d.Key != archsDirective { continue } - platforms := strings.Fields(d.Value) - if len(platforms) == 0 { - rep.Fail(common.InPackage(rel), "cc: %s: # gazelle:%s needs at least one arch", rel, platformsDirective) + archs := strings.Fields(d.Value) + if len(archs) == 0 { + rep.Fail(common.InPackage(rel), "cc: %s: # gazelle:%s needs at least one arch", rel, archsDirective) continue } - c.Exts[platformsDirective] = platforms + c.Exts[archsDirective] = archs } } @@ -63,7 +63,7 @@ func NewLanguage() language.Language { ExtraKinds: []string{CudaKind, TestKind}, KindDefs: map[string]string{CudaKind: "@rules_dx_cuda//rules:defs.bzl"}, IndexKinds: []string{CudaKind}, - Directives: []string{platformsDirective}, + Directives: []string{archsDirective}, ConfigureExt: configureCuda, ImportAttr: "hdrs", Identity: HeaderIdentity, diff --git a/gazelle/cc/lang_test.go b/gazelle/cc/lang_test.go index cc2a1dde5f..26be3c448b 100644 --- a/gazelle/cc/lang_test.go +++ b/gazelle/cc/lang_test.go @@ -261,7 +261,7 @@ func TestGenerateRootPackage(t *testing.T) { } } -func cudaFixture(t *testing.T, build string, platforms []string, files map[string]string) (language.Language, language.GenerateResult) { +func cudaFixture(t *testing.T, build string, archs []string, files map[string]string) (language.Language, language.GenerateResult) { t.Helper() root := t.TempDir() var regular []string @@ -270,8 +270,8 @@ func cudaFixture(t *testing.T, build string, platforms []string, files map[strin regular = append(regular, name) } cfg := &config.Config{RepoRoot: root, Exts: map[string]interface{}{}} - if platforms != nil { - cfg.Exts[platformsDirective] = platforms + if archs != nil { + cfg.Exts[archsDirective] = archs } var f *rule.File if build != "" { @@ -300,8 +300,8 @@ func TestCudaGenerateOwnedByDirectory(t *testing.T) { if got := strings.Join(r.AttrStrings("hdrs"), ","); got != "k.cuh" { t.Errorf("hdrs = %q", got) } - if got := strings.Join(r.AttrStrings("platforms"), "|"); got != "compute_89:compute_89,sm_89|sm_120" { - t.Errorf("platforms = %q", got) + if got := strings.Join(r.AttrStrings("cuda_archs"), "|"); got != "compute_89:compute_89,sm_89|sm_120" { + t.Errorf("cuda_archs = %q", got) } if len(res.Imports) != 1 { t.Errorf("imports = %v", res.Imports) @@ -313,7 +313,7 @@ func TestCudaMissingDirectiveRefuses(t *testing.T) { if len(res.Gen) != 0 { t.Fatalf("gen = %+v", res.Gen) } - wantRefusal(t, refusal(t, lang), "cc: pkg/demo: .cu/.cuh files need # gazelle:dx_cuda_platforms ...") + wantRefusal(t, refusal(t, lang), "cc: pkg/demo: .cu/.cuh files need # gazelle:dx_cuda_archs ...") } func TestCudaMainRefuses(t *testing.T) { @@ -322,19 +322,19 @@ func TestCudaMainRefuses(t *testing.T) { } func TestCudaBinaryNameClashRefuses(t *testing.T) { - lang, _ := cudaFixture(t, "cuda_binary(name = \"demo\", srcs = [\"main.cu\"], platforms = [\"sm_89\"])\n", []string{"sm_89"}, map[string]string{"main.cu": "int main() {}\n", "k.cu": "\n"}) + lang, _ := cudaFixture(t, "cuda_binary(name = \"demo\", srcs = [\"main.cu\"], cuda_archs = [\"sm_89\"])\n", []string{"sm_89"}, map[string]string{"main.cu": "int main() {}\n", "k.cu": "\n"}) wantRefusal(t, refusal(t, lang), "already creates demo_cuda") } func TestCudaOwnedFilesProduceNothing(t *testing.T) { - _, res := cudaFixture(t, "cuda_library(name = \"kernel\", srcs = [\"k.cu\"], hdrs = [\"k.cuh\"], platforms = [\"sm_89\"])\n", nil, map[string]string{"k.cu": "\n", "k.cuh": "\n"}) + _, res := cudaFixture(t, "cuda_library(name = \"kernel\", srcs = [\"k.cu\"], hdrs = [\"k.cuh\"], cuda_archs = [\"sm_89\"])\n", nil, map[string]string{"k.cu": "\n", "k.cuh": "\n"}) if len(res.Gen) != 0 || len(res.Empty) != 0 { t.Fatalf("result = %+v", res) } } func TestCudaStaleOwnedTargetIsEmptied(t *testing.T) { - _, res := cudaFixture(t, "cuda_library(name = \"demo_cuda\", srcs = [\"gone.cu\"], platforms = [\"sm_89\"])\ncuda_library(name = \"hand\", srcs = [\"h.cu\"])\n", nil, map[string]string{"h.cu": "\n"}) + _, res := cudaFixture(t, "cuda_library(name = \"demo_cuda\", srcs = [\"gone.cu\"], cuda_archs = [\"sm_89\"])\ncuda_library(name = \"hand\", srcs = [\"h.cu\"])\n", nil, map[string]string{"h.cu": "\n"}) if len(res.Gen) != 0 || len(res.Empty) != 1 || res.Empty[0].Name() != "demo_cuda" { t.Fatalf("result = %+v", res) } diff --git a/gazelle/cc/testdata/cuda_generate/README.md b/gazelle/cc/testdata/cuda_generate/README.md index dc3d3834c0..4b8a14ec6f 100644 --- a/gazelle/cc/testdata/cuda_generate/README.md +++ b/gazelle/cc/testdata/cuda_generate/README.md @@ -2,11 +2,11 @@ Verifies that Gazelle generates a `_cuda` `cuda_library` for `.cu` and `.cuh` files that no hand-written CUDA rule lists, using the arch list from the -`dx_cuda_platforms` directive. +`dx_cuda_archs` directive. The `newgpu` directory has no `BUILD` file, and its host `.cc` file gets a -dependency on the generated target. The `keepplatforms` directory shows that a -hand-edited `platforms` value survives later runs. The `multi` directory uses a +dependency on the generated target. The `keeparchs` directory shows that a +hand-edited `cuda_archs` value survives later runs. The `multi` directory uses a local directive with a spec that contains a comma. The `stale` directory loses its generated target when no CUDA files remain, while a hand-written target stays. diff --git a/gazelle/cc/testdata/cuda_generate/pkg/BUILD.in b/gazelle/cc/testdata/cuda_generate/pkg/BUILD.in index cea97e457f..ffc221e5a9 100644 --- a/gazelle/cc/testdata/cuda_generate/pkg/BUILD.in +++ b/gazelle/cc/testdata/cuda_generate/pkg/BUILD.in @@ -1 +1 @@ -# gazelle:dx_cuda_platforms sm_89 +# gazelle:dx_cuda_archs sm_89 diff --git a/gazelle/cc/testdata/cuda_generate/pkg/BUILD.out b/gazelle/cc/testdata/cuda_generate/pkg/BUILD.out index cea97e457f..ffc221e5a9 100644 --- a/gazelle/cc/testdata/cuda_generate/pkg/BUILD.out +++ b/gazelle/cc/testdata/cuda_generate/pkg/BUILD.out @@ -1 +1 @@ -# gazelle:dx_cuda_platforms sm_89 +# gazelle:dx_cuda_archs sm_89 diff --git a/gazelle/cc/testdata/cuda_generate/pkg/keepplatforms/BUILD.in b/gazelle/cc/testdata/cuda_generate/pkg/keeparchs/BUILD.in similarity index 60% rename from gazelle/cc/testdata/cuda_generate/pkg/keepplatforms/BUILD.in rename to gazelle/cc/testdata/cuda_generate/pkg/keeparchs/BUILD.in index 5c8f26a3e6..3b5f59bef0 100644 --- a/gazelle/cc/testdata/cuda_generate/pkg/keepplatforms/BUILD.in +++ b/gazelle/cc/testdata/cuda_generate/pkg/keeparchs/BUILD.in @@ -1,7 +1,7 @@ load("@rules_dx_cuda//rules:defs.bzl", "cuda_library") cuda_library( - name = "keepplatforms_cuda", + name = "keeparchs_cuda", srcs = ["a.cu"], - platforms = ["sm_120"], + cuda_archs = ["sm_120"], ) diff --git a/gazelle/cc/testdata/cuda_generate/pkg/keepplatforms/BUILD.out b/gazelle/cc/testdata/cuda_generate/pkg/keeparchs/BUILD.out similarity index 73% rename from gazelle/cc/testdata/cuda_generate/pkg/keepplatforms/BUILD.out rename to gazelle/cc/testdata/cuda_generate/pkg/keeparchs/BUILD.out index 01fc71721b..14f7e8865b 100644 --- a/gazelle/cc/testdata/cuda_generate/pkg/keepplatforms/BUILD.out +++ b/gazelle/cc/testdata/cuda_generate/pkg/keeparchs/BUILD.out @@ -1,11 +1,11 @@ load("@rules_dx_cuda//rules:defs.bzl", "cuda_library") cuda_library( - name = "keepplatforms_cuda", + name = "keeparchs_cuda", srcs = [ "a.cu", "b.cu", ], - platforms = ["sm_120"], + cuda_archs = ["sm_120"], visibility = ["//visibility:public"], ) diff --git a/gazelle/cc/testdata/cuda_generate/pkg/keepplatforms/a.cu b/gazelle/cc/testdata/cuda_generate/pkg/keeparchs/a.cu similarity index 100% rename from gazelle/cc/testdata/cuda_generate/pkg/keepplatforms/a.cu rename to gazelle/cc/testdata/cuda_generate/pkg/keeparchs/a.cu diff --git a/gazelle/cc/testdata/cuda_generate/pkg/keepplatforms/b.cu b/gazelle/cc/testdata/cuda_generate/pkg/keeparchs/b.cu similarity index 100% rename from gazelle/cc/testdata/cuda_generate/pkg/keepplatforms/b.cu rename to gazelle/cc/testdata/cuda_generate/pkg/keeparchs/b.cu diff --git a/gazelle/cc/testdata/cuda_generate/pkg/multi/BUILD.in b/gazelle/cc/testdata/cuda_generate/pkg/multi/BUILD.in index 718aa2cb89..fcac0476ff 100644 --- a/gazelle/cc/testdata/cuda_generate/pkg/multi/BUILD.in +++ b/gazelle/cc/testdata/cuda_generate/pkg/multi/BUILD.in @@ -1 +1 @@ -# gazelle:dx_cuda_platforms compute_89:compute_89,sm_89 sm_120 +# gazelle:dx_cuda_archs compute_89:compute_89,sm_89 sm_120 diff --git a/gazelle/cc/testdata/cuda_generate/pkg/multi/BUILD.out b/gazelle/cc/testdata/cuda_generate/pkg/multi/BUILD.out index 3c411dba05..16b0f638e3 100644 --- a/gazelle/cc/testdata/cuda_generate/pkg/multi/BUILD.out +++ b/gazelle/cc/testdata/cuda_generate/pkg/multi/BUILD.out @@ -1,11 +1,11 @@ load("@rules_dx_cuda//rules:defs.bzl", "cuda_library") -# gazelle:dx_cuda_platforms compute_89:compute_89,sm_89 sm_120 +# gazelle:dx_cuda_archs compute_89:compute_89,sm_89 sm_120 cuda_library( name = "multi_cuda", srcs = ["m.cu"], - platforms = [ + cuda_archs = [ "compute_89:compute_89,sm_89", "sm_120", ], diff --git a/gazelle/cc/testdata/cuda_generate/pkg/newgpu/BUILD.out b/gazelle/cc/testdata/cuda_generate/pkg/newgpu/BUILD.out index 9ed8e5eaea..fa0bbc8435 100644 --- a/gazelle/cc/testdata/cuda_generate/pkg/newgpu/BUILD.out +++ b/gazelle/cc/testdata/cuda_generate/pkg/newgpu/BUILD.out @@ -13,6 +13,6 @@ cuda_library( name = "newgpu_cuda", srcs = ["kernel.cu"], hdrs = ["kernel.cuh"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], visibility = ["//visibility:public"], ) diff --git a/gazelle/cc/testdata/cuda_generate/pkg/stale/BUILD.in b/gazelle/cc/testdata/cuda_generate/pkg/stale/BUILD.in index 3e75634262..966797ee72 100644 --- a/gazelle/cc/testdata/cuda_generate/pkg/stale/BUILD.in +++ b/gazelle/cc/testdata/cuda_generate/pkg/stale/BUILD.in @@ -3,11 +3,11 @@ load("@rules_dx_cuda//rules:defs.bzl", "cuda_library") cuda_library( name = "stale_cuda", srcs = ["gone.cu"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], ) cuda_library( name = "kernel", srcs = ["hand.cu"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], ) diff --git a/gazelle/cc/testdata/cuda_generate/pkg/stale/BUILD.out b/gazelle/cc/testdata/cuda_generate/pkg/stale/BUILD.out index d55f84d142..3ddccd030a 100644 --- a/gazelle/cc/testdata/cuda_generate/pkg/stale/BUILD.out +++ b/gazelle/cc/testdata/cuda_generate/pkg/stale/BUILD.out @@ -3,5 +3,5 @@ load("@rules_dx_cuda//rules:defs.bzl", "cuda_library") cuda_library( name = "kernel", srcs = ["hand.cu"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], ) diff --git a/gazelle/cc/testdata/cuda_keep/pkg/gpu/BUILD.in b/gazelle/cc/testdata/cuda_keep/pkg/gpu/BUILD.in index 60eaf75c29..e3ddb4b2eb 100644 --- a/gazelle/cc/testdata/cuda_keep/pkg/gpu/BUILD.in +++ b/gazelle/cc/testdata/cuda_keep/pkg/gpu/BUILD.in @@ -4,5 +4,5 @@ cuda_library( name = "kernel", srcs = ["kernel.cu"], hdrs = ["kernel.cuh"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], ) diff --git a/gazelle/cc/testdata/cuda_keep/pkg/gpu/BUILD.out b/gazelle/cc/testdata/cuda_keep/pkg/gpu/BUILD.out index 6015e3dc99..adbeb90824 100644 --- a/gazelle/cc/testdata/cuda_keep/pkg/gpu/BUILD.out +++ b/gazelle/cc/testdata/cuda_keep/pkg/gpu/BUILD.out @@ -5,7 +5,7 @@ cuda_library( name = "kernel", srcs = ["kernel.cu"], hdrs = ["kernel.cuh"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], ) cc_library( diff --git a/gazelle/cc/testdata/cuda_keep/pkg/gpuonly/BUILD.in b/gazelle/cc/testdata/cuda_keep/pkg/gpuonly/BUILD.in index 60eaf75c29..e3ddb4b2eb 100644 --- a/gazelle/cc/testdata/cuda_keep/pkg/gpuonly/BUILD.in +++ b/gazelle/cc/testdata/cuda_keep/pkg/gpuonly/BUILD.in @@ -4,5 +4,5 @@ cuda_library( name = "kernel", srcs = ["kernel.cu"], hdrs = ["kernel.cuh"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], ) diff --git a/gazelle/cc/testdata/cuda_keep/pkg/gpuonly/BUILD.out b/gazelle/cc/testdata/cuda_keep/pkg/gpuonly/BUILD.out index 60eaf75c29..e3ddb4b2eb 100644 --- a/gazelle/cc/testdata/cuda_keep/pkg/gpuonly/BUILD.out +++ b/gazelle/cc/testdata/cuda_keep/pkg/gpuonly/BUILD.out @@ -4,5 +4,5 @@ cuda_library( name = "kernel", srcs = ["kernel.cu"], hdrs = ["kernel.cuh"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], ) diff --git a/gazelle/cc/testdata/cuda_keep/pkg/hostinc/BUILD.in b/gazelle/cc/testdata/cuda_keep/pkg/hostinc/BUILD.in index 3956c5f5ec..8287ee5a0f 100644 --- a/gazelle/cc/testdata/cuda_keep/pkg/hostinc/BUILD.in +++ b/gazelle/cc/testdata/cuda_keep/pkg/hostinc/BUILD.in @@ -6,5 +6,5 @@ cuda_library( name = "kernel", srcs = ["kernel.cu"], hdrs = ["kernel.cuh"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], ) diff --git a/gazelle/cc/testdata/cuda_keep/pkg/hostinc/BUILD.out b/gazelle/cc/testdata/cuda_keep/pkg/hostinc/BUILD.out index 321981072f..9c15ad9784 100644 --- a/gazelle/cc/testdata/cuda_keep/pkg/hostinc/BUILD.out +++ b/gazelle/cc/testdata/cuda_keep/pkg/hostinc/BUILD.out @@ -7,7 +7,7 @@ cuda_library( name = "kernel", srcs = ["kernel.cu"], hdrs = ["kernel.cuh"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], ) cc_library( diff --git a/gazelle/dispatch/lang_test.go b/gazelle/dispatch/lang_test.go index 8d9d9c27c7..cdb948ca90 100644 --- a/gazelle/dispatch/lang_test.go +++ b/gazelle/dispatch/lang_test.go @@ -815,11 +815,11 @@ func TestAndroidSelectSkipped(t *testing.T) { } func TestAndroidAbisNeverChecked(t *testing.T) { - build := apkBuild(" platforms = [\"mips\"],\n app_id = \"org.example.adoptandroid\",\n manifest = \"AndroidManifest.xml\",\n") + build := apkBuild(" platforms = [\"//platforms:mips\"],\n app_id = \"org.example.adoptandroid\",\n manifest = \"AndroidManifest.xml\",\n") l, f := androidCheck(t, build, map[string]string{"AndroidManifest.xml": androidTestManifest}) wantAndroidErrors(t, l) - if got := strings.Join(f.Rules[0].AttrStrings("platforms"), ","); got != "mips" { - t.Errorf("platforms = %q, want mips unchanged", got) + if got := strings.Join(f.Rules[0].AttrStrings("platforms"), ","); got != "//platforms:mips" { + t.Errorf("platforms = %q, want //platforms:mips unchanged", got) } } diff --git a/libs/starlark/packaging.bzl b/libs/starlark/packaging.bzl index 94d84a0a4f..acf396b5ba 100644 --- a/libs/starlark/packaging.bzl +++ b/libs/starlark/packaging.bzl @@ -1,4 +1,4 @@ -"""Shared path and platform helpers for package rules.""" +"""Shared path helpers for package rules.""" def data_path(file, label): """Returns the install path of a data file relative to its target's package.""" @@ -8,15 +8,6 @@ def data_path(file, label): prefix = ("../" + label.repo_name + "/" if label.repo_name else "") + (label.package + "/" if label.package else "") return file.short_path[len(prefix):] -def platform_arch(has_constraint, os, arches): - """Returns the first matching arch name for the target OS, or "".""" - if not has_constraint(os): - return "" - for name, constraint in arches: - if has_constraint(constraint): - return name - return "" - def claim_dest(seen, dest, value, fold_case = False): """Records value for dest and returns the earlier value, or None.""" key = dest.lower() if fold_case else dest diff --git a/libs/starlark/platform.bzl b/libs/starlark/platform.bzl index 77f038e7e2..eef1a98c01 100644 --- a/libs/starlark/platform.bzl +++ b/libs/starlark/platform.bzl @@ -14,7 +14,7 @@ def _platform_transition_impl(settings, attr): return {"//command_line_option:platforms": settings["//command_line_option:platforms"]} return {"//command_line_option:platforms": [str(attr.platform)]} -_platform_transition = transition( +platform_transition = transition( implementation = _platform_transition_impl, inputs = ["//command_line_option:platforms"], outputs = ["//command_line_option:platforms"], @@ -50,7 +50,7 @@ PLATFORM_ATTRS = { providers = [platform_common.PlatformInfo], ), "_platform_probe": attr.label( - cfg = _platform_transition, + cfg = platform_transition, default = Label("//libs/starlark:platform_probe"), ), } @@ -58,3 +58,9 @@ PLATFORM_ATTRS = { def platform_identity(ctx): """Returns the DxPlatformInfo for ctx.attr.platform, or for the current platform when unset.""" return ctx.attr._platform_probe[0][DxPlatformInfo] + +def single_platform_error(rule, platforms): + """Returns the error for a platforms list that does not hold exactly one item, or "".""" + if len(platforms) == 1: + return "" + return rule + ": platforms takes exactly one platform label, got " + str(len(platforms)) diff --git a/libs/starlark/tests/packaging_tests.bzl b/libs/starlark/tests/packaging_tests.bzl index ec9fbb5a1b..af75c65476 100644 --- a/libs/starlark/tests/packaging_tests.bzl +++ b/libs/starlark/tests/packaging_tests.bzl @@ -1,7 +1,8 @@ """Unit tests for the shared packaging helpers.""" load("//libs/starlark:defs.bzl", "expect_equal", "starlark_test") -load("//libs/starlark:packaging.bzl", "claim_dest", "data_path", "platform_arch") +load("//libs/starlark:packaging.bzl", "claim_dest", "data_path") +load("//libs/starlark:platform.bzl", "single_platform_error") def _data_path_checks(): root = struct(repo_name = "", package = "") @@ -45,16 +46,11 @@ def _claim_checks(): expect_equal("seeded entry is reported", claim_dest(seeded, "AppxManifest.xml", "data", fold_case = True), "the generated manifest"), ] -def _has(constraints): - return lambda c: c in constraints - -def _platform_arch_checks(): - arches = [("aarch64", "arm64"), ("x86_64", "x86_64")] +def _single_platform_checks(): return [ - expect_equal("arm match", platform_arch(_has(["linux", "arm64"]), "linux", arches), "aarch64"), - expect_equal("x86 match", platform_arch(_has(["linux", "x86_64"]), "linux", arches), "x86_64"), - expect_equal("wrong os", platform_arch(_has(["macos", "arm64"]), "linux", arches), ""), - expect_equal("os without a pinned arch", platform_arch(_has(["linux", "riscv64"]), "linux", arches), ""), + expect_equal("one platform", single_platform_error("dx_x", ["//p:a"]), ""), + expect_equal("no platform", single_platform_error("dx_x", []), "dx_x: platforms takes exactly one platform label, got 0"), + expect_equal("two platforms", single_platform_error("dx_x", ["//p:a", "//p:b"]), "dx_x: platforms takes exactly one platform label, got 2"), ] def packaging_unit_tests(name): @@ -62,5 +58,5 @@ def packaging_unit_tests(name): starlark_test( name = name, mode = "unit", - checks = _data_path_checks() + _claim_checks() + _platform_arch_checks(), + checks = _data_path_checks() + _claim_checks() + _single_platform_checks(), ) diff --git a/quality/testdata/nvcc_syntax/BUILD.bazel b/quality/testdata/nvcc_syntax/BUILD.bazel index ba976014a9..2b9a5699d2 100644 --- a/quality/testdata/nvcc_syntax/BUILD.bazel +++ b/quality/testdata/nvcc_syntax/BUILD.bazel @@ -26,14 +26,14 @@ cuda_library( "dep.cuh", "host_only.cuh", ], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], includes = ["."], ) cuda_library( name = "clean", srcs = ["clean.cu"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], copts = ["-DCLEAN_OFFSET=1"], deps = [":dep"], ) @@ -41,7 +41,7 @@ cuda_library( cuda_library( name = "two_archs", srcs = ["two_archs.cu"], - platforms = [ + cuda_archs = [ "sm_80", "sm_89", ], @@ -53,7 +53,7 @@ cuda_library( cuda_library( name = "dirty", srcs = ["dirty.cu"], - platforms = ["sm_89"], + cuda_archs = ["sm_89"], tags = ["manual"], deps = [":dep"], ) diff --git a/rust/tests/fixtures/shared-rust-checks/repos.bzl b/rust/tests/fixtures/shared-rust-checks/repos.bzl index a8c2b1ebe7..b0c910918a 100644 --- a/rust/tests/fixtures/shared-rust-checks/repos.bzl +++ b/rust/tests/fixtures/shared-rust-checks/repos.bzl @@ -236,7 +236,7 @@ rust_android_apk( name = "consumer_apk", testonly = True, app_id = "org.example.consumer.tasks", - platforms = ["x86_64"], + platforms = ["@rules_dx_android//platforms:x86_64"], api_level = 33, assets = [ ":assets/board.txt", diff --git a/swift/README.md b/swift/README.md index 1cf203801b..ac656f3d33 100644 --- a/swift/README.md +++ b/swift/README.md @@ -21,7 +21,9 @@ swift_binary( ``` `swift_library`, `swift_binary` and `swift_test` build for Linux on their own. -You need no `--platforms` or `--extra_execution_platforms` flags. +You need no `--platforms` or `--extra_execution_platforms` flags. To build for another +platform, pass `platforms = ["//your:platform"]` to the wrapper; it takes one label, and +empty uses the current target platform. Binaries and tests link the Swift runtime statically and need only the system C library. ```sh diff --git a/swift/platforms/transition.bzl b/swift/platforms/transition.bzl index e1f0f072e8..fa3e25c01e 100644 --- a/swift/platforms/transition.bzl +++ b/swift/platforms/transition.bzl @@ -1,5 +1,7 @@ """Builds Swift targets for the Swift Linux platform.""" +load("//libs/starlark:platform.bzl", "single_platform_error") + _PLATFORMS = "//command_line_option:platforms" _EXEC = "//command_line_option:extra_execution_platforms" _TOOLCHAINS = "//command_line_option:extra_toolchains" @@ -14,14 +16,16 @@ def swift_transition_settings(settings, attr): Returns: The new platforms, execution platforms and toolchains. """ - toolchains = [str(t) for t in getattr(attr, "swift_extra_toolchains", [])] + toolchains = [str(t) for t in attr._swift_extra_toolchains] for t in settings[_TOOLCHAINS]: if str(t) not in toolchains: toolchains.append(str(t)) - platform = attr.swift_platform - if platform == "": + if len(attr.platforms) == 0: return {_PLATFORMS: settings[_PLATFORMS], _EXEC: settings[_EXEC], _TOOLCHAINS: toolchains} - platform = str(Label(platform)) + error = single_platform_error("swift", attr.platforms) + if error: + fail(error) + platform = str(attr.platforms[0]) return { _PLATFORMS: [platform], _EXEC: [platform] + [str(p) for p in settings[_EXEC] if str(p) != platform], @@ -37,17 +41,10 @@ swift_linux_transition = transition( outputs = [_PLATFORMS, _EXEC, _TOOLCHAINS], ) -def swift_linux_platform(): - """Returns the Swift platform label for the current Linux cpu, or an empty string.""" - return select({ - Label("//swift/platforms:is_linux_aarch64"): "//swift/platforms:exec_linux_aarch64", - Label("//swift/platforms:is_linux_x86_64"): "//swift/platforms:exec_linux_x86_64", - "//conditions:default": "", - }) - -def swift_extra_toolchains(): - """Returns the toolchains Swift targets prefer: the Xcode C++ toolchain on macOS.""" +def swift_linux_platforms(): + """Returns the Linux platform for the current target cpu, or no platform elsewhere.""" return select({ - Label("@platforms//os:macos"): [str(Label("@local_config_apple_cc_toolchains//:all"))], + Label("//swift/platforms:is_linux_aarch64"): [Label("//swift/platforms:exec_linux_aarch64")], + Label("//swift/platforms:is_linux_x86_64"): [Label("//swift/platforms:exec_linux_x86_64")], "//conditions:default": [], }) diff --git a/swift/platforms/transition_tests.bzl b/swift/platforms/transition_tests.bzl index 7ee533f310..841566a024 100644 --- a/swift/platforms/transition_tests.bzl +++ b/swift/platforms/transition_tests.bzl @@ -12,25 +12,25 @@ def _settings(toolchains = []): "//command_line_option:platforms": ["@@//:p"], } -def _attr(platform = "", toolchains = []): - return struct(swift_platform = platform, swift_extra_toolchains = toolchains) +def _attr(platforms = [], toolchains = []): + return struct(platforms = platforms, _swift_extra_toolchains = toolchains) def _linux_test_impl(ctx): env = unittest.begin(ctx) - out = swift_transition_settings(_settings(["//a:b"]), _attr("//swift/platforms:exec_linux_x86_64")) + out = swift_transition_settings(_settings(["//a:b"]), _attr(["//swift/platforms:exec_linux_x86_64"])) asserts.equals(env, ["//a:b"], out["//command_line_option:extra_toolchains"]) asserts.equals(env, 1, len(out["//command_line_option:platforms"])) return unittest.end(env) def _macos_first_test_impl(ctx): env = unittest.begin(ctx) - out = swift_transition_settings(_settings(["//a:b"]), _attr("", [_APPLE])) + out = swift_transition_settings(_settings(["//a:b"]), _attr([], [_APPLE])) asserts.equals(env, [_APPLE, "//a:b"], out["//command_line_option:extra_toolchains"]) return unittest.end(env) def _idempotent_test_impl(ctx): env = unittest.begin(ctx) - attr = _attr("", [_APPLE]) + attr = _attr([], [_APPLE]) once = swift_transition_settings(_settings(["//a:b"]), attr) twice = swift_transition_settings(once, attr) asserts.equals(env, once, twice) diff --git a/swift/rules/defs.bzl b/swift/rules/defs.bzl index 2e4da67896..23c0df408b 100644 --- a/swift/rules/defs.bzl +++ b/swift/rules/defs.bzl @@ -11,14 +11,19 @@ load("//libs/starlark:fuzz.bzl", "dx_fuzz_binary", "dx_fuzz_runner") load("//libs/starlark:fuzz_bench.bzl", "merge_tags", "split_runner_kwargs", "split_test_kwargs", "with_default_size") load("//libs/starlark:wrapper.bzl", "DX_EXEC_PROVIDES", "dx_append_flags", "dx_executable_forward_rule", "dx_library_forward_rule", "dx_wrap", "dx_wrap_binary", "dx_wrap_test") load("//quality:sources.bzl", "QualitySourcesInfo", "QualityToolsInfo") -load("//swift/platforms:transition.bzl", "swift_extra_toolchains", "swift_linux_platform", "swift_linux_transition") +load("//swift/platforms:transition.bzl", "swift_linux_platforms", "swift_linux_transition") # Re-exported unchanged: BUILD files need it to expose C modules to Swift. swift_interop_hint = _swift_interop_hint _PLATFORM_ATTR = { - "swift_extra_toolchains": attr.string_list(doc = "Toolchains put first for Swift targets."), - "swift_platform": attr.string(doc = "Swift platform to build for."), + "platforms": attr.label_list( + doc = "The one platform to build for. Empty uses the current target platform.", + providers = [platform_common.PlatformInfo], + ), + "_swift_extra_toolchains": attr.string_list( + default = [str(Label("@local_config_apple_cc_toolchains//:all"))], + ), } _STATIC = ["swift.static_stdlib", "-static_link_cpp_runtimes"] _INDEX = ["swift.index_while_building", "swift.disable_system_index", "-swift.index_store_compress"] @@ -70,20 +75,17 @@ _swift_forward_test = dx_executable_forward_rule( quality_tools = SWIFT_QUALITY_TOOLS, ) -def _forward(): - return {"swift_extra_toolchains": swift_extra_toolchains(), "swift_platform": swift_linux_platform()} - -def swift_library(name, srcs = None, visibility = None, **kwargs): +def swift_library(name, srcs = None, visibility = None, platforms = None, **kwargs): """Wraps swift_library and builds it for Linux, or with Xcode on macOS.""" - dx_wrap(name, _swift_library, _swift_library_forward, srcs, visibility = visibility, upstream_kwargs = dx_append_flags(kwargs, "features", _STATIC + _INDEX), quality_srcs = srcs or [], extra_forward_kwargs = _forward(), **kwargs) + dx_wrap(name, _swift_library, _swift_library_forward, srcs, visibility = visibility, upstream_kwargs = dx_append_flags(kwargs, "features", _STATIC + _INDEX), quality_srcs = srcs or [], extra_forward_kwargs = {"platforms": platforms if platforms != None else swift_linux_platforms()}, **kwargs) -def swift_binary(name, srcs = None, visibility = None, **kwargs): +def swift_binary(name, srcs = None, visibility = None, platforms = None, **kwargs): """Wraps swift_binary and builds it for Linux, or with Xcode on macOS.""" - dx_wrap_binary(name, _swift_binary, _swift_binary_forward, srcs, visibility = visibility, upstream_kwargs = dx_append_flags(kwargs, "features", _STATIC + _INDEX), quality_srcs = srcs or [], extra_forward_kwargs = _forward(), **kwargs) + dx_wrap_binary(name, _swift_binary, _swift_binary_forward, srcs, visibility = visibility, upstream_kwargs = dx_append_flags(kwargs, "features", _STATIC + _INDEX), quality_srcs = srcs or [], extra_forward_kwargs = {"platforms": platforms if platforms != None else swift_linux_platforms()}, **kwargs) -def swift_test(name, srcs = None, visibility = None, **kwargs): +def swift_test(name, srcs = None, visibility = None, platforms = None, **kwargs): """Wraps swift_test and builds it for Linux, or with Xcode on macOS.""" - dx_wrap_test(name, _swift_test, _swift_forward_test, srcs, visibility = visibility, upstream_kwargs = dx_append_flags(kwargs, "features", _STATIC + _INDEX), quality_srcs = srcs or [], extra_forward_kwargs = _forward(), **kwargs) + dx_wrap_test(name, _swift_test, _swift_forward_test, srcs, visibility = visibility, upstream_kwargs = dx_append_flags(kwargs, "features", _STATIC + _INDEX), quality_srcs = srcs or [], extra_forward_kwargs = {"platforms": platforms if platforms != None else swift_linux_platforms()}, **kwargs) def swift_fuzz_test(name, srcs = None, visibility = None, tags = None, copts = None, linkopts = None, **kwargs): """A libFuzzer binary with AddressSanitizer plus a `_run` runner for `dx fuzz`. Linux only.""" diff --git a/tools/testing/hermetic/cuda_gpu_test.rs b/tools/testing/hermetic/cuda_gpu_test.rs index 16e7f82a08..668991d9cf 100644 --- a/tools/testing/hermetic/cuda_gpu_test.rs +++ b/tools/testing/hermetic/cuda_gpu_test.rs @@ -9,7 +9,7 @@ cuda_library( name = "kernels", srcs = ["reduce.cu", "stencil.cu", "vector_add.cu"], hdrs = ["common.cuh", "kernels.h"], - platforms = ["compute_80:compute_80,sm_80", "sm_90"], + cuda_archs = ["compute_80:compute_80,sm_80", "sm_90"], visibility = ["//visibility:public"], ) "#; From 16587e272bb1f03456a0e69ed7071e6db48c0e03 Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 9 Nov 2026 10:48:57 +0100 Subject: [PATCH 2/9] msix: sign_test counts store certificates as an array (part of #9535) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B --- families/msix/tests/sign_test.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/families/msix/tests/sign_test.ps1 b/families/msix/tests/sign_test.ps1 index f53d6b600b..a79a444beb 100644 --- a/families/msix/tests/sign_test.ps1 +++ b/families/msix/tests/sign_test.ps1 @@ -81,7 +81,7 @@ function Get-StoreCertificate([string]$Thumbprint) { } function Test-NoStoreCert([string]$Thumbprint, [string]$Label) { - Assert-Equal 0 (Get-StoreCertificate $Thumbprint).Count "$Label left the certificate in CurrentUser\My" + Assert-Equal 0 @(Get-StoreCertificate $Thumbprint).Count "$Label left the certificate in CurrentUser\My" } function Test-KeyGone([string]$KeyLine, [string]$Label) { From 54b5c348d69ab68c64e966223c636b33b37218f9 Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 9 Nov 2026 10:53:44 +0100 Subject: [PATCH 3/9] msix sign_test: wrap store lookup in an array at call sites (part of #9535) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B --- families/msix/tests/sign_test.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/families/msix/tests/sign_test.ps1 b/families/msix/tests/sign_test.ps1 index a79a444beb..694492211b 100644 --- a/families/msix/tests/sign_test.ps1 +++ b/families/msix/tests/sign_test.ps1 @@ -352,7 +352,7 @@ foreach ($marker in @($false, $true)) { $script:lastKey = "" try { Test-ArgvSign $label "argv-$($marker).log" @{} 0 1 @("-Pfx", $good, "-Out", (Join-Path $work "argv-$($marker).msix")) | Out-Null - $left = Get-StoreCertificate $certificate.Thumbprint + $left = @(Get-StoreCertificate $certificate.Thumbprint) if ($marker) { Assert-Equal 0 $left.Count "$label left the certificate in CurrentUser\My" Test-KeyGone $script:lastKey $label @@ -386,7 +386,7 @@ $store.Close() $script:lastKey = "" try { Test-ArgvSign "keyless certificate" "argv-keyless.log" @{} 0 1 @("-Pfx", $good, "-Out", (Join-Path $work "argv-keyless.msix")) | Out-Null - $left = Get-StoreCertificate $certificate.Thumbprint + $left = @(Get-StoreCertificate $certificate.Thumbprint) Assert-Equal 1 $left.Count "keyless certificate was not restored to CurrentUser\My" Assert-That ($left.Count -eq 1 -and -not $left[0].HasPrivateKey) "keyless certificate got a private key" Assert-That ($left.Count -eq 1 -and $left[0].FriendlyName -ceq "user public only") "keyless certificate lost its FriendlyName" From df8932eba2419e00f373473eb998ccd1494a70cf Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 9 Nov 2026 11:32:47 +0100 Subject: [PATCH 4/9] review: single platform_transition, README wording (part of #9535) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B --- families/apple/README.md | 5 +++-- families/msix/README.md | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/families/apple/README.md b/families/apple/README.md index 287a1a7fa7..a63d5773be 100644 --- a/families/apple/README.md +++ b/families/apple/README.md @@ -550,8 +550,9 @@ apple_macos_app( ) ``` -`platform` is optional and defaults to the current target platform; only -`macos_arm64` is accepted. `srcs` holds the native entry point. `library` is any target with +`platform` is optional and defaults to the current target platform. It names the platform the +selection and check rules read the arch from; only `macos_arm64` is accepted. It does not +change the platform the bundle is built for: build with `--platforms` or `--macos_cpus`. `srcs` holds the native entry point. `library` is any target with `CcInfo` that links one static archive, such as `rust_static_library`. The app needs `srcs`, `library`, or both. `frameworks` takes frameworks `macos_dynamic_framework` targets, checked by bundle name under diff --git a/families/msix/README.md b/families/msix/README.md index 9a2a73e6b7..c666d438d8 100644 --- a/families/msix/README.md +++ b/families/msix/README.md @@ -64,8 +64,8 @@ msix_sign( Attributes: - `platform`: a Windows platform label such as `@rules_dx_msix//platforms:windows_arm64`. Builds - the package and its `binary`, `libs` and `data` for it. Unset uses the current target platform. `target_compatible_with` only marks - compatibility. Do not set it with `select()`. + the package and its `binary`, `libs` and `data` for it. Unset uses the current target + platform. `target_compatible_with` only marks compatibility. Do not set it with `select()`. - `binary`: the `.exe`. Its target-configuration bytes are packaged at the package root. Every `.dll` in its runfiles, such as its `dynamic_deps`, is packaged next to it. - `identity_name`: package identity name, 3 to 50 letters, digits, dots or dashes. From 4dba19f573025d26a6fbfff3b12843c9002c77bc Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 9 Nov 2026 11:43:38 +0100 Subject: [PATCH 5/9] cuda: fixtures use cuda_archs; apple README wrap and x86_64 note (part of #9535) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B --- families/apple/README.md | 4 +++- families/cuda/tests/fixtures/executable/BUILD.bazel | 12 ++++++------ .../starters/fixtures/cuda/BUILD.bazel.fixture | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/families/apple/README.md b/families/apple/README.md index a63d5773be..5251a818dd 100644 --- a/families/apple/README.md +++ b/families/apple/README.md @@ -552,7 +552,9 @@ apple_macos_app( `platform` is optional and defaults to the current target platform. It names the platform the selection and check rules read the arch from; only `macos_arm64` is accepted. It does not -change the platform the bundle is built for: build with `--platforms` or `--macos_cpus`. `srcs` holds the native entry point. `library` is any target with +change the platform the bundle is built for: build with `--platforms` or `--macos_cpus`. An x86_64 macOS target +platform fails with "arch 'x86_64' is outside macos", where the app used to default to arm64. +`srcs` holds the native entry point. `library` is any target with `CcInfo` that links one static archive, such as `rust_static_library`. The app needs `srcs`, `library`, or both. `frameworks` takes frameworks `macos_dynamic_framework` targets, checked by bundle name under diff --git a/families/cuda/tests/fixtures/executable/BUILD.bazel b/families/cuda/tests/fixtures/executable/BUILD.bazel index 1ccfba78cb..41f05b09ea 100644 --- a/families/cuda/tests/fixtures/executable/BUILD.bazel +++ b/families/cuda/tests/fixtures/executable/BUILD.bazel @@ -14,7 +14,7 @@ cuda_binary( "main.cc", ], hdrs = ["add.h"], - platforms = _ARCHS, + cuda_archs = _ARCHS, ) cuda_binary( @@ -24,7 +24,7 @@ cuda_binary( "rdc_main.cc", ], hdrs = ["add.h"], - platforms = _ARCHS, + cuda_archs = _ARCHS, rdc = True, deps = ["//tests/fixtures/rdc:axpy"], ) @@ -36,7 +36,7 @@ cuda_test( "main.cc", ], hdrs = ["add.h"], - platforms = _ARCHS, + cuda_archs = _ARCHS, ) cuda_test( @@ -46,7 +46,7 @@ cuda_test( "rdc_main.cc", ], hdrs = ["add.h"], - platforms = _ARCHS, + cuda_archs = _ARCHS, rdc = True, deps = ["//tests/fixtures/rdc:axpy"], ) @@ -60,7 +60,7 @@ cuda_binary( cuda_copts = ["-DDX_EXEC_NVCC"], defines = ["DX_EXEC_PUBLIC"], local_defines = ["DX_EXEC_N=1024"], - platforms = _ARCHS, + cuda_archs = _ARCHS, ) cuda_test( @@ -72,5 +72,5 @@ cuda_test( cuda_copts = ["-DDX_EXEC_NVCC"], defines = ["DX_EXEC_PUBLIC"], local_defines = ["DX_EXEC_N=1024"], - platforms = _ARCHS, + cuda_archs = _ARCHS, ) diff --git a/tools/testing/starters/fixtures/cuda/BUILD.bazel.fixture b/tools/testing/starters/fixtures/cuda/BUILD.bazel.fixture index 19ae2e0f73..bb7c5581a1 100644 --- a/tools/testing/starters/fixtures/cuda/BUILD.bazel.fixture +++ b/tools/testing/starters/fixtures/cuda/BUILD.bazel.fixture @@ -8,7 +8,7 @@ cuda_library( "scale.cuh", "scale.h", ], - platforms = [ + cuda_archs = [ "compute_89:compute_89,sm_89", "sm_120", ], From 4ae3c7ee12aeca3d0fd32aea4eacaf5b02a3cfb2 Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 9 Nov 2026 11:46:08 +0100 Subject: [PATCH 6/9] msix sign_test: report a missing signtool key line instead of throwing (part of #9535) --- families/msix/tests/sign_test.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/families/msix/tests/sign_test.ps1 b/families/msix/tests/sign_test.ps1 index 694492211b..ac3d96e841 100644 --- a/families/msix/tests/sign_test.ps1 +++ b/families/msix/tests/sign_test.ps1 @@ -85,6 +85,10 @@ function Test-NoStoreCert([string]$Thumbprint, [string]$Label) { } function Test-KeyGone([string]$KeyLine, [string]$Label) { + if (-not $KeyLine -or $KeyLine.Length -le 4) { + $failures.Add("$Label has no key line: '$KeyLine'") + return + } $parts = $KeyLine.Substring(4).Split("|") if ($parts.Count -lt 3) { $failures.Add("$Label has no key line: $KeyLine") From db6d16d6f6b87235a9c846ce215888916ed1b1fe Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 9 Nov 2026 12:40:41 +0100 Subject: [PATCH 7/9] starters: rust-android fixture uses platform labels; msix: drop sign_test edits covered by #9764; apple README wrap (part of #9535) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B --- families/apple/README.md | 10 ++++++---- families/msix/tests/sign_test.ps1 | 10 +++------- .../starters/fixtures/rust-android/BUILD.bazel.fixture | 4 ++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/families/apple/README.md b/families/apple/README.md index 5251a818dd..ce6d89d771 100644 --- a/families/apple/README.md +++ b/families/apple/README.md @@ -550,10 +550,12 @@ apple_macos_app( ) ``` -`platform` is optional and defaults to the current target platform. It names the platform the -selection and check rules read the arch from; only `macos_arm64` is accepted. It does not -change the platform the bundle is built for: build with `--platforms` or `--macos_cpus`. An x86_64 macOS target -platform fails with "arch 'x86_64' is outside macos", where the app used to default to arm64. +`platform` is optional and defaults to the current target platform. It names the +platform the selection and check rules read the arch from; only `macos_arm64` is +accepted. It does not change the platform the bundle is built for: build with +`--platforms` or `--macos_cpus`. An x86_64 macOS target platform fails with +"arch 'x86_64' is outside macos", where the app used to default to arm64. + `srcs` holds the native entry point. `library` is any target with `CcInfo` that links one static archive, such as `rust_static_library`. The app needs `srcs`, `library`, or both. `frameworks` takes frameworks diff --git a/families/msix/tests/sign_test.ps1 b/families/msix/tests/sign_test.ps1 index ac3d96e841..f53d6b600b 100644 --- a/families/msix/tests/sign_test.ps1 +++ b/families/msix/tests/sign_test.ps1 @@ -81,14 +81,10 @@ function Get-StoreCertificate([string]$Thumbprint) { } function Test-NoStoreCert([string]$Thumbprint, [string]$Label) { - Assert-Equal 0 @(Get-StoreCertificate $Thumbprint).Count "$Label left the certificate in CurrentUser\My" + Assert-Equal 0 (Get-StoreCertificate $Thumbprint).Count "$Label left the certificate in CurrentUser\My" } function Test-KeyGone([string]$KeyLine, [string]$Label) { - if (-not $KeyLine -or $KeyLine.Length -le 4) { - $failures.Add("$Label has no key line: '$KeyLine'") - return - } $parts = $KeyLine.Substring(4).Split("|") if ($parts.Count -lt 3) { $failures.Add("$Label has no key line: $KeyLine") @@ -356,7 +352,7 @@ foreach ($marker in @($false, $true)) { $script:lastKey = "" try { Test-ArgvSign $label "argv-$($marker).log" @{} 0 1 @("-Pfx", $good, "-Out", (Join-Path $work "argv-$($marker).msix")) | Out-Null - $left = @(Get-StoreCertificate $certificate.Thumbprint) + $left = Get-StoreCertificate $certificate.Thumbprint if ($marker) { Assert-Equal 0 $left.Count "$label left the certificate in CurrentUser\My" Test-KeyGone $script:lastKey $label @@ -390,7 +386,7 @@ $store.Close() $script:lastKey = "" try { Test-ArgvSign "keyless certificate" "argv-keyless.log" @{} 0 1 @("-Pfx", $good, "-Out", (Join-Path $work "argv-keyless.msix")) | Out-Null - $left = @(Get-StoreCertificate $certificate.Thumbprint) + $left = Get-StoreCertificate $certificate.Thumbprint Assert-Equal 1 $left.Count "keyless certificate was not restored to CurrentUser\My" Assert-That ($left.Count -eq 1 -and -not $left[0].HasPrivateKey) "keyless certificate got a private key" Assert-That ($left.Count -eq 1 -and $left[0].FriendlyName -ceq "user public only") "keyless certificate lost its FriendlyName" diff --git a/tools/testing/starters/fixtures/rust-android/BUILD.bazel.fixture b/tools/testing/starters/fixtures/rust-android/BUILD.bazel.fixture index 196401ef51..06bab7fdf2 100644 --- a/tools/testing/starters/fixtures/rust-android/BUILD.bazel.fixture +++ b/tools/testing/starters/fixtures/rust-android/BUILD.bazel.fixture @@ -31,8 +31,8 @@ cc_library( rust_android_apk( name = "demo-app_apk", platforms = [ - "arm64-v8a", - "x86_64", + "@rules_dx_android//platforms:arm64-v8a", + "@rules_dx_android//platforms:x86_64", ], api_level = 31, app_id = "com.example.demo_app", From 7c956a8f97fa6b7361547cc5d5f460bb33aa715c Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 9 Nov 2026 12:55:51 +0100 Subject: [PATCH 8/9] apple: ship the platforms package in module_srcs and the docs test Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B --- families/apple/BUILD.bazel | 4 +- families/apple/MODULE.bazel.lock | 118 +++++++++++---------------- families/apple/platforms/BUILD.bazel | 14 ++++ 3 files changed, 64 insertions(+), 72 deletions(-) diff --git a/families/apple/BUILD.bazel b/families/apple/BUILD.bazel index 670efe6d57..c81bad4e88 100644 --- a/families/apple/BUILD.bazel +++ b/families/apple/BUILD.bazel @@ -15,6 +15,7 @@ filegroup( "//bundle:module_srcs", "//ios:module_srcs", "//macos:module_srcs", + "//platforms:module_srcs", "//provisioning:module_srcs", "//signing:module_srcs", ], @@ -41,12 +42,13 @@ sh_test( "//bundle:corpus_starlark", "//ios:corpus_starlark", "//macos:corpus_starlark", + "//platforms:corpus_starlark", "//provisioning:corpus_starlark", "//signing:corpus_starlark", "//tests:corpus_starlark", "@rules_dx//tools/ci:starlark_docs_family_test", ], - env = {"STARLARK_DOCS_PACKAGES": "bundle,ios,macos,provisioning,signing,tests"}, + env = {"STARLARK_DOCS_PACKAGES": "bundle,ios,macos,platforms,provisioning,signing,tests"}, ) # dx:begin exports diff --git a/families/apple/MODULE.bazel.lock b/families/apple/MODULE.bazel.lock index b26456b881..ce2ec94bf1 100644 --- a/families/apple/MODULE.bazel.lock +++ b/families/apple/MODULE.bazel.lock @@ -14,7 +14,6 @@ "https://bcr.bazel.build/modules/abseil-py/2.1.0/source.json": "0e8fc4f088ce07099c1cd6594c20c7ddbb48b4b3c0849b7d94ba94be88ff042b", "https://bcr.bazel.build/modules/apple_support/1.11.1/MODULE.bazel": "1843d7cd8a58369a444fc6000e7304425fba600ff641592161d9f15b179fb896", "https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel": "a0556fefca0b1bb2de8567b8827518f94db6a6e7e7d632b4c48dc5f865bc7c85", - "https://bcr.bazel.build/modules/apple_support/1.21.0/MODULE.bazel": "ac1824ed5edf17dee2fdd4927ada30c9f8c3b520be1b5fd02a5da15bc10bff3e", "https://bcr.bazel.build/modules/apple_support/1.21.1/MODULE.bazel": "5809fa3efab15d1f3c3c635af6974044bac8a4919c62238cce06acee8a8c11f1", "https://bcr.bazel.build/modules/apple_support/1.24.1/MODULE.bazel": "f46e8ddad60aef170ee92b2f3d00ef66c147ceafea68b6877cb45bd91737f5f8", "https://bcr.bazel.build/modules/apple_support/1.24.2/MODULE.bazel": "0e62471818affb9f0b26f128831d5c40b074d32e6dda5a0d3852847215a41ca4", @@ -25,7 +24,6 @@ "https://bcr.bazel.build/modules/apple_support/2.5.4/MODULE.bazel": "964e9268b37edb64e9a0fa525e5b5e535ba56bf63cadc68375f92e69fcb734f6", "https://bcr.bazel.build/modules/apple_support/2.8.0/MODULE.bazel": "c45f5176057092afba0be6c48a9ea02101666802f8be536947e099e94757f8ed", "https://bcr.bazel.build/modules/apple_support/2.8.3/MODULE.bazel": "4afffdeb3a37825fdae637efb14ead4de27fe6310dbae96d071059e4e7b2e431", - "https://bcr.bazel.build/modules/apple_support/2.8.4/MODULE.bazel": "83ae0682db2a4ea86d20416a9b3bdba7f6c2a81e136b4d210e5986e30436585e", "https://bcr.bazel.build/modules/apple_support/2.9.1/MODULE.bazel": "fb209b83ed172af587419acb3340389cfe3260669e5f1c05e1ac3974aca614e0", "https://bcr.bazel.build/modules/aspect_bazel_lib/2.14.0/MODULE.bazel": "2b31ffcc9bdc8295b2167e07a757dbbc9ac8906e7028e5170a3708cecaac119f", "https://bcr.bazel.build/modules/aspect_bazel_lib/2.19.2/MODULE.bazel": "30dfabbfae0139b1f0036e01c201dd4c0167da3017f0b7ef3820d78e07622989", @@ -63,7 +61,6 @@ "https://bcr.bazel.build/modules/bazel_features/1.24.0/MODULE.bazel": "4796b4c25b47053e9bbffa792b3792d07e228ff66cd0405faef56a978708acd4", "https://bcr.bazel.build/modules/bazel_features/1.27.0/MODULE.bazel": "621eeee06c4458a9121d1f104efb80f39d34deff4984e778359c60eaf1a8cb65", "https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d", - "https://bcr.bazel.build/modules/bazel_features/1.3.0/MODULE.bazel": "cdcafe83ec318cda34e02948e81d790aab8df7a929cec6f6969f13a489ccecd9", "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", "https://bcr.bazel.build/modules/bazel_features/1.32.0/MODULE.bazel": "095d67022a58cb20f7e20e1aefecfa65257a222c18a938e2914fd257b5f1ccdc", "https://bcr.bazel.build/modules/bazel_features/1.33.0/MODULE.bazel": "8b8dc9d2a4c88609409c3191165bccec0e4cb044cd7a72ccbe826583303459f6", @@ -260,6 +257,8 @@ "https://bcr.bazel.build/modules/gcc_toolchain/0.13.0/MODULE.bazel": "8912be8684729c2814e922aa3555d163d1c6e7dbf620e72753fe44f3761250e4", "https://bcr.bazel.build/modules/gcc_toolchain/0.13.0/source.json": "41e8693ad56244dde548f7711126deda72eeff630f66f5e2d8403227d4a78097", "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", + "https://bcr.bazel.build/modules/google_benchmark/1.9.5/MODULE.bazel": "8a85cfd90b1e45e6e68f1aa2aa9efce3c04add57df732571d7fd54c07e7c5143", + "https://bcr.bazel.build/modules/google_benchmark/1.9.5/source.json": "0bd357fd9db30ee31d5eb4c78b1086ce3d79b4423ce76de19e8a2fa7b2fa2e10", "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", "https://bcr.bazel.build/modules/googletest/1.15.2/MODULE.bazel": "6de1edc1d26cafb0ea1a6ab3f4d4192d91a312fd2d360b63adaa213cd00b2108", @@ -272,6 +271,8 @@ "https://bcr.bazel.build/modules/jq.bzl/0.4.0/source.json": "52ec7530c4618e03f634b30ff719814a68d7d39c235938b7aa2abbfe1eb1c52c", "https://bcr.bazel.build/modules/jsoncpp/1.9.6.bcr.2/MODULE.bazel": "64f508885f907ac2518039b3d0c5c1703a8f6137d9f5d635067ba93d33c2670a", "https://bcr.bazel.build/modules/jsoncpp/1.9.6.bcr.2/source.json": "13199fa0a267ca46814e9e6ab313a71890c8f1822e57376fdc23a2d2cd384051", + "https://bcr.bazel.build/modules/libpfm/4.11.0.bcr.1/MODULE.bazel": "e5362dadc90aab6724c83a2cc1e67cbed9c89a05d97fb1f90053c8deb1e445c8", + "https://bcr.bazel.build/modules/libpfm/4.11.0.bcr.1/source.json": "0646414d9037f8aad148781dd760bec90b0b25ac12fda5e03f8aadbd6b9c61e6", "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", "https://bcr.bazel.build/modules/libxml2/2.15.3/MODULE.bazel": "a6bffafd8aa8b0c13eaa4bf25d55be188ec8548549395f03e98c39bab264adaa", "https://bcr.bazel.build/modules/libxml2/2.15.4/MODULE.bazel": "8d0bca5635a3ba19dddd0fcf0578b032f3c127f597e7f6b24cec3462bf10b824", @@ -284,7 +285,6 @@ "https://bcr.bazel.build/modules/mimalloc/3.5.3/source.json": "e94e4baf53f881236b86b16c436c6ab4a338b37135e370154802a7111c0dda28", "https://bcr.bazel.build/modules/nlohmann_json/3.12.0.bcr.1/MODULE.bazel": "a1c8bb07b5b91d971727c635f449d05623ac9608f6fe4f5f04254ea12f08e349", "https://bcr.bazel.build/modules/nlohmann_json/3.12.0.bcr.1/source.json": "93f82a5ae985eb935c539bfee95e04767187818189241ac956f3ccadbdb8fb02", - "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/MODULE.bazel": "6f7b417dcc794d9add9e556673ad25cb3ba835224290f4f848f8e2db1e1fca74", "https://bcr.bazel.build/modules/package_metadata/0.0.13/MODULE.bazel": "a9cc7e81640c1e7eaca5a465cdf4b63c88d416ca998fcded3680181b1602eee2", "https://bcr.bazel.build/modules/package_metadata/0.0.13/source.json": "f488e4534468eac223f6417dfdf8d3b7299166d36536408d37c2493ca1e8539d", "https://bcr.bazel.build/modules/package_metadata/0.0.2/MODULE.bazel": "fb8d25550742674d63d7b250063d4580ca530499f045d70748b1b142081ebb92", @@ -410,7 +410,6 @@ "https://bcr.bazel.build/modules/rules_pkg/1.3.0/MODULE.bazel": "ae0bdefbacc990c91f843206c90cf0f4be620639a5bf22119043599ba86d51a3", "https://bcr.bazel.build/modules/rules_pkg/1.3.0/source.json": "58ae84c545141762f7c434c0ce78bfb55ef0be08d84863e7f0503fff135fe4e2", "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", - "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", "https://bcr.bazel.build/modules/rules_proto/6.0.0/MODULE.bazel": "b531d7f09f58dce456cd61b4579ce8c86b38544da75184eadaf0a7cb7966453f", "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", @@ -435,11 +434,6 @@ "https://bcr.bazel.build/modules/rules_shell/0.7.1/MODULE.bazel": "257dd8d667371de804918dfceb86f6ddd2e1b5e025f5d9322878d4a73dc8aa58", "https://bcr.bazel.build/modules/rules_shell/0.8.0/MODULE.bazel": "f6a89f1d6a669a26f28fe814503857055d76306b79cfc11d12399af08d0b80ae", "https://bcr.bazel.build/modules/rules_shell/0.8.0/source.json": "eb53cc815bc503c6683c5fe12d943f98883f81fc22f51403ec8a95610cba4195", - "https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca", - "https://bcr.bazel.build/modules/rules_swift/2.4.0/MODULE.bazel": "1639617eb1ede28d774d967a738b4a68b0accb40650beadb57c21846beab5efd", - "https://bcr.bazel.build/modules/rules_swift/3.1.2/MODULE.bazel": "72c8f5cf9d26427cee6c76c8e3853eb46ce6b0412a081b2b6db6e8ad56267400", - "https://bcr.bazel.build/modules/rules_swift/4.1.1/MODULE.bazel": "74bc181e75147cadab7c5040ef59813168f50cf68f48b1c669cb928de4dc4148", - "https://bcr.bazel.build/modules/rules_swift/4.1.2/MODULE.bazel": "a76383e8994cee3ddaf75367083d0cf70a97b3f310c4d136b4d4c53d22c4fd45", "https://bcr.bazel.build/modules/rules_swift/4.2.2/MODULE.bazel": "dce65c0c22c5880dc0060b525dbbb7c44ede24e317e27509064512aa92fe237e", "https://bcr.bazel.build/modules/rules_swift/4.2.2/source.json": "4d8348d47ac5495a40a86235fff26202f9e578188fae00dec806b7c6d9d73487", "https://bcr.bazel.build/modules/rules_zig/0.17.0/MODULE.bazel": "2c1c08adc986cfdb5fee97e21982cac846f8a20a6a8054ae9cab8b02721c2011", @@ -453,8 +447,6 @@ "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", "https://bcr.bazel.build/modules/stardoc/0.7.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01", - "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/MODULE.bazel": "5e463fbfba7b1701d957555ed45097d7f984211330106ccd1352c6e0af0dcf91", - "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.2/MODULE.bazel": "75aab2373a4bbe2a1260b9bf2a1ebbdbf872d3bd36f80bff058dccd82e89422f", "https://bcr.bazel.build/modules/swift_argument_parser/1.7.0/MODULE.bazel": "40d4e44950e44973dcf8590bcee637591de196b5dbe3696d07eb342b74d53672", "https://bcr.bazel.build/modules/swift_argument_parser/1.7.0/source.json": "b9b952cba0c748083b9b891e6ac46d347c92d37e8a92ead96d2a54b966bacd87", "https://bcr.bazel.build/modules/tar.bzl/0.10.1/MODULE.bazel": "bf5fda5b5ccef8c3c4a5f4886144377386e0baa382972f257acb42dcf40ea908", @@ -17600,17 +17592,17 @@ "@@rules_zig+//zig:extensions.bzl%zig": { "general": { "bzlTransitiveDigest": "vTeQKV6Xl5RuIpCwuarKlx1FwNYsPvKFOklJop5h/mI=", - "usagesDigest": "wbVXTaIKBf7g3e5qCNbn0MxEyRFJdnOR+xjO2nz4Pkw=", + "usagesDigest": "QF0FP4iBd3UL3eOAQ/3YQ/7Y7gdmVPz2aHt0+5zCriE=", "recordedInputs": [ "REPO_MAPPING:rules_zig+,bazel_skylib bazel_skylib+", "REPO_MAPPING:rules_zig+,bazel_tools bazel_tools", "FILE:@@rules_zig+//zig/private/versions.json 868467564510b7a7f1bae1d36ac90bf8bc6632f22243ab13bf2040e5cce026d2" ], "generatedRepoSpecs": { - "zig_0.16.0_aarch64-linux": { + "zig_0.17.0_aarch64-linux": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.16.0/zig-aarch64-linux-0.16.0.tar.xz", + "url": "https://ziglang.org/download/0.17.0/zig-aarch64-linux-0.17.0.tar.xz", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17626,15 +17618,15 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "ea4b09bfb22ec6f6c6ceac57ab63efb6b46e17ab08d21f69f3a48b38e1534f17", - "zig_version": "0.16.0", + "sha256": "9e8d11661d4ae3bd57702a3832781e23ad151dde5798e16a5ccd503f65234ff8", + "zig_version": "0.17.0", "platform": "aarch64-linux" } }, - "zig_0.16.0_aarch64-macos": { + "zig_0.17.0_aarch64-macos": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.16.0/zig-aarch64-macos-0.16.0.tar.xz", + "url": "https://ziglang.org/download/0.17.0/zig-aarch64-macos-0.17.0.tar.xz", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17650,15 +17642,15 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "b23d70deaa879b5c2d486ed3316f7eaa53e84acf6fc9cc747de152450d401489", - "zig_version": "0.16.0", + "sha256": "b607e9b9234790a008116ae5bdb71c6243b84b9fb42a53a9e70fde41c06c536a", + "zig_version": "0.17.0", "platform": "aarch64-macos" } }, - "zig_0.16.0_aarch64-windows": { + "zig_0.17.0_aarch64-windows": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.16.0/zig-aarch64-windows-0.16.0.zip", + "url": "https://ziglang.org/download/0.17.0/zig-aarch64-windows-0.17.0.zip", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17674,15 +17666,15 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "aee38316ee4111717900f45dd3130145c39289e105541d737eb8c5ed653c78ef", - "zig_version": "0.16.0", + "sha256": "0a59d91fa1cb40cf068e9b0954434ce973500c7a2ea749f1e01af62cdab52d26", + "zig_version": "0.17.0", "platform": "aarch64-windows" } }, - "zig_0.16.0_x86_64-linux": { + "zig_0.17.0_x86_64-linux": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz", + "url": "https://ziglang.org/download/0.17.0/zig-x86_64-linux-0.17.0.tar.xz", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17698,15 +17690,15 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00", - "zig_version": "0.16.0", + "sha256": "1cbe9df9f27e6b78d14ccbca43b6703a404ef79ef1c463de901d7f088d4e2026", + "zig_version": "0.17.0", "platform": "x86_64-linux" } }, - "zig_0.16.0_x86_64-macos": { + "zig_0.17.0_x86_64-macos": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.16.0/zig-x86_64-macos-0.16.0.tar.xz", + "url": "https://ziglang.org/download/0.17.0/zig-x86_64-macos-0.17.0.tar.xz", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17722,15 +17714,15 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "0387557ed1877bc6a2e1802c8391953baddba76081876301c522f52977b52ba7", - "zig_version": "0.16.0", + "sha256": "4f9a1c5269aa17ebda5e6d3c2b89d6cbf36f7d2b22a0306e9ab98f25f95529c6", + "zig_version": "0.17.0", "platform": "x86_64-macos" } }, - "zig_0.16.0_x86_64-windows": { + "zig_0.17.0_x86_64-windows": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.16.0/zig-x86_64-windows-0.16.0.zip", + "url": "https://ziglang.org/download/0.17.0/zig-x86_64-windows-0.17.0.zip", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17746,8 +17738,8 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "68659eb5f1e4eb1437a722f1dd889c5a322c9954607f5edcf337bc3684a75a7e", - "zig_version": "0.16.0", + "sha256": "b5663f69581dcf391293fbf16c06cb80d81d806545ce618b4d0bab7f0eb8c428", + "zig_version": "0.17.0", "platform": "x86_64-windows" } }, @@ -17755,28 +17747,28 @@ "repoRuleId": "@@rules_zig+//zig/private/repo:toolchains_repo.bzl%toolchains_repo", "attributes": { "names": [ - "zig_0.16.0_aarch64-linux", - "zig_0.16.0_aarch64-macos", - "zig_0.16.0_aarch64-windows", - "zig_0.16.0_x86_64-linux", - "zig_0.16.0_x86_64-macos", - "zig_0.16.0_x86_64-windows" + "zig_0.17.0_aarch64-linux", + "zig_0.17.0_aarch64-macos", + "zig_0.17.0_aarch64-windows", + "zig_0.17.0_x86_64-linux", + "zig_0.17.0_x86_64-macos", + "zig_0.17.0_x86_64-windows" ], "labels": [ - "@zig_0.16.0_aarch64-linux//:zig_toolchain", - "@zig_0.16.0_aarch64-macos//:zig_toolchain", - "@zig_0.16.0_aarch64-windows//:zig_toolchain", - "@zig_0.16.0_x86_64-linux//:zig_toolchain", - "@zig_0.16.0_x86_64-macos//:zig_toolchain", - "@zig_0.16.0_x86_64-windows//:zig_toolchain" + "@zig_0.17.0_aarch64-linux//:zig_toolchain", + "@zig_0.17.0_aarch64-macos//:zig_toolchain", + "@zig_0.17.0_aarch64-windows//:zig_toolchain", + "@zig_0.17.0_x86_64-linux//:zig_toolchain", + "@zig_0.17.0_x86_64-macos//:zig_toolchain", + "@zig_0.17.0_x86_64-windows//:zig_toolchain" ], "zig_versions": [ - "0.16.0", - "0.16.0", - "0.16.0", - "0.16.0", - "0.16.0", - "0.16.0" + "0.17.0", + "0.17.0", + "0.17.0", + "0.17.0", + "0.17.0", + "0.17.0" ], "exec_lengths": [ 2, @@ -18011,22 +18003,6 @@ "@@aspect_tools_telemetry+//:extension.bzl%telemetry": { "notice_version": "3" }, - "@@rules_dx+//ocaml/toolchain:repos.bzl%ocaml": { - "691408b00730fcedbd3e30ccdb42c388a83fd304/astring.0.8.5": { - "needs": [ - "ocamlfind", - "ocamlbuild", - "topkg" - ], - "sha256": "865692630c07c3ab87c66cdfc2734c0fdfc9c34a57f8e89ffec7c7d15e7a70fa", - "src": "https://erratique.ch/software/astring/releases/astring-0.8.5.tbz" - }, - "691408b00730fcedbd3e30ccdb42c388a83fd304/either.1.0.0": { - "needs": [], - "sha256": "bf674de3312dee7b7215f07df1e8a96eb3d679164b8a918cdd95b8d97e505884", - "src": "https://github.com/mirage/either/releases/download/1.0.0/either-1.0.0.tbz" - } - }, "@@rules_go+//go:extensions.bzl%go_sdk": { "1.22.4": { "aix_ppc64": [ diff --git a/families/apple/platforms/BUILD.bazel b/families/apple/platforms/BUILD.bazel index 063721da6d..0d67d23e16 100644 --- a/families/apple/platforms/BUILD.bazel +++ b/families/apple/platforms/BUILD.bazel @@ -1,3 +1,5 @@ +load("@rules_dx//quality:fixtures.bzl", "real_source_target") + package(default_visibility = ["//visibility:public"]) platform( @@ -15,3 +17,15 @@ platform( "@platforms//os:macos", ], ) + +real_source_target( + name = "corpus_starlark", + starlark_srcs = ["BUILD.bazel"], + tags = ["corpus"], +) + +filegroup( + name = "module_srcs", + srcs = glob(["**"]), + visibility = ["//visibility:public"], +) From ae7082cc859bab18dcd01d4e52063804034b1ded Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 9 Nov 2026 13:01:49 +0100 Subject: [PATCH 9/9] apple: restore MODULE.bazel.lock from main (part of #9535) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B --- families/apple/MODULE.bazel.lock | 118 +++++++++++++++++++------------ 1 file changed, 71 insertions(+), 47 deletions(-) diff --git a/families/apple/MODULE.bazel.lock b/families/apple/MODULE.bazel.lock index ce2ec94bf1..b26456b881 100644 --- a/families/apple/MODULE.bazel.lock +++ b/families/apple/MODULE.bazel.lock @@ -14,6 +14,7 @@ "https://bcr.bazel.build/modules/abseil-py/2.1.0/source.json": "0e8fc4f088ce07099c1cd6594c20c7ddbb48b4b3c0849b7d94ba94be88ff042b", "https://bcr.bazel.build/modules/apple_support/1.11.1/MODULE.bazel": "1843d7cd8a58369a444fc6000e7304425fba600ff641592161d9f15b179fb896", "https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel": "a0556fefca0b1bb2de8567b8827518f94db6a6e7e7d632b4c48dc5f865bc7c85", + "https://bcr.bazel.build/modules/apple_support/1.21.0/MODULE.bazel": "ac1824ed5edf17dee2fdd4927ada30c9f8c3b520be1b5fd02a5da15bc10bff3e", "https://bcr.bazel.build/modules/apple_support/1.21.1/MODULE.bazel": "5809fa3efab15d1f3c3c635af6974044bac8a4919c62238cce06acee8a8c11f1", "https://bcr.bazel.build/modules/apple_support/1.24.1/MODULE.bazel": "f46e8ddad60aef170ee92b2f3d00ef66c147ceafea68b6877cb45bd91737f5f8", "https://bcr.bazel.build/modules/apple_support/1.24.2/MODULE.bazel": "0e62471818affb9f0b26f128831d5c40b074d32e6dda5a0d3852847215a41ca4", @@ -24,6 +25,7 @@ "https://bcr.bazel.build/modules/apple_support/2.5.4/MODULE.bazel": "964e9268b37edb64e9a0fa525e5b5e535ba56bf63cadc68375f92e69fcb734f6", "https://bcr.bazel.build/modules/apple_support/2.8.0/MODULE.bazel": "c45f5176057092afba0be6c48a9ea02101666802f8be536947e099e94757f8ed", "https://bcr.bazel.build/modules/apple_support/2.8.3/MODULE.bazel": "4afffdeb3a37825fdae637efb14ead4de27fe6310dbae96d071059e4e7b2e431", + "https://bcr.bazel.build/modules/apple_support/2.8.4/MODULE.bazel": "83ae0682db2a4ea86d20416a9b3bdba7f6c2a81e136b4d210e5986e30436585e", "https://bcr.bazel.build/modules/apple_support/2.9.1/MODULE.bazel": "fb209b83ed172af587419acb3340389cfe3260669e5f1c05e1ac3974aca614e0", "https://bcr.bazel.build/modules/aspect_bazel_lib/2.14.0/MODULE.bazel": "2b31ffcc9bdc8295b2167e07a757dbbc9ac8906e7028e5170a3708cecaac119f", "https://bcr.bazel.build/modules/aspect_bazel_lib/2.19.2/MODULE.bazel": "30dfabbfae0139b1f0036e01c201dd4c0167da3017f0b7ef3820d78e07622989", @@ -61,6 +63,7 @@ "https://bcr.bazel.build/modules/bazel_features/1.24.0/MODULE.bazel": "4796b4c25b47053e9bbffa792b3792d07e228ff66cd0405faef56a978708acd4", "https://bcr.bazel.build/modules/bazel_features/1.27.0/MODULE.bazel": "621eeee06c4458a9121d1f104efb80f39d34deff4984e778359c60eaf1a8cb65", "https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d", + "https://bcr.bazel.build/modules/bazel_features/1.3.0/MODULE.bazel": "cdcafe83ec318cda34e02948e81d790aab8df7a929cec6f6969f13a489ccecd9", "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", "https://bcr.bazel.build/modules/bazel_features/1.32.0/MODULE.bazel": "095d67022a58cb20f7e20e1aefecfa65257a222c18a938e2914fd257b5f1ccdc", "https://bcr.bazel.build/modules/bazel_features/1.33.0/MODULE.bazel": "8b8dc9d2a4c88609409c3191165bccec0e4cb044cd7a72ccbe826583303459f6", @@ -257,8 +260,6 @@ "https://bcr.bazel.build/modules/gcc_toolchain/0.13.0/MODULE.bazel": "8912be8684729c2814e922aa3555d163d1c6e7dbf620e72753fe44f3761250e4", "https://bcr.bazel.build/modules/gcc_toolchain/0.13.0/source.json": "41e8693ad56244dde548f7711126deda72eeff630f66f5e2d8403227d4a78097", "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", - "https://bcr.bazel.build/modules/google_benchmark/1.9.5/MODULE.bazel": "8a85cfd90b1e45e6e68f1aa2aa9efce3c04add57df732571d7fd54c07e7c5143", - "https://bcr.bazel.build/modules/google_benchmark/1.9.5/source.json": "0bd357fd9db30ee31d5eb4c78b1086ce3d79b4423ce76de19e8a2fa7b2fa2e10", "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", "https://bcr.bazel.build/modules/googletest/1.15.2/MODULE.bazel": "6de1edc1d26cafb0ea1a6ab3f4d4192d91a312fd2d360b63adaa213cd00b2108", @@ -271,8 +272,6 @@ "https://bcr.bazel.build/modules/jq.bzl/0.4.0/source.json": "52ec7530c4618e03f634b30ff719814a68d7d39c235938b7aa2abbfe1eb1c52c", "https://bcr.bazel.build/modules/jsoncpp/1.9.6.bcr.2/MODULE.bazel": "64f508885f907ac2518039b3d0c5c1703a8f6137d9f5d635067ba93d33c2670a", "https://bcr.bazel.build/modules/jsoncpp/1.9.6.bcr.2/source.json": "13199fa0a267ca46814e9e6ab313a71890c8f1822e57376fdc23a2d2cd384051", - "https://bcr.bazel.build/modules/libpfm/4.11.0.bcr.1/MODULE.bazel": "e5362dadc90aab6724c83a2cc1e67cbed9c89a05d97fb1f90053c8deb1e445c8", - "https://bcr.bazel.build/modules/libpfm/4.11.0.bcr.1/source.json": "0646414d9037f8aad148781dd760bec90b0b25ac12fda5e03f8aadbd6b9c61e6", "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", "https://bcr.bazel.build/modules/libxml2/2.15.3/MODULE.bazel": "a6bffafd8aa8b0c13eaa4bf25d55be188ec8548549395f03e98c39bab264adaa", "https://bcr.bazel.build/modules/libxml2/2.15.4/MODULE.bazel": "8d0bca5635a3ba19dddd0fcf0578b032f3c127f597e7f6b24cec3462bf10b824", @@ -285,6 +284,7 @@ "https://bcr.bazel.build/modules/mimalloc/3.5.3/source.json": "e94e4baf53f881236b86b16c436c6ab4a338b37135e370154802a7111c0dda28", "https://bcr.bazel.build/modules/nlohmann_json/3.12.0.bcr.1/MODULE.bazel": "a1c8bb07b5b91d971727c635f449d05623ac9608f6fe4f5f04254ea12f08e349", "https://bcr.bazel.build/modules/nlohmann_json/3.12.0.bcr.1/source.json": "93f82a5ae985eb935c539bfee95e04767187818189241ac956f3ccadbdb8fb02", + "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/MODULE.bazel": "6f7b417dcc794d9add9e556673ad25cb3ba835224290f4f848f8e2db1e1fca74", "https://bcr.bazel.build/modules/package_metadata/0.0.13/MODULE.bazel": "a9cc7e81640c1e7eaca5a465cdf4b63c88d416ca998fcded3680181b1602eee2", "https://bcr.bazel.build/modules/package_metadata/0.0.13/source.json": "f488e4534468eac223f6417dfdf8d3b7299166d36536408d37c2493ca1e8539d", "https://bcr.bazel.build/modules/package_metadata/0.0.2/MODULE.bazel": "fb8d25550742674d63d7b250063d4580ca530499f045d70748b1b142081ebb92", @@ -410,6 +410,7 @@ "https://bcr.bazel.build/modules/rules_pkg/1.3.0/MODULE.bazel": "ae0bdefbacc990c91f843206c90cf0f4be620639a5bf22119043599ba86d51a3", "https://bcr.bazel.build/modules/rules_pkg/1.3.0/source.json": "58ae84c545141762f7c434c0ce78bfb55ef0be08d84863e7f0503fff135fe4e2", "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", "https://bcr.bazel.build/modules/rules_proto/6.0.0/MODULE.bazel": "b531d7f09f58dce456cd61b4579ce8c86b38544da75184eadaf0a7cb7966453f", "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", @@ -434,6 +435,11 @@ "https://bcr.bazel.build/modules/rules_shell/0.7.1/MODULE.bazel": "257dd8d667371de804918dfceb86f6ddd2e1b5e025f5d9322878d4a73dc8aa58", "https://bcr.bazel.build/modules/rules_shell/0.8.0/MODULE.bazel": "f6a89f1d6a669a26f28fe814503857055d76306b79cfc11d12399af08d0b80ae", "https://bcr.bazel.build/modules/rules_shell/0.8.0/source.json": "eb53cc815bc503c6683c5fe12d943f98883f81fc22f51403ec8a95610cba4195", + "https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca", + "https://bcr.bazel.build/modules/rules_swift/2.4.0/MODULE.bazel": "1639617eb1ede28d774d967a738b4a68b0accb40650beadb57c21846beab5efd", + "https://bcr.bazel.build/modules/rules_swift/3.1.2/MODULE.bazel": "72c8f5cf9d26427cee6c76c8e3853eb46ce6b0412a081b2b6db6e8ad56267400", + "https://bcr.bazel.build/modules/rules_swift/4.1.1/MODULE.bazel": "74bc181e75147cadab7c5040ef59813168f50cf68f48b1c669cb928de4dc4148", + "https://bcr.bazel.build/modules/rules_swift/4.1.2/MODULE.bazel": "a76383e8994cee3ddaf75367083d0cf70a97b3f310c4d136b4d4c53d22c4fd45", "https://bcr.bazel.build/modules/rules_swift/4.2.2/MODULE.bazel": "dce65c0c22c5880dc0060b525dbbb7c44ede24e317e27509064512aa92fe237e", "https://bcr.bazel.build/modules/rules_swift/4.2.2/source.json": "4d8348d47ac5495a40a86235fff26202f9e578188fae00dec806b7c6d9d73487", "https://bcr.bazel.build/modules/rules_zig/0.17.0/MODULE.bazel": "2c1c08adc986cfdb5fee97e21982cac846f8a20a6a8054ae9cab8b02721c2011", @@ -447,6 +453,8 @@ "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", "https://bcr.bazel.build/modules/stardoc/0.7.1/source.json": "b6500ffcd7b48cd72c29bb67bcac781e12701cc0d6d55d266a652583cfcdab01", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/MODULE.bazel": "5e463fbfba7b1701d957555ed45097d7f984211330106ccd1352c6e0af0dcf91", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.2/MODULE.bazel": "75aab2373a4bbe2a1260b9bf2a1ebbdbf872d3bd36f80bff058dccd82e89422f", "https://bcr.bazel.build/modules/swift_argument_parser/1.7.0/MODULE.bazel": "40d4e44950e44973dcf8590bcee637591de196b5dbe3696d07eb342b74d53672", "https://bcr.bazel.build/modules/swift_argument_parser/1.7.0/source.json": "b9b952cba0c748083b9b891e6ac46d347c92d37e8a92ead96d2a54b966bacd87", "https://bcr.bazel.build/modules/tar.bzl/0.10.1/MODULE.bazel": "bf5fda5b5ccef8c3c4a5f4886144377386e0baa382972f257acb42dcf40ea908", @@ -17592,17 +17600,17 @@ "@@rules_zig+//zig:extensions.bzl%zig": { "general": { "bzlTransitiveDigest": "vTeQKV6Xl5RuIpCwuarKlx1FwNYsPvKFOklJop5h/mI=", - "usagesDigest": "QF0FP4iBd3UL3eOAQ/3YQ/7Y7gdmVPz2aHt0+5zCriE=", + "usagesDigest": "wbVXTaIKBf7g3e5qCNbn0MxEyRFJdnOR+xjO2nz4Pkw=", "recordedInputs": [ "REPO_MAPPING:rules_zig+,bazel_skylib bazel_skylib+", "REPO_MAPPING:rules_zig+,bazel_tools bazel_tools", "FILE:@@rules_zig+//zig/private/versions.json 868467564510b7a7f1bae1d36ac90bf8bc6632f22243ab13bf2040e5cce026d2" ], "generatedRepoSpecs": { - "zig_0.17.0_aarch64-linux": { + "zig_0.16.0_aarch64-linux": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.17.0/zig-aarch64-linux-0.17.0.tar.xz", + "url": "https://ziglang.org/download/0.16.0/zig-aarch64-linux-0.16.0.tar.xz", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17618,15 +17626,15 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "9e8d11661d4ae3bd57702a3832781e23ad151dde5798e16a5ccd503f65234ff8", - "zig_version": "0.17.0", + "sha256": "ea4b09bfb22ec6f6c6ceac57ab63efb6b46e17ab08d21f69f3a48b38e1534f17", + "zig_version": "0.16.0", "platform": "aarch64-linux" } }, - "zig_0.17.0_aarch64-macos": { + "zig_0.16.0_aarch64-macos": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.17.0/zig-aarch64-macos-0.17.0.tar.xz", + "url": "https://ziglang.org/download/0.16.0/zig-aarch64-macos-0.16.0.tar.xz", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17642,15 +17650,15 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "b607e9b9234790a008116ae5bdb71c6243b84b9fb42a53a9e70fde41c06c536a", - "zig_version": "0.17.0", + "sha256": "b23d70deaa879b5c2d486ed3316f7eaa53e84acf6fc9cc747de152450d401489", + "zig_version": "0.16.0", "platform": "aarch64-macos" } }, - "zig_0.17.0_aarch64-windows": { + "zig_0.16.0_aarch64-windows": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.17.0/zig-aarch64-windows-0.17.0.zip", + "url": "https://ziglang.org/download/0.16.0/zig-aarch64-windows-0.16.0.zip", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17666,15 +17674,15 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "0a59d91fa1cb40cf068e9b0954434ce973500c7a2ea749f1e01af62cdab52d26", - "zig_version": "0.17.0", + "sha256": "aee38316ee4111717900f45dd3130145c39289e105541d737eb8c5ed653c78ef", + "zig_version": "0.16.0", "platform": "aarch64-windows" } }, - "zig_0.17.0_x86_64-linux": { + "zig_0.16.0_x86_64-linux": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.17.0/zig-x86_64-linux-0.17.0.tar.xz", + "url": "https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17690,15 +17698,15 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "1cbe9df9f27e6b78d14ccbca43b6703a404ef79ef1c463de901d7f088d4e2026", - "zig_version": "0.17.0", + "sha256": "70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00", + "zig_version": "0.16.0", "platform": "x86_64-linux" } }, - "zig_0.17.0_x86_64-macos": { + "zig_0.16.0_x86_64-macos": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.17.0/zig-x86_64-macos-0.17.0.tar.xz", + "url": "https://ziglang.org/download/0.16.0/zig-x86_64-macos-0.16.0.tar.xz", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17714,15 +17722,15 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "4f9a1c5269aa17ebda5e6d3c2b89d6cbf36f7d2b22a0306e9ab98f25f95529c6", - "zig_version": "0.17.0", + "sha256": "0387557ed1877bc6a2e1802c8391953baddba76081876301c522f52977b52ba7", + "zig_version": "0.16.0", "platform": "x86_64-macos" } }, - "zig_0.17.0_x86_64-windows": { + "zig_0.16.0_x86_64-windows": { "repoRuleId": "@@rules_zig+//zig/private/repo:zig_repository.bzl%zig_repository", "attributes": { - "url": "https://ziglang.org/download/0.17.0/zig-x86_64-windows-0.17.0.zip", + "url": "https://ziglang.org/download/0.16.0/zig-x86_64-windows-0.16.0.zip", "mirrors": [ "https://pkg.machengine.org/zig", "https://zigmirror.hryx.net/zig", @@ -17738,8 +17746,8 @@ "https://pkg.earth/zig", "https://fs.liujiacai.net/zigbuilds" ], - "sha256": "b5663f69581dcf391293fbf16c06cb80d81d806545ce618b4d0bab7f0eb8c428", - "zig_version": "0.17.0", + "sha256": "68659eb5f1e4eb1437a722f1dd889c5a322c9954607f5edcf337bc3684a75a7e", + "zig_version": "0.16.0", "platform": "x86_64-windows" } }, @@ -17747,28 +17755,28 @@ "repoRuleId": "@@rules_zig+//zig/private/repo:toolchains_repo.bzl%toolchains_repo", "attributes": { "names": [ - "zig_0.17.0_aarch64-linux", - "zig_0.17.0_aarch64-macos", - "zig_0.17.0_aarch64-windows", - "zig_0.17.0_x86_64-linux", - "zig_0.17.0_x86_64-macos", - "zig_0.17.0_x86_64-windows" + "zig_0.16.0_aarch64-linux", + "zig_0.16.0_aarch64-macos", + "zig_0.16.0_aarch64-windows", + "zig_0.16.0_x86_64-linux", + "zig_0.16.0_x86_64-macos", + "zig_0.16.0_x86_64-windows" ], "labels": [ - "@zig_0.17.0_aarch64-linux//:zig_toolchain", - "@zig_0.17.0_aarch64-macos//:zig_toolchain", - "@zig_0.17.0_aarch64-windows//:zig_toolchain", - "@zig_0.17.0_x86_64-linux//:zig_toolchain", - "@zig_0.17.0_x86_64-macos//:zig_toolchain", - "@zig_0.17.0_x86_64-windows//:zig_toolchain" + "@zig_0.16.0_aarch64-linux//:zig_toolchain", + "@zig_0.16.0_aarch64-macos//:zig_toolchain", + "@zig_0.16.0_aarch64-windows//:zig_toolchain", + "@zig_0.16.0_x86_64-linux//:zig_toolchain", + "@zig_0.16.0_x86_64-macos//:zig_toolchain", + "@zig_0.16.0_x86_64-windows//:zig_toolchain" ], "zig_versions": [ - "0.17.0", - "0.17.0", - "0.17.0", - "0.17.0", - "0.17.0", - "0.17.0" + "0.16.0", + "0.16.0", + "0.16.0", + "0.16.0", + "0.16.0", + "0.16.0" ], "exec_lengths": [ 2, @@ -18003,6 +18011,22 @@ "@@aspect_tools_telemetry+//:extension.bzl%telemetry": { "notice_version": "3" }, + "@@rules_dx+//ocaml/toolchain:repos.bzl%ocaml": { + "691408b00730fcedbd3e30ccdb42c388a83fd304/astring.0.8.5": { + "needs": [ + "ocamlfind", + "ocamlbuild", + "topkg" + ], + "sha256": "865692630c07c3ab87c66cdfc2734c0fdfc9c34a57f8e89ffec7c7d15e7a70fa", + "src": "https://erratique.ch/software/astring/releases/astring-0.8.5.tbz" + }, + "691408b00730fcedbd3e30ccdb42c388a83fd304/either.1.0.0": { + "needs": [], + "sha256": "bf674de3312dee7b7215f07df1e8a96eb3d679164b8a918cdd95b8d97e505884", + "src": "https://github.com/mirage/either/releases/download/1.0.0/either-1.0.0.tbz" + } + }, "@@rules_go+//go:extensions.bzl%go_sdk": { "1.22.4": { "aix_ppc64": [