From 2a87cb7a8b4436bcd85fe0fe9532664386879a67 Mon Sep 17 00:00:00 2001 From: happysalada Date: Sun, 6 Jun 2021 19:56:33 +0900 Subject: [PATCH] build-mix buildRebar3: strip out derivation for NIFs --- pkgs/development/beam-modules/build-mix.nix | 7 ++++--- pkgs/development/beam-modules/build-rebar3.nix | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/beam-modules/build-mix.nix b/pkgs/development/beam-modules/build-mix.nix index 31d266d3578..783ae34dcd3 100644 --- a/pkgs/development/beam-modules/build-mix.nix +++ b/pkgs/development/beam-modules/build-mix.nix @@ -29,9 +29,6 @@ let MIX_DEBUG = if enableDebugInfo then 1 else 0; HEX_OFFLINE = 1; - # stripping does not have any effect on beam files - dontStrip = true; - # add to ERL_LIBS so other modules can find at runtime. # http://erlang.org/doc/man/code.html#code-path # Mix also searches the code path when compiling with the --no-deps-check flag @@ -72,6 +69,10 @@ let runHook postInstall ''; + # stripping does not have any effect on beam files + # it is however needed for dependencies with NIFs like bcrypt for example + dontStrip = false; + passthru = { packageName = name; env = shell self; diff --git a/pkgs/development/beam-modules/build-rebar3.nix b/pkgs/development/beam-modules/build-rebar3.nix index b66dc535ce0..0dfd68f0993 100644 --- a/pkgs/development/beam-modules/build-rebar3.nix +++ b/pkgs/development/beam-modules/build-rebar3.nix @@ -42,9 +42,13 @@ let buildInputs = buildInputs ++ [ erlang rebar3 openssl libyaml ]; propagatedBuildInputs = unique beamDeps; - dontStrip = true; inherit src; + # stripping does not have any effect on beam files + # it is however needed for dependencies with NIFs + # false is the default but we keep this for readability + dontStrip = false; + setupHook = writeText "setupHook.sh" '' addToSearchPath ERL_LIBS "$1/lib/erlang/lib/" '';