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.
This commit is contained in:
parent
9cbe75b269
commit
28e11a0b6b
@ -128,10 +128,10 @@ stdenv.mkDerivation rec {
|
|||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
export TMPDIR=/tmp/.bazel-$UID
|
export TMPDIR=/tmp/.bazel-$UID
|
||||||
./compile.sh
|
./compile.sh
|
||||||
./output/bazel --output_user_root=$TMPDIR/.bazel build //scripts:bash_completion \
|
scripts/generate_bash_completion.sh \
|
||||||
--spawn_strategy=standalone \
|
--bazel=./output/bazel \
|
||||||
--genrule_strategy=standalone
|
--output=output/bazel-complete.bash \
|
||||||
cp bazel-bin/scripts/bazel-complete.bash output/
|
--prepend=scripts/bazel-complete-template.bash
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Build the CPP and Java examples to verify that Bazel works.
|
# Build the CPP and Java examples to verify that Bazel works.
|
||||||
@ -149,7 +149,7 @@ stdenv.mkDerivation rec {
|
|||||||
mv output/bazel $out/bin
|
mv output/bazel $out/bin
|
||||||
wrapProgram "$out/bin/bazel" --set JAVA_HOME "${jdk}"
|
wrapProgram "$out/bin/bazel" --set JAVA_HOME "${jdk}"
|
||||||
mkdir -p $out/share/bash-completion/completions $out/share/zsh/site-functions
|
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/
|
cp scripts/zsh_completion/_bazel $out/share/zsh/site-functions/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user