Skip to content

Commit 15fde87

Browse files
authored
Merge pull request #21276 from github/redsun82/bazel-9
Upgrade Bazel to 9.0.0
2 parents 1dba99f + a5905a6 commit 15fde87

File tree

20 files changed

+72
-26
lines changed

20 files changed

+72
-26
lines changed

.bazelrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ build --compilation_mode opt
1111
common --override_module=semmle_code=%workspace%/misc/bazel/semmle_code_stub
1212

1313
build --repo_env=CC=clang --repo_env=CXX=clang++
14+
# Disable Android SDK auto-detection (we don't use it, and rules_android has Bazel 9 compatibility issues)
15+
build --repo_env=ANDROID_HOME=
1416

1517
# print test output, like sembuild does.
1618
# Set to `errors` if this is too verbose.
@@ -34,7 +36,7 @@ common --@rules_dotnet//dotnet/settings:strict_deps=false
3436
common --@rules_rust//rust/toolchain/channel=nightly
3537

3638
# Reduce this eventually to empty, once we've fixed all our usages of java, and https://github.com/bazel-contrib/rules_go/issues/4193 is fixed
37-
common --incompatible_autoload_externally="+@rules_java,+@rules_shell"
39+
common --incompatible_autoload_externally="+@rules_cc,+@rules_java,+@rules_shell"
3840

3941
build --java_language_version=17
4042
build --tool_java_language_version=17

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.4.2
1+
9.0.0

MODULE.bazel

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@ local_path_override(
1515
# see https://registry.bazel.build/ for a list of available packages
1616

1717
bazel_dep(name = "platforms", version = "1.0.0")
18-
bazel_dep(name = "rules_go", version = "0.56.1")
18+
bazel_dep(name = "rules_cc", version = "0.2.16")
19+
bazel_dep(name = "rules_go", version = "0.59.0")
20+
bazel_dep(name = "rules_java", version = "9.0.3")
1921
bazel_dep(name = "rules_pkg", version = "1.0.1")
20-
bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1")
22+
bazel_dep(name = "rules_nodejs", version = "6.7.3")
2123
bazel_dep(name = "rules_python", version = "0.40.0")
2224
bazel_dep(name = "rules_shell", version = "0.5.0")
2325
bazel_dep(name = "bazel_skylib", version = "1.8.1")
2426
bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "absl")
2527
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
2628
bazel_dep(name = "fmt", version = "12.1.0-codeql.1")
27-
bazel_dep(name = "rules_kotlin", version = "2.2.0-codeql.1")
28-
bazel_dep(name = "gazelle", version = "0.40.0")
29+
bazel_dep(name = "rules_kotlin", version = "2.2.2-codeql.1")
30+
bazel_dep(name = "gazelle", version = "0.47.0")
2931
bazel_dep(name = "rules_dotnet", version = "0.21.5-codeql.1")
3032
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
3133
bazel_dep(name = "rules_rust", version = "0.68.1.codeql.1")
@@ -188,6 +190,15 @@ pip.parse(
188190
)
189191
use_repo(pip, "codegen_deps")
190192

193+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
194+
python.toolchain(
195+
is_default = True,
196+
python_version = "3.12",
197+
)
198+
use_repo(python, "python_3_12", "python_versions")
199+
200+
register_toolchains("@python_versions//3.12:all")
201+
191202
swift_deps = use_extension("//swift/third_party:load.bzl", "swift_deps")
192203

193204
# following list can be kept in sync with `bazel mod tidy`

javascript/extractor/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@rules_java//java:defs.bzl", "java_library")
12
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
23
load("@semmle_code//:common.bzl", "codeql_fat_jar", "codeql_java_project")
34

javascript/extractor/test/com/semmle/js/extractor/test/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_java//java:defs.bzl", "java_test")
2+
13
java_test(
24
name = "test",
35
srcs = glob(["**/*.java"]),

misc/bazel/cmake/cmake.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
2+
13
CmakeInfo = provider(
24
fields = {
35
"name": "",

misc/bazel/internal/zipmerge/BUILD.bazel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
2+
13
cc_library(
24
name = "lib",
35
srcs = [
@@ -28,7 +30,7 @@ cc_test(
2830
linkstatic = True, # required to build the test in the internal repo
2931
deps = [
3032
":lib",
31-
"@bazel_tools//tools/cpp/runfiles",
3233
"@googletest//:gtest_main",
34+
"@rules_cc//cc/runfiles",
3335
],
3436
)

misc/bazel/internal/zipmerge/zipmerge_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
#include <gtest/gtest.h>
1111
#include <gmock/gmock.h>
12-
#include "tools/cpp/runfiles/runfiles.h"
12+
#include "rules_cc/cc/runfiles/runfiles.h"
1313

14-
using bazel::tools::cpp::runfiles::Runfiles;
14+
using rules_cc::cc::runfiles::Runfiles;
1515
using namespace std::string_literals;
1616
namespace fs = std::filesystem;
1717

misc/bazel/registry/fix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ def update(data):
6262
patch_json(
6363
version / "source.json",
6464
patches={
65-
p.name: sha256(p) for p in patches.iterdir()
65+
p.name: sha256(p) for p in sorted(patches.iterdir())
6666
} if patches.is_dir() else None,
6767
patch_strip=1 if patches.is_dir() else None,
6868
overlay={
69-
o.name: sha256(o) for o in overlay.iterdir()
69+
o.name: sha256(o) for o in sorted(overlay.iterdir())
7070
} if overlay.is_dir() else None,
7171
)

misc/bazel/registry/modules/rules_kotlin/2.2.0-codeql.1/source.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)