Skip to content

Commit 8491147

Browse files
chore(deps): update dependency bazel to v9.0.0 (#592)
* chore(deps): update dependency bazel to v9.0.0 * add Bazel 9.x to BCR presubmit configuration * Update cc_common.link API hack Closes #589. * Invoke cc_common.link directly without workaround * Revert "Invoke cc_common.link directly without workaround" This reverts commit a0908a9. As of rules_cc 0.2.18 with Bazel 9.0.0 we can use the cc_common.link main_output parameter directly. However, Bazel 8.4.1 does not support this yet and still requires the workaround. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
1 parent a687623 commit 8491147

14 files changed

Lines changed: 52 additions & 34 deletions

File tree

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
9.0.0-pre.20250831.1
1+
9.0.0
22
# The first line of this file is used by Bazelisk and Bazel to be sure
33
# the right version of Bazel is used to build and test this repo.
44
# This also defines which version is used on CI.

.bcr/presubmit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
matrix:
22
platform: ["ubuntu2204", "macos"] # ["windows"]
3-
bazel: [8.x]
3+
bazel: [8.x, 9.x]
44
tasks:
55
run_tests:
66
name: "Run tests"
@@ -14,7 +14,7 @@ bcr_test_module:
1414
module_path: "e2e/workspace"
1515
matrix:
1616
platform: ["ubuntu2204", "macos"] # ["windows"]
17-
bazel: [8.x]
17+
bazel: [8.x, 9.x]
1818
tasks:
1919
run_tests:
2020
name: "Run test module"

BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ filegroup(
3434
":BUILD.bazel",
3535
":MODULE.bazel",
3636
":WORKSPACE",
37+
"//tools:all_files",
3738
"//zig:all_files",
3839
],
3940
visibility = ["//visibility:public"],

MODULE.bazel

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,3 @@ use_repo(
9090
# rules_bazel_integration_test/tools/update_deleted_packages.sh when invoked
9191
# through the rules_multirun target //util:update.
9292
bazel_dep(name = "cgrindel_bazel_starlib", version = "0.30.0", dev_dependency = True)
93-
94-
# Hack to get around a cc_common.link(main_output) private API limitation.
95-
# See https://github.com/bazelbuild/bazel/pull/23838
96-
cc_common_link = use_repo_rule("//zig/private/bzlmod:cc_common_link.bzl", "cc_common_link")
97-
98-
cc_common_link(name = "build_bazel_rules_android")

e2e/workspace/.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
9.0.0-pre.20250831.1
1+
9.0.0
22
# The first line of this file is used by Bazelisk and Bazel to be sure
33
# the right version of Bazel is used to build and test this repo.
44
# This also defines which version is used on CI.

tools/BUILD.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Execute `bazel run //util:update_filegroups` to update this target.
2+
filegroup(
3+
name = "all_files",
4+
srcs = [
5+
":BUILD.bazel",
6+
"//tools/build_defs:all_files",
7+
],
8+
visibility = ["//:__pkg__"],
9+
)

tools/build_defs/BUILD.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Execute `bazel run //util:update_filegroups` to update this target.
2+
filegroup(
3+
name = "all_files",
4+
srcs = [
5+
":BUILD.bazel",
6+
"//tools/build_defs/android:all_files",
7+
],
8+
visibility = ["//tools:__pkg__"],
9+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2+
3+
bzl_library(
4+
name = "cc_common_link",
5+
srcs = ["cc_common_link.bzl"],
6+
visibility = ["//zig:__subpackages__"],
7+
deps = ["@bazel_skylib//lib:paths"],
8+
)
9+
10+
# Execute `bazel run //util:update_filegroups` to update this target.
11+
filegroup(
12+
name = "all_files",
13+
srcs = [
14+
":BUILD.bazel",
15+
":cc_common_link.bzl",
16+
],
17+
visibility = ["//tools/build_defs:__pkg__"],
18+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""A module that exposes private APIs of cc_common.link.
2+
3+
See https://github.com/bazelbuild/bazel/pull/23838#issuecomment-3756393397.
4+
"""
5+
6+
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
7+
8+
def cc_common_link(*args, **kwargs):
9+
return cc_common.link(*args, **kwargs)

zig/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ bzl_library(
6666
visibility = ["//visibility:public"],
6767
deps = [
6868
"//zig/private:platforms",
69-
"//zig/private/bzlmod:cc_common_link",
7069
"//zig/private/bzlmod:zig",
7170
"//zig/private/common:semver",
7271
"//zig/private/repo:toolchains_repo",

0 commit comments

Comments
 (0)