From 5b5dc9c70831f1f3e19a442b45699b0691139097 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 25 Feb 2026 13:52:25 +0100 Subject: [PATCH 1/2] Bazel: load `rules_cc` explicitly Turns out in https://github.com/github/codeql/pull/21371 I was right about `java_*` rules not relying on autoload anywhere, but it turns out some `cc_*` rules still relied on autoload. This autoload is currently configured in the internal repository, but we want to remove it eventually. This patch: * adds explicit loads to `rules_cc` * removes an obsolete file (that depedency has its own bazel module since some time, we just forgot to remove the old file) --- swift/third_party/BUILD.binlog.bazel | 2 ++ swift/third_party/BUILD.fmt.bazel | 10 ---------- swift/third_party/BUILD.picosha2.bazel | 2 ++ swift/third_party/BUILD.swift-llvm-support.bazel | 2 ++ 4 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 swift/third_party/BUILD.fmt.bazel diff --git a/swift/third_party/BUILD.binlog.bazel b/swift/third_party/BUILD.binlog.bazel index 78db04fa3e2b..24f0f7e0fd31 100644 --- a/swift/third_party/BUILD.binlog.bazel +++ b/swift/third_party/BUILD.binlog.bazel @@ -1,3 +1,5 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") + cc_library( name = "binlog", srcs = glob(["include/**/*.cpp"]), diff --git a/swift/third_party/BUILD.fmt.bazel b/swift/third_party/BUILD.fmt.bazel deleted file mode 100644 index 78a3639bf26c..000000000000 --- a/swift/third_party/BUILD.fmt.bazel +++ /dev/null @@ -1,10 +0,0 @@ -cc_library( - name = "fmt", - srcs = [ - "src/format.cc", - "src/os.cc", - ], - hdrs = glob(["include/**/*.h"]), - includes = ["include"], - visibility = ["//visibility:public"], -) diff --git a/swift/third_party/BUILD.picosha2.bazel b/swift/third_party/BUILD.picosha2.bazel index b6eb4292cb82..dd6ca9c080fd 100644 --- a/swift/third_party/BUILD.picosha2.bazel +++ b/swift/third_party/BUILD.picosha2.bazel @@ -1,3 +1,5 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + cc_library( name = "picosha2", hdrs = glob(["*.h"]), diff --git a/swift/third_party/BUILD.swift-llvm-support.bazel b/swift/third_party/BUILD.swift-llvm-support.bazel index 231500b35abb..6390ca31718a 100644 --- a/swift/third_party/BUILD.swift-llvm-support.bazel +++ b/swift/third_party/BUILD.swift-llvm-support.bazel @@ -1,3 +1,5 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + cc_library( name = "swift-llvm-support-static", srcs = glob( From 4d0c72eafecf586b0de4bc1c7ed7f59e260e0e9e Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 25 Feb 2026 14:05:53 +0100 Subject: [PATCH 2/2] Bazel: add explicit `rules_shell` load --- swift/third_party/load.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swift/third_party/load.bzl b/swift/third_party/load.bzl index d19345a18803..f2ebfa748776 100644 --- a/swift/third_party/load.bzl +++ b/swift/third_party/load.bzl @@ -1,6 +1,7 @@ load("@bazel_skylib//rules:write_file.bzl", "write_file") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") +load("@rules_shell//shell:sh_test.bzl", "sh_test") load("//misc/bazel:lfs.bzl", "lfs_archive", "lfs_files") _override = { @@ -117,7 +118,7 @@ def test_no_override(): content = test_body, is_executable = True, ) - native.sh_test( + sh_test( name = "test-no-override", srcs = [":test-no-override-gen"], tags = ["override"],