From 24ccaf65dff3b918c194a4e9282675da16458103 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Tue, 29 Jan 2019 16:26:29 -0500 Subject: [PATCH] shellFor: Don't suck in src to compare to deps. [Fixes #51079] --- pkgs/development/haskell-modules/make-package-set.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix index b4cd7fee311b2..e33ac7c5f8528 100644 --- a/pkgs/development/haskell-modules/make-package-set.nix +++ b/pkgs/development/haskell-modules/make-package-set.nix @@ -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; @@ -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;