@@ -104,8 +104,12 @@ stdenv.mkDerivation (overridable // {
104104 if [ -e $out/erts-* ]; then
105105 echo "ERTS found in $out - removing references to erlang to reduce closure size"
106106 # there is a link in $out/erts-*/bin/start always
107+ # TODO:
107108 # sometimes there are links in dependencies like bcrypt compiled binaries
108− for file in $(rg "${erlang}/lib/erlang" "$out" --text --files-with-matches); do
109+ # at the moment those are not removed since substituteInPlace will
110+ # error on binaries
111+ for file in $(rg "${erlang}/lib/erlang" "$out" --files-with-matches); do
112+ echo "removing reference to erlang in $file"
109113 substituteInPlace "$file" --replace "${erlang}/lib/erlang" "$out"
110114 done
111115 fi