Skip to content

Commit 295215a

Browse files
committed
Make bazel_tools work again
This PR address two problems: - Partially rolledback bazelbuild@ef1a21f to restore android tools extension to avoid breaking older rules_jvm_external and rules_kotlin versions: bazel-contrib/rules_jvm_external#1270 - Add protobuf in MODULE.tools to ensure a Bazel 8 compatible version gets selected. (related bazelbuild#23908) Closes bazelbuild#24094. PiperOrigin-RevId: 690625240 Change-Id: I47e9ab7cab9bbfd09e455fb72d3d99d3e73f1f90
1 parent b55240e commit 295215a

File tree

8 files changed

+212
-981
lines changed

8 files changed

+212
-981
lines changed

src/MODULE.tools

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use_repo(buildozer_binary, "buildozer_binary")
3737

3838
# Dependencies used to auto-load removed symbols and rules from Bazel (due to Starlarkification)
3939
# See also: --incompatible_autoload_externally, AutoloadSymbols
40+
bazel_dep(name = "protobuf", version = "29.0-rc2")
4041
bazel_dep(name = "rules_java", version = "8.2.0")
4142
bazel_dep(name = "rules_cc", version = "0.0.13")
4243
bazel_dep(name = "rules_python", version = "0.36.0")

src/test/shell/integration/discard_graph_edges_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,13 @@ function test_packages_cleared() {
274274
# is still low (external packages don't contribute there). We can lower this
275275
# number again once we remove WORKSPACE logic and move repo rules to not use
276276
# Package anymore.
277-
[[ "$package_count" -le 53 ]] \
277+
[[ "$package_count" -le 56 ]] \
278278
|| fail "package count $package_count too high"
279279
globs_count="$(extract_histogram_count "$histo_file" "GlobsValue$")"
280280
[[ "$globs_count" -le 1 ]] \
281281
|| fail "globs count $globs_count too high"
282282
module_count="$(extract_histogram_count "$histo_file" 'eval.Module$')"
283-
[[ "$module_count" -le 270 ]] \
283+
[[ "$module_count" -le 295 ]] \
284284
|| fail "Module count $module_count too high"
285285
ct_count="$(extract_histogram_count "$histo_file" \
286286
'RuleConfiguredTarget$')"

src/test/shell/testenv.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,6 @@ function add_rules_license() {
592592

593593
function add_protobuf() {
594594
add_bazel_dep "protobuf" "$1"
595-
cat >> "$1" <<EOF
596-
single_version_override(
597-
module_name = "protobuf",
598-
version = "29.0-rc2",
599-
)
600-
EOF
601595
}
602596

603597
function add_rules_testing() {

src/test/tools/bzlmod/MODULE.bazel.lock

Lines changed: 189 additions & 972 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/tools/bzlmod/verify_default_lock_file.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,19 @@ expected_modules=(
4242
jsoncpp
4343
platforms
4444
protobuf
45+
pybind11_bazel
46+
re2
47+
rules_android
4548
rules_cc
49+
rules_fuzzing
4650
rules_java
4751
rules_jvm_external
52+
rules_kotlin
4853
rules_license
4954
rules_pkg
5055
rules_proto
5156
rules_python
5257
rules_shell
53-
stardoc
5458
zlib
5559
)
5660

tools/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ filegroup(
4646
exclude = ["fastutil.proguard"],
4747
) + [
4848
"//tools/allowlists:srcs",
49+
"//tools/android:embedded_tools",
4950
"//tools/bash:embedded_tools",
5051
"//tools/build_defs:embedded_tools",
5152
"//tools/build_rules:embedded_tools_srcs",
@@ -76,6 +77,7 @@ filegroup(
7677
name = "bzl_srcs",
7778
srcs = [
7879
"//tools:build_defs.bzl",
80+
"//tools/android:bzl_srcs",
7981
"//tools/build_defs:bzl_srcs",
8082
"//tools/build_rules:bzl_srcs",
8183
"//tools/cpp:bzl_srcs",

tools/android/BUILD

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ filegroup(
4141
],
4242
)
4343

44+
filegroup(
45+
name = "embedded_tools",
46+
srcs = [
47+
"BUILD.tools",
48+
"android_extensions.bzl",
49+
],
50+
)
51+
4452
platform(
4553
name = "arm64-v8a",
4654
constraint_values = [

tools/android/BUILD.tools

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
filegroup(
2+
name = "bzl_srcs",
3+
srcs = glob(["*.bzl"]),
4+
visibility = ["//tools:__pkg__"],
5+
)

0 commit comments

Comments
 (0)