3
0
Fork 0
forked from mirrors/nixpkgs

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:
Eelco Dolstra 2012-10-31 13:41:54 +01:00
parent 0dd3996ab4
commit ccd44e84c8

View file

@ -355,4 +355,16 @@ rec {
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";
});
};
}