Skip to content

Commit

Permalink
Merge pull request #54900 from ElvishJerricco/haskell-shellfor-null-src
Browse files Browse the repository at this point in the history
shellFor: Don't suck in src to compare to deps. [Fixes #51079]
  • Loading branch information
infinisil authored Feb 14, 2019
2 parents 9611f84 + 24ccaf6 commit 982fe76
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkgs/development/haskell-modules/make-package-set.nix
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
# bash$ nix-shell --run "cabal new-build all"
shellFor = { packages, withHoogle ? false, ... } @ args:
let
selected = packages self;
nullSrc = p: overrideCabal p (_: { src = null; });

# Make sure we *never* accidentally suck in src.
selected = map nullSrc (packages self);

packageInputs = map getBuildInputs selected;

Expand All @@ -284,7 +287,8 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
# because cabal will end up ignoring that built version, assuming
# new-style commands.
haskellInputs = pkgs.lib.filter
(input: pkgs.lib.all (p: input.outPath != p.outPath) selected)
# nullSrc in case a dep is one of the selected packages.
(input: pkgs.lib.all (p: (nullSrc input).outPath != p.outPath) selected)
(pkgs.lib.concatMap (p: p.haskellBuildInputs) packageInputs);
systemInputs = pkgs.lib.concatMap (p: p.systemBuildInputs) packageInputs;

Expand Down

0 comments on commit 982fe76

Please sign in to comment.