Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

module(
name = "rules_swift",
version = "4.2.2-codeql.1",
version = "4.3.0-codeql.1",
bazel_compatibility = [">=8.0.0"],
compatibility_level = 3,
)

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")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
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,
+ static_runtime = toolchain.static_runtime if platform != "xcode" else None,
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`
""",
),
Expand All @@ -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):
Expand All @@ -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.",
),
Expand Down Expand Up @@ -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")
Expand All @@ -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")

Expand Down Expand Up @@ -149,15 +149,15 @@ 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
+ external_static_runtime = ctx.attr.external_static_runtime[SwiftStaticRuntimeInfo] if ctx.attr.external_static_runtime else None
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))

Expand All @@ -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,
)
Expand All @@ -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)
Expand All @@ -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,
))

Expand All @@ -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
Expand All @@ -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",
Expand All @@ -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,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
+++ b/MODULE.bazel
@@ -5 +5 @@
- version = "0",
+ version = "4.2.2-codeql.1",
+ version = "4.3.0-codeql.1",
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -14,14 +14,21 @@ 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,
+ "{macos_sdkroot}": macos_sdkroot,
"{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
Expand Down Expand Up @@ -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):
Expand All @@ -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":
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion misc/bazel/registry/modules/rules_swift/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"github:bazelbuild/rules_swift"
],
"versions": [
"4.2.2-codeql.1"
"4.3.0-codeql.1"
],
"yanked_versions": {}
}
Loading