Skip to content

Commit

Permalink
Make getHaskellBuildInputs / shellFor work with overrideCabal
Browse files Browse the repository at this point in the history
(cherry picked from commit 5523ec8)

This fixes some bugs with this helper.
  • Loading branch information
ElvishJerricco authored and Ericson2314 committed Jun 20, 2018
1 parent 6b690b2 commit b96cd41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions pkgs/development/haskell-modules/lib.nix
Expand Up @@ -296,8 +296,11 @@ rec {
# This is useful to build environments for developing on that
# package.
getHaskellBuildInputs = p:
(p.override { mkDerivation = extractBuildInputs p.compiler;
}).haskellBuildInputs;
(overrideCabal p (args: {
passthru = (args.passthru or {}) // {
_getHaskellBuildInputs = extractBuildInputs p.compiler args;
};
}))._getHaskellBuildInputs;

# Under normal evaluation, simply return the original package. Under
# nix-shell evaluation, return a nix-shell optimized environment.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/haskell-modules/make-package-set.nix
Expand Up @@ -38,7 +38,7 @@ let
inherit (stdenv) buildPlatform hostPlatform;

inherit (stdenv.lib) fix' extends makeOverridable;
inherit (haskellLib) overrideCabal;
inherit (haskellLib) overrideCabal getHaskellBuildInputs;

mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
inherit stdenv;
Expand Down Expand Up @@ -228,7 +228,7 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
shellFor = { packages, withHoogle ? false, ... } @ args:
let
selected = packages self;
packageInputs = builtins.map (p: p.override { mkDerivation = haskellLib.extractBuildInputs p.compiler; }) selected;
packageInputs = builtins.map getHaskellBuildInputs selected;
haskellInputs =
builtins.filter
(input: pkgs.lib.all (p: input.outPath != p.outPath) selected)
Expand Down

0 comments on commit b96cd41

Please sign in to comment.