-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Description of the feature request:
When defining a local custom java toolchain with local_java_runtime
, it is useful to be able to set constraints, using the target_compatible_with
and exec_compatible_with
arguments to native.toolchain
. It would be useful to be able to provide those arguments directly to the local_java_runtime
function, and have them be passed on to the invocation of native.toolchain
.
What underlying problem are you trying to solve with this feature?
In [rules_nixpkgs](https://github.com/tweag/rules_nixpkgs], we define a custom java toolchain, using a JDK from nixpkgs. We want to be able to set constraints on the toolchain, such as confirming that nix
is available on the $PATH. We currently are using modified versions of local_java_repository.bzl
and default_java_toolchain.bzl
to add these arguments (and invoking them here), but it seems like it would be simple to expose those arguments directly in the Bazel codebase with out
Which operating system are you running Bazel on?
NixOS
What is the output of bazel info release
?
release 6.0.0-pre.20220720.3- (@Non-Git)
If bazel info release
returns development version
or (@non-git)
, tell us how you built Bazel.
Nix (from nixpkgs)
What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD
?
git@github.com:tshaynik/bazel.git
10d352bfed38ba066fbe87449f9d8d7686e139ff
09d958c3c86486e88ec9242ceb2ca08c277ff025
Have you found anything relevant by searching the web?
No.
Any other information, logs, or outputs that you want to share?
No response