forked from mirrors/nixpkgs
bazel: greatly reduce time spent substituting, be smart which files
Files inspected: 2756 -> 40 Total size of inspected files: 20M -> 1016K
This commit is contained in:
parent
5d4f0de689
commit
7e31406886
|
@ -116,7 +116,10 @@ stdenv.mkDerivation rec {
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
genericPatches = ''
|
genericPatches = ''
|
||||||
find src/main/java/com/google/devtools -type f -print0 | while IFS="" read -r -d "" path; do
|
# substituteInPlace is rather slow, so prefilter the files with grep
|
||||||
|
grep -rlZ /bin src/main/java/com/google/devtools | while IFS="" read -r -d "" path; do
|
||||||
|
# If you add more replacements here, you must change the grep above!
|
||||||
|
# Only files containing /bin are taken into account.
|
||||||
substituteInPlace "$path" \
|
substituteInPlace "$path" \
|
||||||
--replace /bin/bash ${customBash}/bin/bash \
|
--replace /bin/bash ${customBash}/bin/bash \
|
||||||
--replace /usr/bin/env ${coreutils}/bin/env \
|
--replace /usr/bin/env ${coreutils}/bin/env \
|
||||||
|
|
Loading…
Reference in a new issue