Skip to content

Commit cb5c268

Browse files
authored
Merge pull request #78 from lucidsoftware/upgrade-to-bazel-8
Upgrade to Bazel 8
2 parents f32b0cd + 1daeb80 commit cb5c268

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+611
-849
lines changed

.bazelrc_shared

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,63 @@
1-
common --announce_rc
2-
common --color=yes
3-
# TODO: remove this when we move to Bazel 8. This is the default in Bazel 8.
4-
common --experimental_remote_cache_eviction_retries=5
5-
6-
# TODO: enable path mapping when we move to Bazel 8. There is a bug in 7. See:
7-
# https://github.com/bazelbuild/bazel/issues/23990
8-
# In the meantime, if you need to test path mapping you should disable multiplex
9-
# workers with the following build option:
10-
#build --noworker_multiplex
11-
#common --experimental_output_paths=strip
12-
#common --modify_execution_info=CppCompile=+supports-path-mapping
13-
14-
build --experimental_strict_action_env
15-
build --javacopt="-source 21 -target 21"
1+
# Java options
162
build --java_language_version="21"
173
build --java_runtime_version="remotejdk_21"
4+
build --javacopt="-source 21 -target 21"
185
build --tool_java_language_version="21"
196
build --tool_java_runtime_version="remotejdk_21"
207

8+
# Other options
9+
build --experimental_use_hermetic_linux_sandbox
10+
build --experimental_worker_sandbox_hardening
11+
build --experimental_worker_cancellation
2112
build --strategy=worker,sandboxed,local
22-
13+
build --verbose_failures
2314
build --worker_max_instances=4
2415
build --worker_sandboxing
16+
2517
# Disable multiplex sandboxing because there is a bug that causes files which
2618
# should be in the sandbox to not be. Not sure if this is a Bazel bug or a rule
2719
# set bug. Something we need to deal with either way.
2820
# Once we enable path mapping, we should also be able to get rid of the outgoing
2921
# transition that we're currently relying on to prevent an explosion in the number
3022
# of builds.
3123
#build --experimental_worker_multiplex_sandboxing
32-
build --experimental_worker_cancellation
33-
build --verbose_failures
3424

35-
# This is disabled as it was causing some issues with some javac targets when used
36-
# with path mapping. If that is resolved, then we can turn it back on.
37-
#build --experimental_worker_sandbox_hardening
38-
build --experimental_use_hermetic_linux_sandbox
25+
# TODO: enable path mapping when we move to Bazel 8. There is a bug in 7. See:
26+
# https://github.com/bazelbuild/bazel/issues/23990
27+
# In the meantime, if you need to test path mapping you should disable multiplex
28+
# workers with the following build option:
29+
#build --noworker_multiplex
30+
#common --experimental_output_paths=strip
31+
#common --modify_execution_info=CppCompile=+supports-path-mapping
3932

40-
test --test_output=all
4133

34+
common --announce_rc
35+
common --color=yes
4236
common:rules --disk_cache=.bazel_cache
4337
common:tests --disk_cache=../.bazel_cache
4438
common:tests --@rules_scala_annex//rules/scala:scala-toolchain=test_zinc_2_13
39+
40+
# These are backwards incompatible options; we should check to see if their values have been flipped
41+
# when upgrading to new major Bazel version.
42+
common --incompatible_auto_exec_groups
43+
common --incompatible_autoload_externally=sh_binary # sh_binary is used by rules_jvm_external
44+
common --incompatible_config_setting_private_default_visibility
45+
common --incompatible_disable_native_repo_rules
46+
common --incompatible_disable_starlark_host_transitions
47+
common --incompatible_disable_target_provider_fields
48+
common --incompatible_strict_action_env
49+
50+
# Unfortunately, this can't be enabled just yet because with it enabled, we get the following error:
51+
# ERROR: Traceback (most recent call last):
52+
# File "/home/jpeterson/.cache/bazel/*/external/rules_java+/java/common/rules/java_runtime.bzl", line 197, column 48, in <toplevel>
53+
# "hermetic_static_libs": attr.label_list(
54+
# Error in label_list: Illegal argument: element in 'providers' is of unexpected type. Either all elements should be providers, or all elements should be lists of providers, but got an element of type com.google.devtools.build.lib.starlarkbuildapi.core.ContextAndFlagGuardedValue$1.
55+
#
56+
#common --incompatible_stop_exporting_language_modules
57+
58+
# This is disabled because rules_python (and possibly other rulesets we depend on) rely on
59+
# deprecated `Label` APIs:
60+
# https://github.com/bazelbuild/rules_python/blob/main/python/private/pythons_hub.bzl#L82
61+
#common --noincompatible_enable_deprecated_label_apis
62+
63+
test --test_output=all

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.4.1
1+
8.1.0

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
os: [ubuntu-24.04]
17-
bazel_version: [bazelbuild/7.4.1]
17+
bazel_version: [bazelbuild/8.1.0]
1818
steps:
1919
- uses: actions/checkout@v3
2020
- uses: bazel-contrib/[email protected]

MODULE.bazel

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
module(name = "rules_scala_annex")
22

33
bazel_dep(name = "bazel_skylib", version = "1.7.1")
4-
5-
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True)
6-
7-
bazel_dep(name = "rules_java", version = "7.12.2")
4+
bazel_dep(name = "protobuf", version = "29.3")
5+
bazel_dep(name = "rules_java", version = "8.9.0")
86
bazel_dep(name = "rules_jvm_external", version = "6.5")
97

8+
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True)
109
bazel_dep(name = "rules_pkg", version = "1.0.1", dev_dependency = True)
11-
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True)
10+
bazel_dep(name = "stardoc", version = "0.7.2", dev_dependency = True)
1211

1312
register_toolchains(
1413
"//:annex_scalafmt",
@@ -113,9 +112,8 @@ annex_proto = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
113112
annex_proto.install(
114113
name = "annex_proto",
115114
artifacts = [
116-
"com.github.os72:protoc-jar:3.11.4",
117-
"com.thesamet.scalapb:compilerplugin_2.13:0.11.17",
118-
"com.thesamet.scalapb:protoc-bridge_2.13:0.9.7",
115+
"com.thesamet.scalapb:compilerplugin_2.13:1.0.0-alpha.1",
116+
"com.thesamet.scalapb:protoc-bridge_2.13:0.9.8",
119117
],
120118
fetch_sources = True,
121119
lock_file = "//:annex_proto_install.json",
@@ -127,14 +125,14 @@ annex_proto.install(
127125
)
128126
use_repo(annex_proto, "annex_proto")
129127

130-
java_launcher_version = "7.4.1"
128+
java_launcher_version = "8.9.0"
131129

132-
java_launcher_template_sha = "ee4aa47ae5e639632c67be5cc0ccbc4e941a67a1b884a1ce0c4329357a4b62b2"
130+
java_launcher_template_sha = "289d8c13a3e2680bfbe21a2c6a57cc428ecdc6a0f2c04bda4d4dc2da40311eaa"
133131

134132
java_stub_template_url = (
135-
"raw.githubusercontent.com/bazelbuild/bazel/" +
133+
"raw.githubusercontent.com/bazelbuild/rules_java/" +
136134
java_launcher_version +
137-
"/src/main/java/com/google/devtools/build/lib/bazel/rules/java/" +
135+
"/java/bazel/rules/" +
138136
"java_stub_template.txt"
139137
)
140138

0 commit comments

Comments
 (0)