diff options
author | happysalada <raphael@megzari.com> | 2021-06-06 19:58:21 +0900 |
---|---|---|
committer | Raphael Megzari <raphael@megzari.com> | 2021-06-07 10:03:48 +0900 |
commit | 5e9f18c572fa24750a278b80f6ad9ad101f48069 (patch) | |
tree | 68db6935ad3741d5ba1bcdcb3e750345cea03344 /pkgs/development/beam-modules/mix-release.nix | |
parent | 2a87cb7a8b4436bcd85fe0fe9532664386879a67 (diff) |
mix-release: remove erlang ref in resulting derivation
Diffstat (limited to 'pkgs/development/beam-modules/mix-release.nix')
-rw-r--r-- | pkgs/development/beam-modules/mix-release.nix | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgs/development/beam-modules/mix-release.nix b/pkgs/development/beam-modules/mix-release.nix index 91ebacc1f0529..9f63244f17e77 100644 --- a/pkgs/development/beam-modules/mix-release.nix +++ b/pkgs/development/beam-modules/mix-release.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, elixir, erlang, findutils, hex, rebar3, fetchMixDeps, makeWrapper, git }: +{ stdenv, lib, elixir, erlang, findutils, hex, rebar3, fetchMixDeps, makeWrapper, git, ripgrep }: { pname , version @@ -23,7 +23,8 @@ let in assert mixNixDeps != { } -> mixFodDeps == null; stdenv.mkDerivation (overridable // { - nativeBuildInputs = nativeBuildInputs ++ [ erlang hex elixir makeWrapper git ]; + # rg is used as a better grep to search for erlang references in the final release + nativeBuildInputs = nativeBuildInputs ++ [ erlang hex elixir makeWrapper git ripgrep ]; buildInputs = builtins.attrValues mixNixDeps; MIX_ENV = mixEnv; @@ -96,8 +97,8 @@ stdenv.mkDerivation (overridable // { # removing unused erlang reference from resulting derivation to reduce # closure size if [ -e $out/erts-* ]; then - echo "ERTS found in $dir - removing references to erlang to reduce closure size" - for file in $out/erts-*/bin/{erl,start}; do + echo "ERTS found in $out - removing references to erlang to reduce closure size" + for file in $(rg "${erlang}/lib/erlang" "$out" --text --files-with-matches); do substituteInPlace "$file" --replace "${erlang}/lib/erlang" "$out" done fi |