aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/beam-modules/build-rebar3.nix
diff options
context:
space:
mode:
authorEric Merritt <eric@sunlightpayments.com>2016-06-15 07:15:06 -0700
committerEric Merritt <eric@merritt.tech>2016-06-15 07:20:01 -0700
commitb1cd08246fa51d3b018ae92f1e58a79844e44859 (patch)
tree27b0d7aab28a687d0f0d81c32204e454bc09707e /pkgs/development/beam-modules/build-rebar3.nix
parentde4013367349b38ca44ea59805640b76a2f01102 (diff)
beamPackages: turn on debug_info for beam packages
This allows you to turn on debug infor for all the beam packages in the system with a single change at the top level. This is required for debugging and dialyzer work. It also allows you to switch it on on a package by package basis.
Diffstat (limited to 'pkgs/development/beam-modules/build-rebar3.nix')
-rw-r--r--pkgs/development/beam-modules/build-rebar3.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/development/beam-modules/build-rebar3.nix b/pkgs/development/beam-modules/build-rebar3.nix
index abf2d1188ddc..ac40b76a78af 100644
--- a/pkgs/development/beam-modules/build-rebar3.nix
+++ b/pkgs/development/beam-modules/build-rebar3.nix
@@ -1,5 +1,5 @@
{ stdenv, writeText, erlang, rebar3, openssl, libyaml,
- pc, buildEnv }:
+ pc, buildEnv, lib }:
{ name, version
, src
@@ -11,11 +11,14 @@
, buildPhase ? null
, configurePhase ? null
, meta ? {}
+, enableDebugInfo ? false
, ... }@attrs:
with stdenv.lib;
let
+ debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "debug-info";
+
ownPlugins = buildPlugins ++ (if compilePorts then [pc] else []);
shell = drv: stdenv.mkDerivation {
@@ -51,7 +54,7 @@ let
configurePhase = if configurePhase == null
then ''
runHook preConfigure
- ${erlang}/bin/escript ${rebar3.bootstrapper}
+ ${erlang}/bin/escript ${rebar3.bootstrapper} ${debugInfoFlag}
runHook postConfigure
''
else configurePhase;