From 28e11a0b6ba740aedcc8be27ff8ef334d187bd37 Mon Sep 17 00:00:00 2001 From: Benjamin Staffin Date: Fri, 27 Jul 2018 14:45:43 -0400 Subject: [PATCH] bazel: fix bash completion, halve build time (#44097) This finally fixes the build to avoid having to completely rebuild bazel from source a second time just to generate the bash completion script! It also makes completion actually _work_ for bash users by correcting the name of the installed script. --- .../development/tools/build-managers/bazel/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/build-managers/bazel/default.nix b/pkgs/development/tools/build-managers/bazel/default.nix index 63b059935874..56b64cd061b5 100644 --- a/pkgs/development/tools/build-managers/bazel/default.nix +++ b/pkgs/development/tools/build-managers/bazel/default.nix @@ -128,10 +128,10 @@ stdenv.mkDerivation rec { buildPhase = '' export TMPDIR=/tmp/.bazel-$UID ./compile.sh - ./output/bazel --output_user_root=$TMPDIR/.bazel build //scripts:bash_completion \ - --spawn_strategy=standalone \ - --genrule_strategy=standalone - cp bazel-bin/scripts/bazel-complete.bash output/ + scripts/generate_bash_completion.sh \ + --bazel=./output/bazel \ + --output=output/bazel-complete.bash \ + --prepend=scripts/bazel-complete-template.bash ''; # Build the CPP and Java examples to verify that Bazel works. @@ -149,7 +149,7 @@ stdenv.mkDerivation rec { mv output/bazel $out/bin wrapProgram "$out/bin/bazel" --set JAVA_HOME "${jdk}" mkdir -p $out/share/bash-completion/completions $out/share/zsh/site-functions - mv output/bazel-complete.bash $out/share/bash-completion/completions/ + mv output/bazel-complete.bash $out/share/bash-completion/completions/bazel cp scripts/zsh_completion/_bazel $out/share/zsh/site-functions/ '';