Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce DWARF-enabled Haskell package set #51987

Open
bgamari opened this issue Dec 14, 2018 · 8 comments
Open

Introduce DWARF-enabled Haskell package set #51987

bgamari opened this issue Dec 14, 2018 · 8 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: haskell

Comments

@bgamari
Copy link
Contributor

bgamari commented Dec 14, 2018

Issue description

While haskell.lib.enableDWARFDebugging now exists, in practice it's not very useful since stack unwinding rarely succeeds unless all libraries in the process's image have unwind information. I think what we really want is a whole package set: haskell.packages.ghc864.withDwarf.

I thought implementing this would be straightforward; unfortunately it seems I was wrong. My attempt was:

let
  withDwarf = haskellPackages: haskellPackages.override { 
    overrides = self: super: {
      mkDerivation = xs: pkgs.haskell.lib.enableDWARFDebugging (super.mkDerivation xs);
    };
  };

Unfortunately this gives rise to

error: anonymous function at /nix/store/4yqnapjyaq2ag9idddvpyvsjy1q0diiy-nixpkgs-18.09.783.299814b385d/nixpkgs/pkgs/development/haskell-modules/generic-builder.nix:12:1 called with unexpected argument 'mkDerivation', at /nix/store/4yqnapjyaq2ag9idddvpyvsjy1q0diiy-nixpkgs-18.09.783.299814b385d/nixpkgs/lib/customisation.nix:69:12
@bgamari
Copy link
Contributor Author

bgamari commented Dec 14, 2018

Ahh, here we are:

let
  withDwarf = haskellPackages: haskellPackages.override {
    overrides = self: super: {
      mkDerivation = xs: super.mkDerivation (xs //
        { configureFlags = (xs.configureFlags or "") + "--ghc-options=-g --disable-executable-stripping --disable-library-stripping"; }
      );
    };
  };

@bgamari bgamari changed the title Introduce DWARF-neabled Haskell package set Introduce DWARF-enabled Haskell package set Dec 15, 2018
@matthewbauer
Copy link
Member

Have you looked at separate-debug-info.sh?

https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/separate-debug-info.sh

It would put debug info into a separate output. That would avoid the additional package set.

@nh2
Copy link
Contributor

nh2 commented Dec 15, 2018

Have you looked at separate-debug-info.sh?

Will that work easily for GHC?

I noticed that on https://ghc.haskell.org/trac/ghc/wiki/DWARF#OpenIssues it says:

Tibell suggested, the best approach might be to look at options to implement -gsplit-dwarf, which would allow us to ship a DWARF package separately.

which sounds to me like it won't work straight away.

@matthewbauer
Copy link
Member

Yeah it will probably require modifications to some things but IMO a separate output makes more sense in this case than a separate package set.

@bgamari
Copy link
Contributor Author

bgamari commented Dec 15, 2018

Yeah it will probably require modifications to some things but IMO a separate output makes more sense in this case than a separate package set.

That's a fair point.

@nh2
Copy link
Contributor

nh2 commented Dec 15, 2018

I'm all for what we can get as soon as possible.

If we can get the separate output easily, let's do it. If it's a lot of work and we need to do more compiling until we get there, let's do that instead.

@nh2
Copy link
Contributor

nh2 commented Dec 16, 2018

{ configureFlags = (xs.configureFlags or "") + "--ghc-options=-g --disable-executable-stripping --disable-library-stripping"; }

I think that needs an extra space, like + " --ghc-options=...", otherwise it may append directly to the last word in xs.configureFlags.

@stale
Copy link

stale bot commented Jun 3, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: haskell
Projects
None yet
Development

No branches or pull requests

4 participants