forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to Bazel 5 (digital-asset#12935)
* Switch to Bazel 5 changelog_begin changelog_end * . * . changelog_begin changelog_end
- Loading branch information
1 parent
3d54d14
commit 4c0118d
Showing
14 changed files
with
126 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
diff --git a/nixpkgs/nixpkgs.bzl b/nixpkgs/nixpkgs.bzl | ||
index 061170e..10dcac6 100644 | ||
--- a/nixpkgs/nixpkgs.bzl | ||
+++ b/nixpkgs/nixpkgs.bzl | ||
@@ -925,6 +925,40 @@ pkgs.runCommand "bazel-nixpkgs-java-runtime" | ||
'' | ||
""" | ||
|
||
+def _nixpkgs_java_toolchain_impl(repository_ctx): | ||
+ cpu = get_cpu_value(repository_ctx) | ||
+ exec_constraints, target_constraints = ensure_constraints(repository_ctx) | ||
+ | ||
+ repository_ctx.file( | ||
+ "BUILD.bazel", | ||
+ executable = False, | ||
+ content = """\ | ||
+package(default_visibility = ["//visibility:public"]) | ||
+ | ||
+toolchain( | ||
+ name = "java-toolchain-{cpu}", | ||
+ toolchain = "@{runtime}//:runtime", | ||
+ toolchain_type = "@bazel_tools//tools/jdk:runtime_toolchain_type", | ||
+ exec_compatible_with = {exec_constraints}, | ||
+ target_compatible_with = {target_constraints}, | ||
+) | ||
+""".format( | ||
+ runtime = repository_ctx.attr.runtime, | ||
+ cpu = cpu, | ||
+ exec_constraints = exec_constraints, | ||
+ target_constraints = target_constraints, | ||
+ ), | ||
+ ) | ||
+ | ||
+_nixpkgs_java_toolchain = repository_rule( | ||
+ _nixpkgs_java_toolchain_impl, | ||
+ attrs = { | ||
+ "runtime": attr.string(), | ||
+ "exec_constraints": attr.string_list(), | ||
+ "target_constraints": attr.string_list(), | ||
+ }, | ||
+) | ||
+ | ||
def nixpkgs_java_configure( | ||
name = "nixpkgs_java_runtime", | ||
attribute_path = None, | ||
@@ -1014,6 +1048,11 @@ def nixpkgs_java_configure( | ||
fail_not_supported = fail_not_supported, | ||
quiet = quiet, | ||
) | ||
+ _nixpkgs_java_toolchain( | ||
+ name = "{}_toolchain".format(name), | ||
+ runtime = name, | ||
+ ) | ||
+ native.register_toolchains("@{}_toolchain//:all".format(name)) | ||
|
||
def _nixpkgs_python_toolchain_impl(repository_ctx): | ||
exec_constraints, target_constraints = ensure_constraints(repository_ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.