bazel_3, bazel_4: Explicitly add a dependency on bazel-rc

This resolves an issue where the path to the bazel-rc file is sometimes
optimised so the full hash is not present, and hence not picked up by
the scan as a runtime dependency.
This commit is contained in:
Graham Bennett 2022-01-20 21:04:58 +00:00
parent 5ac7a55c73
commit eda51e3ea8
2 changed files with 8 additions and 0 deletions

View File

@ -613,6 +613,10 @@ stdenv.mkDerivation rec {
# runtime dependencies.
echo "${python27}" >> $out/nix-support/depends
echo "${python3}" >> $out/nix-support/depends
# The string literal specifying the path to the bazel-rc file is sometimes
# stored non-contiguously in the binary due to gcc optimisations, which leads
# Nix to miss the hash when scanning for dependencies
echo "${bazelRC}" >> $out/nix-support/depends
'' + lib.optionalString stdenv.isDarwin ''
echo "${cctools}" >> $out/nix-support/depends
'';

View File

@ -660,6 +660,10 @@ stdenv.mkDerivation rec {
postFixup = ''
mkdir -p $out/nix-support
echo "${defaultShellPath}" >> $out/nix-support/depends
# The string literal specifying the path to the bazel-rc file is sometimes
# stored non-contiguously in the binary due to gcc optimisations, which leads
# Nix to miss the hash when scanning for dependencies
echo "${bazelRC}" >> $out/nix-support/depends
'' + lib.optionalString stdenv.isDarwin ''
echo "${cctools}" >> $out/nix-support/depends
'';