Skip to content

Commit

Permalink
Merge pull request #45348 from shlevy/shellFor-all-build-inputs
Browse files Browse the repository at this point in the history
haskellPackages.shellFor: fix after recent getHaskellBuildInputs fix.
  • Loading branch information
peti committed Sep 2, 2018
2 parents 1ef5b17 + b00b236 commit b35b8ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions pkgs/development/haskell-modules/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,18 @@ rec {
overrideSrc = drv: { src, version ? drv.version }:
overrideCabal drv (_: { inherit src version; editedCabalFile = null; });

# Extract the haskell build inputs of a haskell package.
# This is useful to build environments for developing on that
# package.
getHaskellBuildInputs = p:
# Get all of the build inputs of a haskell package, divided by category.
getBuildInputs = p:
(overrideCabal p (args: {
passthru = (args.passthru or {}) // {
_getHaskellBuildInputs = (extractBuildInputs p.compiler args).haskellBuildInputs;
_getBuildInputs = extractBuildInputs p.compiler args;
};
}))._getHaskellBuildInputs;
}))._getBuildInputs;

# Extract the haskell build inputs of a haskell package.
# This is useful to build environments for developing on that
# package.
getHaskellBuildInputs = p: (getBuildInputs p).haskellBuildInputs;

# 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
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let
inherit (stdenv) buildPlatform hostPlatform;

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

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

0 comments on commit b35b8ba

Please sign in to comment.