haskell.nix
haskell.nix copied to clipboard
Can't enable DWARF in modules, limiting the usefulness of it
There are two ways get a build with DWARF debugging built in right now
- Using
mypkg.components.library.dwarf
ormypkg.components.exes.myexe.dwarf
. This is of limited use because there is no way to turn enable building with DWARF debug info built into all the libraries your library or exe depend on. - Adding something like this to the
project
modules
list to enable it for all components
({ pkgs, ...}: {
ghcOptions = optional (pkgs.stdenv.hostPlatform.isLinux && !pkgs.haskell-nix.haskellLib.isCrossHost && !pkgs.stdenv.hostPlatform.isMusl) "-g3";
})
Which works fine, but reproduces the checking logic that already exists in comp-builder.nix
.
Is there any reason not to add enableDWARF
as a component/packge/global parameter, so the above example, to enable it everywhere, would simply become
{
enableDWARF = true;
}
That way we wouldn't have to worry about checking all the same things that are checked in comp-builder.nix
.
Happy to open a PR for this if it is something people would want.