@@ -122,7 +122,7 @@ stdenv.mkDerivation rec {
122122
123123 # bazel wants to extract itself into $install_dir/install every time it runs,
124124 # so let’s do that only once.
125− extracted =
125+ extracted = bazelPkg:
126126 let install_dir =
127127 # `install_base` field printed by `bazel info`, minus the hash.
128128 # yes, this path is kinda magic. Sorry.
@@ -130,7 +130,7 @@ stdenv.mkDerivation rec {
130130 in runLocal "bazel-extracted-homedir" { passthru.install_dir = install_dir; } ''
131131 export HOME=$(mktemp -d)
132132 touch WORKSPACE # yeah, everything sucks
133− install_base="$(${bazel}/bin/bazel info | grep install_base)"
133+ install_base="$(${bazelPkg}/bin/bazel info | grep install_base)"
134134 # assert it’s actually below install_dir
135135 [[ "$install_base" =~ ${install_dir} ]] \
136136 || (echo "oh no! $install_base but we are \
@@ -138,21 +138,23 @@ stdenv.mkDerivation rec {
138138 cp -R ${install_dir} $out
139139 '';
140140
141− bazelTest = { name, bazelScript, workspaceDir }:
142− runLocal name {} (
141+ bazelTest = { name, bazelScript, workspaceDir, bazelPkg }:
142+ let
143+ be = extracted bazelPkg;
144+ in runLocal name {} (
143145 # skip extraction caching on Darwin, because nobody knows how Darwin works
144146 (lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
145147 # set up home with pre-unpacked bazel
146148 export HOME=$(mktemp -d)
147− mkdir -p ${extracted.install_dir}
148− cp -R ${extracted}/install ${extracted.install_dir}
149+ mkdir -p ${be.install_dir}
150+ cp -R ${be}/install ${be.install_dir}
149151
150152 # https://stackoverflow.com/questions/47775668/bazel-how-to-skip-corrupt-installation-on-centos6
151153 # Bazel checks whether the mtime of the install dir files
152154 # is >9 years in the future, otherwise it extracts itself again.
153155 # see PosixFileMTime::IsUntampered in src/main/cpp/util
154156 # What the hell bazel.
155− ${lr}/bin/lr -0 -U ${extracted.install_dir} | ${xe}/bin/xe -N0 -0 touch --date="9 years 6 months" {}
157+ ${lr}/bin/lr -0 -U ${be.install_dir} | ${xe}/bin/xe -N0 -0 touch --date="9 years 6 months" {}
156158 '')
157159 +
158160 ''
@@ -165,9 +167,13 @@ stdenv.mkDerivation rec {
165167 touch $out
166168 '');
167169
170+ bazelWithNixHacks = bazel.override { enableNixHacks = true; };
168171 in {
169− pythonBinPath = callPackage ./python-bin-path-test.nix{ inherit runLocal bazelTest; };
170− bashTools = callPackage ./bash-tools-test.nix { inherit runLocal bazelTest; };
172+ pythonBinPathWithoutNixHacks = callPackage ./python-bin-path-test.nix{ inherit runLocal bazelTest; };
173+ bashToolsWithoutNixHacks = callPackage ./bash-tools-test.nix { inherit runLocal bazelTest; };
174+
175+ pythonBinPathWithNixHacks = callPackage ./python-bin-path-test.nix{ inherit runLocal bazelTest; bazel = bazelWithNixHacks; };
176+ bashToolsWithNixHacks = callPackage ./bash-tools-test.nix { inherit runLocal bazelTest; bazel = bazelWithNixHacks; };
171177 };
172178
173179 name = "bazel-${version}";