Skip to content

Commit 253d11f

Browse files
meteorcloudycomius
andauthored
[8.0.0] Back-port a few commits to update MODULE.tools (#24109)
- Update rules_java to 8.2.0: 93daa7b - 78abca3 - #24094 --------- Co-authored-by: Googler <[email protected]>
1 parent 3550bbc commit 253d11f

File tree

11 files changed

+245
-1148
lines changed

11 files changed

+245
-1148
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bazel_dep(name = "zstd-jni", version = "1.5.2-3.bcr.1")
2424
bazel_dep(name = "blake3", version = "1.5.1.bcr.1")
2525
bazel_dep(name = "zlib", version = "1.3.1.bcr.3")
2626
bazel_dep(name = "rules_cc", version = "0.0.13")
27-
bazel_dep(name = "rules_java", version = "8.1.0")
27+
bazel_dep(name = "rules_java", version = "8.2.0")
2828
bazel_dep(name = "rules_graalvm", version = "0.11.1")
2929
bazel_dep(name = "rules_proto", version = "6.0.2")
3030
bazel_dep(name = "rules_jvm_external", version = "6.0")

MODULE.bazel.lock

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

src/MODULE.tools

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ 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 = "rules_java", version = "8.1.0")
40+
bazel_dep(name = "protobuf", version = "29.0-rc2")
41+
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")
4344
bazel_dep(name = "rules_shell", version = "0.2.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: 187 additions & 1133 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: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,35 @@ source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/
2929
source "$(rlocation "io_bazel/src/test/shell/integration_test_setup.sh")" \
3030
|| { echo "integration_test_setup.sh not found!" >&2; exit 1; }
3131

32+
# List of expected modules in the default lock file.
33+
# You may need to update this list if MODULE.tools changes,
34+
# but we should keep the list as small as possible because
35+
# they are tranitive dependencies for all Bazel users (although fetched lazily).
36+
expected_modules=(
37+
abseil-cpp
38+
bazel_features
39+
bazel_skylib
40+
buildozer
41+
googletest
42+
jsoncpp
43+
platforms
44+
protobuf
45+
pybind11_bazel
46+
re2
47+
rules_android
48+
rules_cc
49+
rules_fuzzing
50+
rules_java
51+
rules_jvm_external
52+
rules_kotlin
53+
rules_license
54+
rules_pkg
55+
rules_proto
56+
rules_python
57+
rules_shell
58+
zlib
59+
)
60+
3261
function test_verify_lock_file() {
3362
rm -f MODULE.bazel
3463
touch MODULE.bazel
@@ -37,6 +66,10 @@ function test_verify_lock_file() {
3766
bazel mod deps --lockfile_mode=update
3867
diff -u $(rlocation io_bazel/src/test/tools/bzlmod/MODULE.bazel.lock) MODULE.bazel.lock || fail "Default lockfile for empty workspace is no longer in sync with MODULE.tools. Please run \"bazel run //src/test/tools/bzlmod:update_default_lock_file\""
3968

69+
# Verify the list of expected modules in the lock file.
70+
grep -o '"https://bcr\.bazel\.build[^"]*source.json"' MODULE.bazel.lock | sed -E 's|.*modules/([^/]+)/.*|\1|' | sort -u > actual_modules
71+
diff -u <(printf '%s\n' "${expected_modules[@]}" | sort) actual_modules || fail "Expected modules in lockfile do not match the actual modules. Please update 'expected_modules' if necessary."
72+
4073
# Verify if python toolchain version matches Bazel's lock file to ensure it's cached in integration tests.
4174
# Check strings like `"default_version": "3.11"`` for default python version.
4275
python_version=$(grep -o '"default_version": "[0-9.]*"' MODULE.bazel.lock | grep -o '[0-9.]*')

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+
)

workspace_deps.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ WORKSPACE_REPOS = {
3131
"strip_prefix": "protobuf-27.0",
3232
},
3333
"rules_java": {
34-
"archive": "rules_java-8.0.0-rc2.tar.gz",
35-
"sha256": "7bfdbb51bb362ecdca5d989efa3c77683ce4d431e82e2d2d7aadca33a8c35ca7",
36-
"urls": ["https://github.com/bazelbuild/rules_java/releases/download/8.0.0-rc2/rules_java-8.0.0-rc2.tar.gz"],
34+
"archive": "rules_java-8.2.0.tar.gz",
35+
"sha256": "c86a51fb2baf3cfd60c4f7c158df8f7a4c2066b3908107c181f2c7e8aa413a3e",
36+
"urls": ["https://github.com/bazelbuild/rules_java/releases/download/8.2.0/rules_java-8.2.0.tar.gz"],
3737
},
3838
"bazel_skylib": {
3939
"archive": "bazel-skylib-1.6.1.tar.gz",

0 commit comments

Comments
 (0)