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.
This commit is contained in:
committed by
Eric Merritt
parent
de40133673
commit
b1cd08246f
@@ -1,4 +1,4 @@
|
||||
{ stdenv, writeText, erlang, perl, which, gitMinimal, wget }:
|
||||
{ stdenv, writeText, erlang, perl, which, gitMinimal, wget, 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";
|
||||
|
||||
shell = drv: stdenv.mkDerivation {
|
||||
name = "interactive-shell-${drv.name}";
|
||||
buildInputs = [ drv ];
|
||||
@@ -55,7 +58,7 @@ let
|
||||
then ''
|
||||
runHook preBuild
|
||||
|
||||
make SKIP_DEPS=1
|
||||
make SKIP_DEPS=1 ERL_OPTS="$ERL_OPTS ${debugInfoFlag}"
|
||||
|
||||
runHook postBuild
|
||||
''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, writeText, elixir, erlang, hexRegistrySnapshot, hex }:
|
||||
{ stdenv, writeText, elixir, erlang, hexRegistrySnapshot, hex, lib }:
|
||||
|
||||
{ name
|
||||
, version
|
||||
@@ -12,11 +12,15 @@
|
||||
, buildPhase ? null
|
||||
, configurePhase ? null
|
||||
, meta ? {}
|
||||
, enableDebugInfo ? false
|
||||
, ... }@attrs:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let
|
||||
|
||||
debugInfoFlag = lib.optionalString (enableDebugInfo || elixir.debugInfo) "--debug-info";
|
||||
|
||||
shell = drv: stdenv.mkDerivation {
|
||||
name = "interactive-shell-${drv.name}";
|
||||
buildInputs = [ drv ];
|
||||
@@ -58,7 +62,7 @@ let
|
||||
export HEX_HOME=`pwd`
|
||||
export MIX_ENV=prod
|
||||
|
||||
MIX_ENV=prod mix compile --debug-info --no-deps-check
|
||||
MIX_ENV=prod mix compile ${debugInfoFlag} --no-deps-check
|
||||
|
||||
runHook postBuild
|
||||
''
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user