···54 # Always assume all markers valid (this is needed because we remove markers; they are non-deterministic).
55 # Also, don't clean up environment variables (so that NIX_ environment variables are passed to compilers).
56, enableNixHacks ? false
57-}:
5859let
60 version = "7.0.0-pre.20230917.3";
···136 # on aarch64 Darwin, `uname -m` returns "arm64"
137 arch = with stdenv.hostPlatform; if isDarwin && isAarch64 then "arm64" else parsed.cpu.name;
13800000139 bazelRC = writeTextFile {
140 name = "bazel-rc";
141 text = ''
142 startup --server_javabase=${buildJdk}
143144- build --extra_toolchains=@local_jdk//:all
00145 build --tool_java_runtime_version=local_jdk
146 build --java_runtime_version=local_jdk
147- build --repo_env=JAVA_HOME=${buildJdk}${if isDarwin then "/zulu-11.jdk/Contents/Home" else "/lib/openjdk"}
148149 # load default location for the system wide configuration
150 try-import /etc/bazel.bazelrc
151 '';
152 };
153154- bazelNixFlagsScript = writeScript "bazel-nix-flags" ''
155- cat << EOF
156- common --announce_rc
157- build --toolchain_resolution_debug=".*"
158- build --local_ram_resources=HOST_RAM*.5
159- build --local_cpu_resources=HOST_CPUS*.75
160- build --copt=$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ / --copt=/g')
161- build --host_copt=$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ / --host_copt=/g')
162- build --linkopt=$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ / --linkopt=/g')
163- build --host_linkopt=$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ / --host_linkopt=/g')
164- build --linkopt=-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ / --linkopt=-Wl,/g')
165- build --host_linkopt=-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ / --host_linkopt=-Wl,/g')
166- build --extra_toolchains=@bazel_tools//tools/jdk:nonprebuilt_toolchain_definition
167- build --verbose_failures
168- build --curses=no
169- build --features=-layering_check
170- build --experimental_strict_java_deps=off
171- build --strict_proto_deps=off
172- build --extra_toolchains=@bazel_tools//tools/jdk:nonprebuilt_toolchain_java11_definition
173- build --extra_toolchains=@local_jdk//:all
174- build --tool_java_runtime_version=local_jdk_11
175- build --java_runtime_version=local_jdk_11
176- build --repo_env=JAVA_HOME=${buildJdk}${if isDarwin then "/zulu-11.jdk/Contents/Home" else "/lib/openjdk"}
177- EOF
178- '';
179in
180stdenv.mkDerivation rec {
181 pname = "bazel";
182- inherit version;
0183184- meta = with lib; {
185- homepage = "https://github.com/bazelbuild/bazel/";
186- description = "Build tool that builds code quickly and reliably";
187- sourceProvenance = with sourceTypes; [
188- fromSource
189- binaryBytecode # source bundles dependencies as jars
190- ];
191- license = licenses.asl20;
192- maintainers = lib.teams.bazel.members;
193- inherit platforms;
194- };
195-196- inherit src;
197- inherit sourceRoot;
198 patches = [
199 # TODO: Make GSON work,
200 # In particular, our bazel build cannot emit MODULE.bazel.lock
201 # it only produces an empty json object `{ }`.
202 ./serialize_nulls.patch
203000000000000000000000000000000000000204 # Bazel integrates with apple IOKit to inhibit and track system sleep.
205 # Inside the darwin sandbox, these API calls are blocked, and bazel
206 # crashes. It seems possible to allow these APIs inside the sandbox, but it
···239 # This patch removes using the -fobjc-arc compiler option and makes the code
240 # compile without automatic reference counting. Caveat: this leaks memory, but
241 # we accept this fact because xcode_locator is only a short-lived process used during the build.
242- (substituteAll {
243- src = ./no-arc.patch;
244- multiBinPatch = if stdenv.hostPlatform.system == "aarch64-darwin" then "arm64" else "x86_64";
245- })
246247 # --experimental_strict_action_env (which may one day become the default
248 # see bazelbuild/bazel#2574) hardcodes the default
···269 ]
270 # See enableNixHacks argument above.
271 ++ lib.optional enableNixHacks ./nix-hacks.patch;
272-273-274- # Bazel starts a local server and needs to bind a local address.
275- __darwinAllowLocalNetworking = true;
276277 postPatch =
278 let
279 darwinPatches = ''
0280 bazelLinkFlags () {
281 eval set -- "$NIX_LDFLAGS"
282 local flag
···284 printf ' -Wl,%s' "$flag"
285 done
286 }
287-288- # Disable Bazel's Xcode toolchain detection which would configure compilers
289- # and linkers from Xcode instead of from PATH
290- export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
291292 # Explicitly configure gcov since we don't have it on Darwin, so autodetection fails
293 export GCOV=${coreutils}/bin/false
···300 # https://github.com/NixOS/nixpkgs/pull/41589
301 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${lib.getDev libcxx}/include/c++/v1"
3020000303 # don't use system installed Xcode to run clang, use Nix clang instead
304 sed -i -E \
305 -e "s;/usr/bin/xcrun (--sdk macosx )?clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \
···307 scripts/bootstrap/compile.sh \
308 tools/osx/BUILD
309310- substituteInPlace scripts/bootstrap/compile.sh --replace ' -mmacosx-version-min=10.9' ""
311-312 # nixpkgs's libSystem cannot use pthread headers directly, must import GCD headers instead
313 sed -i -e "/#include <pthread\/spawn.h>/i #include <dispatch/dispatch.h>" src/main/cpp/blaze_util_darwin.cc
314···316 # invocations of gcc to clang, but vanilla clang doesn't
317 sed -i -e 's;_find_generic(repository_ctx, "gcc", "CC", overriden_tools);_find_generic(repository_ctx, "clang", "CC", overriden_tools);g' tools/cpp/unix_cc_configure.bzl
3180000000000319 sed -i -e 's;"/usr/bin/libtool";_find_generic(repository_ctx, "libtool", "LIBTOOL", overriden_tools);g' tools/cpp/unix_cc_configure.bzl
320 wrappers=( tools/cpp/osx_cc_wrapper.sh.tpl )
321 for wrapper in "''${wrappers[@]}"; do
322- sed -i -e "s,/usr/bin/gcc,${stdenv.cc}/bin/clang,g" $wrapper
323- sed -i -e "s,/usr/bin/install_name_tool,${cctools}/bin/install_name_tool,g" $wrapper
324- sed -i -e "s,/usr/bin/xcrun install_name_tool,${cctools}/bin/install_name_tool,g" $wrapper
325 done
326 '';
3270328 genericPatches = ''
329- function sedVerbose() {
330- local path=$1; shift;
331- sed -i".bak-nix" "$path" "$@"
332- diff -U0 "$path.bak-nix" "$path" | sed "s/^/ /" || true
333- rm -f "$path.bak-nix"
334- }
335-336 # unzip builtins_bzl.zip so the contents get patched
337 builtins_bzl=src/main/java/com/google/devtools/build/lib/bazel/rules/builtins_bzl
338 unzip ''${builtins_bzl}.zip -d ''${builtins_bzl}_zip >/dev/null
···348 grep -rlZ /bin/ \
349 src/main/java/com/google/devtools \
350 src/main/starlark/builtins_bzl/common/python \
351- tools/python \
352- tools/cpp \
353- tools/build_rules \
354- tools/osx/BUILD \
355 | while IFS="" read -r -d "" path; do
356 # If you add more replacements here, you must change the grep above!
357 # Only files containing /bin are taken into account.
···377 # Passing EXTRA_BAZEL_ARGS is tricky due to quoting.
378379 sedVerbose compile.sh \
380- -e "/bazel_build /a\ --copt=\"$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --copt=\"/g')\" \\\\" \
381- -e "/bazel_build /a\ --host_copt=\"$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --host_copt=\"/g')\" \\\\" \
382- -e "/bazel_build /a\ --linkopt=\"$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --linkopt=\"/g')\" \\\\" \
383- -e "/bazel_build /a\ --host_linkopt=\"$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --host_linkopt=\"/g')\" \\\\" \
384- -e "/bazel_build /a\ --linkopt=\"-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --linkopt=\"-Wl,/g')\" \\\\" \
385- -e "/bazel_build /a\ --host_linkopt=\"-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --host_linkopt=\"-Wl,/g')\" \\\\" \
386 -e "/bazel_build /a\ --verbose_failures \\\\" \
387 -e "/bazel_build /a\ --curses=no \\\\" \
388 -e "/bazel_build /a\ --features=-layering_check \\\\" \
389 -e "/bazel_build /a\ --experimental_strict_java_deps=off \\\\" \
390 -e "/bazel_build /a\ --strict_proto_deps=off \\\\" \
00000391 -e "/bazel_build /a\ --tool_java_runtime_version=local_jdk \\\\" \
392 -e "/bazel_build /a\ --java_runtime_version=local_jdk \\\\" \
393- -e "/bazel_build /a\ --repo_env=JAVA_HOME=${buildJdk}/${if isDarwin then "/zulu-11.jdk/Contents/Home" else "/lib/openjdk"} \\\\" \
394- -e "/bazel_build /a\ --extra_toolchains=@local_jdk//:all \\\\" \
395- -e "/bazel_build /a\ --toolchain_resolution_debug=@bazel_tools//tools/jdk:runtime_toolchain_type \\\\" \
396- -e "/bazel_build /a\ --sandbox_debug --verbose_failures \\\\" \
00397398 # Also build parser_deploy.jar with bootstrap bazel
399 # TODO: Turn into a proper patch
···401 -e 's!bazel_build !bazel_build src/tools/execlog:parser_deploy.jar !' \
402 -e 's!clear_log!cp $(get_bazel_bin_path)/src/tools/execlog/parser_deploy.jar output\nclear_log!'
403404-405- # This is necessary to avoid:
406- # "error: no visible @interface for 'NSDictionary' declares the selector
407- # 'initWithContentsOfURL:error:'"
408- # This can be removed when the apple_sdk is upgraded beyond 10.13+
409- sedVerbose tools/osx/xcode_locator.m \
410- -e '/initWithContentsOfURL:versionPlistUrl/ {
411- N
412- s/error:nil\];/\];/
413- }'
414-415 # append the PATH with defaultShellPath in tools/bash/runfiles/runfiles.bash
416 echo "PATH=\$PATH:${defaultShellPath}" >> runfiles.bash.tmp
417 cat tools/bash/runfiles/runfiles.bash >> runfiles.bash.tmp
···427 patchShebangs . >/dev/null
428 '';
429 in
430- lib.optionalString isDarwin darwinPatches + genericPatches;
000000000000000000000000431432 buildInputs = [ buildJdk ] ++ defaultShellUtils;
433···444 ] ++ lib.optionals (stdenv.isDarwin) [
445 cctools
446 libcxx
0447 CoreFoundation
448 CoreServices
449- Foundation
450 ];
451452 # Bazel makes extensive use of symlinks in the WORKSPACE.
···54 # Always assume all markers valid (this is needed because we remove markers; they are non-deterministic).
55 # Also, don't clean up environment variables (so that NIX_ environment variables are passed to compilers).
56, enableNixHacks ? false
57+}@args:
5859let
60 version = "7.0.0-pre.20230917.3";
···136 # on aarch64 Darwin, `uname -m` returns "arm64"
137 arch = with stdenv.hostPlatform; if isDarwin && isAarch64 then "arm64" else parsed.cpu.name;
138139+ #build --extra_toolchains=@local_jdk//:all
140+ #build --tool_java_runtime_version=local_jdk
141+ #build --java_runtime_version=local_jdk
142+ #build --repo_env=JAVA_HOME=${buildJdk}${if isDarwin then "/zulu-11.jdk/Contents/Home" else "/lib/openjdk"}
143+144 bazelRC = writeTextFile {
145 name = "bazel-rc";
146 text = ''
147 startup --server_javabase=${buildJdk}
148149+ # Register nix-specific nonprebuilt java toolchains
150+ build --extra_toolchains=@bazel_tools//tools/jdk:all
151+ # and set bazel to use them by default
152 build --tool_java_runtime_version=local_jdk
153 build --java_runtime_version=local_jdk
0154155 # load default location for the system wide configuration
156 try-import /etc/bazel.bazelrc
157 '';
158 };
1590000000000000000000000000160in
161stdenv.mkDerivation rec {
162 pname = "bazel";
163+ inherit version src;
164+ inherit sourceRoot;
16500000000000000166 patches = [
167 # TODO: Make GSON work,
168 # In particular, our bazel build cannot emit MODULE.bazel.lock
169 # it only produces an empty json object `{ }`.
170 ./serialize_nulls.patch
171172+ # --extra_toolchains defined later should come before the ones defined earlier.
173+ # As-is, this patch also inverts the order of extra_toolchains lists, but it's just a hack
174+ ./extra_toolchains_precedence.patch
175+176+ #./toolchain_better_debug.patch
177+ ./toolchain_group_debug.patch
178+179+ # Remote java toolchains do not work on NixOS because they download binaries,
180+ # so we need to use the @local_jdk//:jdk
181+ # It could in theory be done by registering @local_jdk//:all toolchains,
182+ # but these java toolchains still bundle binaries for ijar and stuff. So we
183+ # need a nonprebult java toolchain (where ijar and stuff is built from
184+ # sources).
185+ # There is no such java toolchain, so we introduce one here.
186+ # By providing no version information, the toolchain will set itself to the
187+ # version of $JAVA_HOME/bin/java, just like the local_jdk does.
188+ # To ensure this toolchain gets used, we can set
189+ # --{,tool_}java_runtime_version=local_jdk and rely on the fact no java
190+ # toolchain registered by default uses the local_jdk, making the selection
191+ # unambiguous.
192+ # This toolchain has the advantage that it can use any ambiant java jdk,
193+ # not only a given, fixed version. It allows bazel to work correctly in any
194+ # environment where JAVA_HOME is set to the right java version, like inside
195+ # nix derivations.
196+ # However, this patch breaks bazel hermeticity, by picking the ambiant java
197+ # version instead of the more hermetic remote_jdk prebuilt binaries that
198+ # rules_java provide by default. It also requires the user to have a
199+ # JAVA_HOME set to the exact version required by the project.
200+ # With more code, we could define java toolchains for all the java versions
201+ # supported by the jdk as in rules_java's
202+ # toolchains/local_java_repository.bzl, but this is not implemented here.
203+ # To recover vanilla behavior, non NixOS users can set
204+ # --{,tool_}java_runtime_version=remote_jdk, effectively reverting the
205+ # effect of this patch and the fake system bazelrc.
206+ ./java_toolchain.patch
207+208 # Bazel integrates with apple IOKit to inhibit and track system sleep.
209 # Inside the darwin sandbox, these API calls are blocked, and bazel
210 # crashes. It seems possible to allow these APIs inside the sandbox, but it
···243 # This patch removes using the -fobjc-arc compiler option and makes the code
244 # compile without automatic reference counting. Caveat: this leaks memory, but
245 # we accept this fact because xcode_locator is only a short-lived process used during the build.
246+ ./no-arc.patch
000247248 # --experimental_strict_action_env (which may one day become the default
249 # see bazelbuild/bazel#2574) hardcodes the default
···270 ]
271 # See enableNixHacks argument above.
272 ++ lib.optional enableNixHacks ./nix-hacks.patch;
0000273274 postPatch =
275 let
276 darwinPatches = ''
277+278 bazelLinkFlags () {
279 eval set -- "$NIX_LDFLAGS"
280 local flag
···282 printf ' -Wl,%s' "$flag"
283 done
284 }
0000285286 # Explicitly configure gcov since we don't have it on Darwin, so autodetection fails
287 export GCOV=${coreutils}/bin/false
···294 # https://github.com/NixOS/nixpkgs/pull/41589
295 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${lib.getDev libcxx}/include/c++/v1"
296297+ # This variable is used by bazel to propagate env vars for homebrew,
298+ # which is exactly what we need too.
299+ export HOMEBREW_RUBY_PATH="foo"
300+301 # don't use system installed Xcode to run clang, use Nix clang instead
302 sed -i -E \
303 -e "s;/usr/bin/xcrun (--sdk macosx )?clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \
···305 scripts/bootstrap/compile.sh \
306 tools/osx/BUILD
30700308 # nixpkgs's libSystem cannot use pthread headers directly, must import GCD headers instead
309 sed -i -e "/#include <pthread\/spawn.h>/i #include <dispatch/dispatch.h>" src/main/cpp/blaze_util_darwin.cc
310···312 # invocations of gcc to clang, but vanilla clang doesn't
313 sed -i -e 's;_find_generic(repository_ctx, "gcc", "CC", overriden_tools);_find_generic(repository_ctx, "clang", "CC", overriden_tools);g' tools/cpp/unix_cc_configure.bzl
314315+ # This is necessary to avoid:
316+ # "error: no visible @interface for 'NSDictionary' declares the selector
317+ # 'initWithContentsOfURL:error:'"
318+ # This can be removed when the apple_sdk is upgraded beyond 10.13+
319+ sedVerbose tools/osx/xcode_locator.m \
320+ -e '/initWithContentsOfURL:versionPlistUrl/ {
321+ N
322+ s/error:nil\];/\];/
323+ }'
324+325 sed -i -e 's;"/usr/bin/libtool";_find_generic(repository_ctx, "libtool", "LIBTOOL", overriden_tools);g' tools/cpp/unix_cc_configure.bzl
326 wrappers=( tools/cpp/osx_cc_wrapper.sh.tpl )
327 for wrapper in "''${wrappers[@]}"; do
328+ sedVerbose $wrapper \
329+ -e "s,/usr/bin/xcrun install_name_tool,${cctools}/bin/install_name_tool,g"
0330 done
331 '';
332333+ # -e "s,%{cc},${stdenv.cc}/bin/clang,g" \
334 genericPatches = ''
0000000335 # unzip builtins_bzl.zip so the contents get patched
336 builtins_bzl=src/main/java/com/google/devtools/build/lib/bazel/rules/builtins_bzl
337 unzip ''${builtins_bzl}.zip -d ''${builtins_bzl}_zip >/dev/null
···347 grep -rlZ /bin/ \
348 src/main/java/com/google/devtools \
349 src/main/starlark/builtins_bzl/common/python \
350+ tools \
000351 | while IFS="" read -r -d "" path; do
352 # If you add more replacements here, you must change the grep above!
353 # Only files containing /bin are taken into account.
···373 # Passing EXTRA_BAZEL_ARGS is tricky due to quoting.
374375 sedVerbose compile.sh \
000000376 -e "/bazel_build /a\ --verbose_failures \\\\" \
377 -e "/bazel_build /a\ --curses=no \\\\" \
378 -e "/bazel_build /a\ --features=-layering_check \\\\" \
379 -e "/bazel_build /a\ --experimental_strict_java_deps=off \\\\" \
380 -e "/bazel_build /a\ --strict_proto_deps=off \\\\" \
381+ -e "/bazel_build /a\ --action_env=NIX_CFLAGS_COMPILE=\"$NIX_CFLAGS_COMPILE\" \\\\" \
382+ -e "/bazel_build /a\ --action_env=NIX_LDFLAGS=\"$NIX_LDFLAGS\" \\\\" \
383+ -e "/bazel_build /a\ --host_action_env=NIX_CFLAGS_COMPILE=\"$NIX_CFLAGS_COMPILE\" \\\\" \
384+ -e "/bazel_build /a\ --host_action_env=NIX_LDFLAGS=\"$NIX_LDFLAGS\" \\\\" \
385+ -e "/bazel_build /a\ --toolchain_resolution_debug='@bazel_tools//tools/jdk:(runtime_)?toolchain_type' \\\\" \
386 -e "/bazel_build /a\ --tool_java_runtime_version=local_jdk \\\\" \
387 -e "/bazel_build /a\ --java_runtime_version=local_jdk \\\\" \
388+ -e "/bazel_build /a\ --extra_toolchains=@bazel_tools//tools/jdk:all \\\\" \
389+ -e "/bazel_build /a\ --distdir=${distDir} \\\\" \
390+391+ #-e "/bazel_build /a\ --action_env=NIX_BINTOOLS=\"$NIX_BINTOOLS\" \\\\" \
392+ #-e "/bazel_build /a\ --action_env=NIX_CC=\"$NIX_CC\" \\\\" \
393+ #-e "/bazel_build /a\ --action_env=nativeBuildInputs=\"$nativeBuildInputs\" \\\\" \
394395 # Also build parser_deploy.jar with bootstrap bazel
396 # TODO: Turn into a proper patch
···398 -e 's!bazel_build !bazel_build src/tools/execlog:parser_deploy.jar !' \
399 -e 's!clear_log!cp $(get_bazel_bin_path)/src/tools/execlog/parser_deploy.jar output\nclear_log!'
40000000000000401 # append the PATH with defaultShellPath in tools/bash/runfiles/runfiles.bash
402 echo "PATH=\$PATH:${defaultShellPath}" >> runfiles.bash.tmp
403 cat tools/bash/runfiles/runfiles.bash >> runfiles.bash.tmp
···413 patchShebangs . >/dev/null
414 '';
415 in
416+ ''
417+ function sedVerbose() {
418+ local path=$1; shift;
419+ sed -i".bak-nix" "$path" "$@"
420+ diff -U0 "$path.bak-nix" "$path" | sed "s/^/ /" || true
421+ rm -f "$path.bak-nix"
422+ }
423+ ''
424+ + lib.optionalString stdenv.hostPlatform.isDarwin darwinPatches
425+ + genericPatches;
426+427+ meta = with lib; {
428+ homepage = "https://github.com/bazelbuild/bazel/";
429+ description = "Build tool that builds code quickly and reliably";
430+ sourceProvenance = with sourceTypes; [
431+ fromSource
432+ binaryBytecode # source bundles dependencies as jars
433+ ];
434+ license = licenses.asl20;
435+ maintainers = lib.teams.bazel.members;
436+ inherit platforms;
437+ };
438+439+ # Bazel starts a local server and needs to bind a local address.
440+ __darwinAllowLocalNetworking = true;
441442 buildInputs = [ buildJdk ] ++ defaultShellUtils;
443···454 ] ++ lib.optionals (stdenv.isDarwin) [
455 cctools
456 libcxx
457+ Foundation
458 CoreFoundation
459 CoreServices
0460 ];
461462 # Bazel makes extensive use of symlinks in the WORKSPACE.
···1diff --git a/tools/jdk/BUILD.tools b/tools/jdk/BUILD.tools
2+index a8af76e90c..7f8b030f63 100644
3--- a/tools/jdk/BUILD.tools
4+++ b/tools/jdk/BUILD.tools
5+@@ -146,6 +146,25 @@ py_test(
6 ],
7 )
89++##### Nonprebuilt toolchains definitions for NixOS and nix build sandboxes ####
10++
11+load("@rules_java//toolchains:default_java_toolchain.bzl", "default_java_toolchain", "NONPREBUILT_TOOLCHAIN_CONFIGURATION")
12+
13++[
14++ default_java_toolchain(
15++ name = "nonprebuilt_toolchain_java" + str(version),
16++ configuration = NONPREBUILT_TOOLCHAIN_CONFIGURATION,
17++ java_runtime = "@local_jdk//:jdk",
18++ source_version = str(version),
19++ target_version = str(version),
20++ )
21++ # Ideally we would only define toolchains for the java versions that the
22++ # local jdk supports. But we cannot access this information in a BUILD
23++ # file, and this is a hack anyway, so just pick a large enough upper bound.
24++ # At the current pace, java <= 30 should cover all realeases until 2028.
25++ for version in range(8, 31)
26++]
27+
28 #### Aliases to rules_java to keep backward-compatibility (begin) ####
29