From ee62812f01b7c5437047168a2d413f97b2c37057 Mon Sep 17 00:00:00 2001 From: Yves-Stan Le Cornec Date: Thu, 16 Dec 2021 09:47:16 +0100 Subject: [PATCH] bazel_4: add default tools to buildInputs (to be accessible from repository rules) Previously the customBash wrapper added the default tools to the PATH of commands from repository rules (which are run in the same environment as Bazel). --- .../tools/build-managers/bazel/bazel_4/default.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix index 9b933b6db658..17e924004f57 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix @@ -75,7 +75,7 @@ let for i in ${builtins.toString srcDeps}; do cp $i $out/$(stripHash $i); done ''; - defaultShellPath = lib.makeBinPath + defaultShellUtils = # Keep this list conservative. For more exotic tools, prefer to use # @rules_nixpkgs to pull in tools from the nix repository. Example: # @@ -120,6 +120,8 @@ let zip ]; + defaultShellPath = lib.makeBinPath defaultShellUtils; + # Java toolchain used for the build and tests javaToolchain = "@bazel_tools//tools/jdk:toolchain_${buildJdkName}"; @@ -527,10 +529,7 @@ stdenv.mkDerivation rec { in lib.optionalString stdenv.hostPlatform.isDarwin darwinPatches + genericPatches; - buildInputs = [ - buildJdk - python3 - ]; + buildInputs = [buildJdk] ++ defaultShellUtils; # when a command can’t be found in a bazel build, you might also # need to add it to `defaultShellPath`.