git.iko.soy/typeable/nixpkgs
on master help sign in
bazel: greatly reduce time spent substituting, be smart which files

Files inspected: 2756 -> 40 Total size of inspected files: 20M -> 1016K

commit7e3140688664fb8d83c802673c36075c1d1d8db1 authorWill Dietz <w@wdtz.org> dateFri 4 Jan 2019, 18:05 (8 years ago) parent5d4f0de
1 file changed+4−1
pkgs/development/tools/build-managers/bazel/default.nix+4−1
pkgs/development/tools/build-managers/bazel/default.nix+4−1
@@ -116,7 +116,10 @@ stdenv.mkDerivation rec {
116116 done
117117 '';
118118 genericPatches = ''
119− find src/main/java/com/google/devtools -type f -print0 | while IFS="" read -r -d "" path; do
119+ # substituteInPlace is rather slow, so prefilter the files with grep
120+ grep -rlZ /bin src/main/java/com/google/devtools | while IFS="" read -r -d "" path; do
121+ # If you add more replacements here, you must change the grep above!
122+ # Only files containing /bin are taken into account.
120123 substituteInPlace "$path" \
121124 --replace /bin/bash ${customBash}/bin/bash \
122125 --replace /usr/bin/env ${coreutils}/bin/env \