Files
nixpkgs/pkgs/by-name/ba/bazel_7/java_toolchain.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

31 lines
1.1 KiB
Diff

diff --git a/tools/jdk/BUILD.tools b/tools/jdk/BUILD.tools
index a8af76e90c..7f8b030f63 100644
--- a/tools/jdk/BUILD.tools
+++ b/tools/jdk/BUILD.tools
@@ -146,6 +146,25 @@ py_test(
],
)
+##### Nonprebuilt toolchains definitions for NixOS and nix build sandboxes ####
+
+load("@rules_java//toolchains:default_java_toolchain.bzl", "default_java_toolchain", "NONPREBUILT_TOOLCHAIN_CONFIGURATION")
+
+[
+ default_java_toolchain(
+ name = "nonprebuilt_toolchain_java" + str(version),
+ configuration = NONPREBUILT_TOOLCHAIN_CONFIGURATION,
+ java_runtime = "@local_jdk//:jdk",
+ source_version = str(version),
+ target_version = str(version),
+ )
+ # Ideally we would only define toolchains for the java versions that the
+ # local jdk supports. But we cannot access this information in a BUILD
+ # file, and this is a hack anyway, so just pick a large enough upper bound.
+ # At the current pace, java <= 30 should cover all realeases until 2028.
+ for version in range(8, 31)
+]
+
#### Aliases to rules_java to keep backward-compatibility (begin) ####
TARGET_NAMES = [