bazel: shebang-test: pass bazel dir in Nix

This commit is contained in:
Andreas Herrmann 2019-08-19 14:09:59 +02:00 committed by Florian Klink
parent 7429acdea1
commit d132d47199
2 changed files with 3 additions and 2 deletions

View File

@ -208,7 +208,6 @@ stdenv.mkDerivation rec {
# about why to create a subdir for the workspace. # about why to create a subdir for the workspace.
cp -r ${workspaceDir} wd && chmod u+w wd && cd wd cp -r ${workspaceDir} wd && chmod u+w wd && cd wd
BAZEL_EXTRACTED=${be.install_dir}
${bazelScript} ${bazelScript}
touch $out touch $out
@ -224,7 +223,7 @@ stdenv.mkDerivation rec {
}; };
in { in {
shebang = callPackage ./shebang-test.nix { inherit runLocal bazelTest distDir; }; shebang = callPackage ./shebang-test.nix { inherit runLocal extracted bazelTest distDir; };
bashTools = callPackage ./bash-tools-test.nix { inherit runLocal bazelTest distDir; }; bashTools = callPackage ./bash-tools-test.nix { inherit runLocal bazelTest distDir; };
cpp = callPackage ./cpp-test.nix { inherit runLocal bazelTest bazel-examples distDir; }; cpp = callPackage ./cpp-test.nix { inherit runLocal bazelTest bazel-examples distDir; };
java = callPackage ./java-test.nix { inherit runLocal bazelTest bazel-examples distDir; }; java = callPackage ./java-test.nix { inherit runLocal bazelTest bazel-examples distDir; };

View File

@ -2,6 +2,7 @@
bazel bazel
, bazelTest , bazelTest
, distDir , distDir
, extracted
, runLocal , runLocal
, unzip , unzip
}: }:
@ -26,6 +27,7 @@ let
{ grep -Re '#!/usr/bin' $dir && FAIL=1; } || true { grep -Re '#!/usr/bin' $dir && FAIL=1; } || true
{ grep -Re '#![^[:space:]]*/bin/env python' $dir && FAIL=1; } || true { grep -Re '#![^[:space:]]*/bin/env python' $dir && FAIL=1; } || true
} }
BAZEL_EXTRACTED=${extracted bazel}/install
check_shebangs $BAZEL_EXTRACTED check_shebangs $BAZEL_EXTRACTED
while IFS= read -r -d "" zip; do while IFS= read -r -d "" zip; do
unzipped="./$zip/UNPACKED" unzipped="./$zip/UNPACKED"