From f92a5cbfc61fe0778af7137afa6ae3cd79470180 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 7 Nov 2013 12:09:38 +0100 Subject: [PATCH] pkgs/development/compilers/ghc/with-packages.nix: add 'ignoreCollisions' parameter The ghcWithPackage expression now has an argument 'ignoreCollisions' that allows users to disable the path collision check like so: (pkgs.haskellPackages.ghcWithPackages (pkgs: with pkgs; [ haskellPlatform ])).override { ignoreCollisions = true; }; See https://github.com/NixOS/nixpkgs/commit/d64917ad17277b8e16893ee31533ec2e33446fa7 for a long and detailed discussion of why these path collisions may occur. --- pkgs/development/compilers/ghc/with-packages.nix | 3 ++- pkgs/top-level/haskell-packages.nix | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/ghc/with-packages.nix b/pkgs/development/compilers/ghc/with-packages.nix index 8f5e8616a84..4508f0f529b 100644 --- a/pkgs/development/compilers/ghc/with-packages.nix +++ b/pkgs/development/compilers/ghc/with-packages.nix @@ -1,4 +1,4 @@ -{ stdenv, ghc, packages, buildEnv, makeWrapper }: +{ stdenv, ghc, packages, buildEnv, makeWrapper, ignoreCollisions ? false }: assert packages != []; @@ -12,6 +12,7 @@ in buildEnv { name = "haskell-env-${ghc.name}"; paths = stdenv.lib.filter isHaskellPkg (stdenv.lib.closePropagation packages) ++ [ghc]; + inherit ignoreCollisions; postBuild = '' . ${makeWrapper}/nix-support/setup-hook diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index 3d63b00dcc0..24bc93df865 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -102,8 +102,9 @@ let result = let callPackage = x : y : modifyPrio (newScope result.finalReturn x # argument to this function. ghcWithPackages = pkgs : callPackage ../development/compilers/ghc/with-packages.nix { - ghc = ghc; # refers to ghcPlain + ghc = ghc; # refers to ghcPlain packages = pkgs self; + ignoreCollisions = false; }; ghcWithPackagesOld = pkgs : callPackage ../development/compilers/ghc/with-packages-old.nix {