diff --git a/MODULE.bazel b/MODULE.bazel index 4bbe7bb52cba..c1c940ee744f 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -30,7 +30,7 @@ bazel_dep(name = "gazelle", version = "0.54.0") bazel_dep(name = "rules_dotnet", version = "0.23.0-codeql.1") bazel_dep(name = "googletest", version = "1.18.0.bcr.1") bazel_dep(name = "rules_rust", version = "0.75.0") -bazel_dep(name = "rules_swift", version = "4.2.2-codeql.1") +bazel_dep(name = "rules_swift", version = "4.3.0-codeql.1") bazel_dep(name = "swift-syntax", version = "604.0.0") bazel_dep(name = "zstd", version = "1.5.7.bcr.3") diff --git a/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/source.json b/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/source.json deleted file mode 100644 index 3a579cb9f398..000000000000 --- a/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/source.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "integrity": "sha256-0qlu7XFoSHcFHojdLCp3LtvbdU3kiM7gZt1yzOJAz8Y=", - "url": "https://github.com/bazelbuild/rules_swift/releases/download/4.2.2/rules_swift.4.2.2.tar.gz", - "patches": { - "external_static_runtime.patch": "sha256-kFxCR0aeygkmsSWQur8JpStRepc9sqI+WENUd61wEOo=", - "module_dot_bazel_version.patch": "sha256-9hq60gxavLu+lHxu15eHjUgWXjIRvkbStMWTC5PiZ7k=", - "register_downloaded_macos_toolchain.patch": "sha256-JWvdIt3rWsbS5zZQ1lZJv08uEaTa1OJPs5t/lMGi6fc=" - }, - "patch_strip": 1 -} diff --git a/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/MODULE.bazel b/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/MODULE.bazel similarity index 99% rename from misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/MODULE.bazel rename to misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/MODULE.bazel index 1eb2e3934c5f..18b5694620f1 100644 --- a/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/MODULE.bazel +++ b/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/MODULE.bazel @@ -2,7 +2,7 @@ module( name = "rules_swift", - version = "4.2.2-codeql.1", + version = "4.3.0-codeql.1", bazel_compatibility = [">=8.0.0"], compatibility_level = 3, ) @@ -10,7 +10,7 @@ module( bazel_dep(name = "abseil-cpp", version = "20250814.1") bazel_dep(name = "apple_support", version = "2.9.1") bazel_dep(name = "bazel_linux_packages", version = "0.4.1") -bazel_dep(name = "bazel_features", version = "1.51.0") +bazel_dep(name = "bazel_features", version = "1.54.0") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "nlohmann_json", version = "3.12.0.bcr.1") bazel_dep(name = "platforms", version = "0.0.11") diff --git a/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/patches/external_static_runtime.patch b/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/patches/external_static_runtime.patch similarity index 92% rename from misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/patches/external_static_runtime.patch rename to misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/patches/external_static_runtime.patch index 9c5096e5b24f..16d013b4a2f1 100644 --- a/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/patches/external_static_runtime.patch +++ b/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/patches/external_static_runtime.patch @@ -1,8 +1,8 @@ diff --git a/swift/extensions.bzl b/swift/extensions.bzl -index 9a4ffd5..b42d7dc 100644 +index 8764c59..66c6b75 100644 --- a/swift/extensions.bzl +++ b/swift/extensions.bzl -@@ -186,6 +186,7 @@ def _standalone_toolchain_impl(module_ctx): +@@ -196,6 +196,7 @@ def _standalone_toolchain_impl(module_ctx): name = repository_name, sha256 = sha256, platform = platform, @@ -10,7 +10,7 @@ index 9a4ffd5..b42d7dc 100644 swift_version = swift_version, ) toolchains_build_file_content += toolchains_for_platform( -@@ -261,6 +262,9 @@ their hashes. For instance: +@@ -277,6 +278,9 @@ their hashes. For instance: `bazel run @rules_swift//tools/swift-releases -- list 6.2.4` """, ), @@ -21,7 +21,7 @@ index 9a4ffd5..b42d7dc 100644 "swift_version_file": attr.label(doc = "A label to the .swift_version file to use. Cannot be used concurrently with `swift_version`"), }) diff --git a/swift/internal/extensions/standalone_toolchain.bzl b/swift/internal/extensions/standalone_toolchain.bzl -index e3e621d..3fd890a 100644 +index a710f32..dc09845 100644 --- a/swift/internal/extensions/standalone_toolchain.bzl +++ b/swift/internal/extensions/standalone_toolchain.bzl @@ -110,6 +110,9 @@ def _standalone_toolchain_impl(repository_ctx): @@ -34,7 +34,7 @@ index e3e621d..3fd890a 100644 "{linux_sysroot_version}": linux_sysroot_version, "{swift_version}": repository_ctx.attr.swift_version, }, -@@ -125,6 +128,9 @@ standalone_toolchain = repository_rule( +@@ -128,6 +131,9 @@ standalone_toolchain = repository_rule( "sha256": attr.string( doc = "The expected SHA-256 of the file downloaded. This must match the SHA-256 of the file downloaded.", ), @@ -69,10 +69,10 @@ index 1a8db31..fff0879 100644 "//swift/internal:wmo", "//swift/toolchains/config:action_config", diff --git a/swift/toolchains/swift_toolchain.bzl b/swift/toolchains/swift_toolchain.bzl -index 071b278..3579131 100644 +index 6cd6567..5dfc4da 100644 --- a/swift/toolchains/swift_toolchain.bzl +++ b/swift/toolchains/swift_toolchain.bzl -@@ -71,6 +71,11 @@ load( +@@ -73,6 +73,11 @@ load( "SwiftModuleAliasesInfo", ) load("//swift/internal:target_triples.bzl", "target_triples") @@ -84,7 +84,7 @@ index 071b278..3579131 100644 load( "//swift/internal:utils.bzl", "collect_cross_import_overlays", -@@ -103,6 +108,64 @@ load( +@@ -105,6 +110,64 @@ load( ) load("//swift/toolchains/config:tool_config.bzl", "ToolConfigInfo") @@ -149,7 +149,7 @@ index 071b278..3579131 100644 def _swift_compile_resource_set(_os, inputs_size): # The `os` argument is unused, but the Starlark API requires both # positional arguments. -@@ -674,6 +737,7 @@ def _resolve_sdkroot(ctx, cc_toolchain): +@@ -685,6 +748,7 @@ def _resolve_sdkroot(ctx, cc_toolchain): def _swift_toolchain_impl(ctx): toolchain_root = ctx.attr.root @@ -157,7 +157,7 @@ index 071b278..3579131 100644 cc_toolchain = find_cc_toolchain(ctx) target_system_name = _parse_target_system_name( arch = ctx.attr.arch, -@@ -696,7 +760,7 @@ def _swift_toolchain_impl(ctx): +@@ -707,7 +771,7 @@ def _swift_toolchain_impl(ctx): "before invoking Bazel, or configure a Bazel LLVM CC toolchain. " + "The current CC toolchain is configured to use '{}'.".format(cc_toolchain.compiler)) @@ -166,7 +166,7 @@ index 071b278..3579131 100644 if ctx.attr.swift_tools: if ctx.attr.swift_executable: -@@ -741,6 +805,18 @@ def _swift_toolchain_impl(ctx): +@@ -753,6 +817,18 @@ def _swift_toolchain_impl(ctx): ctx.attr.linkopts, ctx.files.linker_inputs, ) @@ -185,7 +185,7 @@ index 071b278..3579131 100644 else: ( swift_linkopts_cc_info, -@@ -768,6 +844,8 @@ def _swift_toolchain_impl(ctx): +@@ -780,6 +856,8 @@ def _swift_toolchain_impl(ctx): swiftcopts.extend(ctx.attr._exec_copts[BuildSettingInfo].value) else: swiftcopts.extend(ctx.attr._copts[BuildSettingInfo].value) @@ -194,7 +194,7 @@ index 071b278..3579131 100644 # Combine build mode features, autoconfigured features, and required # features. -@@ -779,7 +857,7 @@ def _swift_toolchain_impl(ctx): +@@ -791,7 +869,7 @@ def _swift_toolchain_impl(ctx): target_triple = target_triple, )) @@ -203,7 +203,7 @@ index 071b278..3579131 100644 requested_features.append(SWIFT_FEATURE__SUPPORTS_HERMETIC_SWIFTMODULE) if apple_common.dotted_version(ctx.attr.parsed_version) >= apple_common.dotted_version("6.4"): -@@ -796,6 +874,8 @@ def _swift_toolchain_impl(ctx): +@@ -808,6 +886,8 @@ def _swift_toolchain_impl(ctx): additional_tools = [ctx.file.version_file] if ctx.attr.swift_tools: additional_tools += ctx.attr.swift_tools[SwiftToolsInfo].additional_inputs @@ -212,7 +212,7 @@ index 071b278..3579131 100644 all_tool_configs = _all_tool_configs( env = ctx.attr.env, -@@ -883,7 +963,7 @@ def _swift_toolchain_impl(ctx): +@@ -901,7 +981,7 @@ def _swift_toolchain_impl(ctx): implicit_system_modules = collect_implicit_deps_providers([]), swift_worker = ctx.attr._worker[DefaultInfo].files_to_run, swift_worker_protocol = "proto" if ctx.attr._use_proto_worker[BuildSettingInfo].value else "json", @@ -221,7 +221,7 @@ index 071b278..3579131 100644 test_configuration = struct( binary_name = "{name}", env = env, -@@ -1013,6 +1093,10 @@ The root of a SDK to be used for building the target. +@@ -1031,6 +1111,10 @@ The root of a SDK to be used for building the target. """, mandatory = False, ), diff --git a/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/patches/module_dot_bazel_version.patch b/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/patches/module_dot_bazel_version.patch similarity index 67% rename from misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/patches/module_dot_bazel_version.patch rename to misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/patches/module_dot_bazel_version.patch index f99292ab42b4..f715b828c2bc 100644 --- a/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/patches/module_dot_bazel_version.patch +++ b/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/patches/module_dot_bazel_version.patch @@ -2,4 +2,4 @@ +++ b/MODULE.bazel @@ -5 +5 @@ - version = "0", -+ version = "4.2.2-codeql.1", ++ version = "4.3.0-codeql.1", diff --git a/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/patches/register_downloaded_macos_toolchain.patch b/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/patches/register_downloaded_macos_toolchain.patch similarity index 88% rename from misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/patches/register_downloaded_macos_toolchain.patch rename to misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/patches/register_downloaded_macos_toolchain.patch index 1f2a4ea4a6aa..c57ac0b68202 100644 --- a/misc/bazel/registry/modules/rules_swift/4.2.2-codeql.1/patches/register_downloaded_macos_toolchain.patch +++ b/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/patches/register_downloaded_macos_toolchain.patch @@ -1,5 +1,5 @@ diff --git a/swift/internal/extensions/standalone_toolchain.bzl b/swift/internal/extensions/standalone_toolchain.bzl -index 3fd890a..dfa6c39 100644 +index dc09845..7dba57c 100644 --- a/swift/internal/extensions/standalone_toolchain.bzl +++ b/swift/internal/extensions/standalone_toolchain.bzl @@ -100,6 +100,11 @@ def _standalone_toolchain_impl(repository_ctx): @@ -14,7 +14,7 @@ index 3fd890a..dfa6c39 100644 repository_ctx.file(".swift-version", repository_ctx.attr.swift_version) linux_sysroot_version = "22.04" -@@ -114,6 +119,7 @@ def _standalone_toolchain_impl(repository_ctx): +@@ -114,11 +119,13 @@ def _standalone_toolchain_impl(repository_ctx): ' external_static_runtime = "{}",'.format(repository_ctx.attr.static_runtime) if repository_ctx.attr.static_runtime else "" ), "{linux_sysroot_version}": linux_sysroot_version, @@ -22,6 +22,13 @@ index 3fd890a..dfa6c39 100644 "{swift_version}": repository_ctx.attr.swift_version, }, ) + if hasattr(repository_ctx, "repo_metadata"): +- return repository_ctx.repo_metadata(reproducible = True) ++ # The Xcode SDK path depends on the local host. ++ return repository_ctx.repo_metadata(reproducible = repository_ctx.attr.platform != "xcode") + return None + + standalone_toolchain = repository_rule( diff --git a/swift/internal/extensions/toolchain.BUILD b/swift/internal/extensions/toolchain.BUILD index 6981a02..7ea996c 100644 --- a/swift/internal/extensions/toolchain.BUILD @@ -56,7 +63,7 @@ index 6981a02..7ea996c 100644 "@platforms//os:linux": glob( [ diff --git a/swift/internal/extensions/toolchains.bzl b/swift/internal/extensions/toolchains.bzl -index c969e31..faf4547 100644 +index ea867cc..2116672 100644 --- a/swift/internal/extensions/toolchains.bzl +++ b/swift/internal/extensions/toolchains.bzl @@ -125,12 +125,11 @@ def toolchains_for_platform(platform, toolchain_repository): @@ -78,10 +85,10 @@ index c969e31..faf4547 100644 if platform in ( "ubuntu22.04", diff --git a/swift/toolchains/swift_toolchain.bzl b/swift/toolchains/swift_toolchain.bzl -index 3579131..afb9ac1 100644 +index 5dfc4da..a582dfb 100644 --- a/swift/toolchains/swift_toolchain.bzl +++ b/swift/toolchains/swift_toolchain.bzl -@@ -669,10 +669,14 @@ def _parse_target_system_name(*, arch, os, target_system_name): +@@ -671,10 +671,14 @@ def _parse_target_system_name(*, arch, os, target_system_name): """Returns the target system name set by the CC toolchain or attempts to create one based on the OS and arch.""" if target_system_name and target_system_name != "local": @@ -96,7 +103,7 @@ index 3579131..afb9ac1 100644 elif os == "windows": # The MSVC cc toolchain reports a `target_gnu_system_name` of "local", # so synthesize the triple. -@@ -785,6 +789,17 @@ def _swift_toolchain_impl(ctx): +@@ -796,6 +800,17 @@ def _swift_toolchain_impl(ctx): ) elif ctx.attr.os == "none": swift_linkopts_cc_info = CcInfo() diff --git a/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/source.json b/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/source.json new file mode 100644 index 000000000000..f4e20f3313b8 --- /dev/null +++ b/misc/bazel/registry/modules/rules_swift/4.3.0-codeql.1/source.json @@ -0,0 +1,10 @@ +{ + "integrity": "sha256-wZb1E4CPgdyerYM9kmmE0geItTT3T7N8Zq12KVosfZo=", + "url": "https://github.com/bazelbuild/rules_swift/releases/download/4.3.0/rules_swift.4.3.0.tar.gz", + "patches": { + "external_static_runtime.patch": "sha256-+Coche5M0G55uTKNY0GNOPR2rKt34XaZ0abV+1LdDj0=", + "module_dot_bazel_version.patch": "sha256-nIM6WgxraGldItP49+rfJVJZy0UoFh4CWxk+6vijOvA=", + "register_downloaded_macos_toolchain.patch": "sha256-zTJcMl4Md8vIECoNYR+DYeDaK6GdF2AgpG8umJOo4RA=" + }, + "patch_strip": 1 +} diff --git a/misc/bazel/registry/modules/rules_swift/metadata.json b/misc/bazel/registry/modules/rules_swift/metadata.json index 02d511011b58..ab62afbd6d9c 100644 --- a/misc/bazel/registry/modules/rules_swift/metadata.json +++ b/misc/bazel/registry/modules/rules_swift/metadata.json @@ -5,7 +5,7 @@ "github:bazelbuild/rules_swift" ], "versions": [ - "4.2.2-codeql.1" + "4.3.0-codeql.1" ], "yanked_versions": {} }