Add a stdenv adapter ‘keepDebugInfo’ to make a debug build
This adapter causes the resulting binaries to have debug info and no
optimisations. Example use (in all-packages.nix):
foo = callPackage ./foo.nix {
stdenv = keepDebugInfo stdenv;
};
This commit is contained in:
@@ -355,4 +355,16 @@ rec {
|
|||||||
drvPath = validate pkg.drvPath;
|
drvPath = validate pkg.drvPath;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* Modify a stdenv so that it produces debug builds; that is,
|
||||||
|
binaries have debug info, and compiler optimisations are
|
||||||
|
disabled. */
|
||||||
|
keepDebugInfo = stdenv: stdenv //
|
||||||
|
{ mkDerivation = args: stdenv.mkDerivation (args // {
|
||||||
|
dontStrip = true;
|
||||||
|
NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -g -O0";
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user