summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2017-10-10 12:24:30 -0400
committerShea Levy <shea@shealevy.com>2017-10-12 14:57:21 -0400
commit843e0992ca44be86cd7ca97f337bdd55a91c1655 (patch)
treed9473577a66e49ca15b332cef7b3c5ca733eaa32 /pkgs/development
parent7a946f0ae698632013e3dc30356acb5221d6a4eb (diff)
downloadnixlib-843e0992ca44be86cd7ca97f337bdd55a91c1655.tar
nixlib-843e0992ca44be86cd7ca97f337bdd55a91c1655.tar.gz
nixlib-843e0992ca44be86cd7ca97f337bdd55a91c1655.tar.bz2
nixlib-843e0992ca44be86cd7ca97f337bdd55a91c1655.tar.lz
nixlib-843e0992ca44be86cd7ca97f337bdd55a91c1655.tar.xz
nixlib-843e0992ca44be86cd7ca97f337bdd55a91c1655.tar.zst
nixlib-843e0992ca44be86cd7ca97f337bdd55a91c1655.zip
Partition all-cabal-hashes into case-insensitive-safe components.
OS X by default has a case-insensitive filesystem, and fetching
all-cabal-hashes there fails due to a hash mismatch caused by package
pairs like compactable and Compactable. This partitions the package set
such that each partition contains no equivalent-up-to-case pairs.
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/haskell-modules/make-package-set.nix19
1 files changed, 16 insertions, 3 deletions
diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix
index ff5be894b926..d84167008d93 100644
--- a/pkgs/development/haskell-modules/make-package-set.nix
+++ b/pkgs/development/haskell-modules/make-package-set.nix
@@ -118,10 +118,23 @@ let
       '';
   };
 
-  hackage2nix = name: version: self.haskellSrc2nix {
+  all-cabal-hashes-component = name: import (pkgs.runCommand "all-cabal-hashes-component-${name}.nix" {}
+    ''
+      set +o pipefail
+      for component in ${all-cabal-hashes}/*; do
+        if ls $component | grep -q ${name}; then
+          echo "builtins.storePath $component" > $out
+          exit 0
+        fi
+      done
+      echo "${name} not found in any all-cabal-hashes component, are you sure it's in hackage?" >&2
+      exit 1
+    '');
+
+  hackage2nix = name: version: let component = all-cabal-hashes-component name; in self.haskellSrc2nix {
     name   = "${name}-${version}";
-    sha256 = ''$(sed -e 's/.*"SHA256":"//' -e 's/".*$//' "${all-cabal-hashes}/${name}/${version}/${name}.json")'';
-    src    = "${all-cabal-hashes}/${name}/${version}/${name}.cabal";
+    sha256 = ''$(sed -e 's/.*"SHA256":"//' -e 's/".*$//' "${component}/${name}/${version}/${name}.json")'';
+    src    = "${component}/${name}/${version}/${name}.cabal";
   };
 
 in package-set { inherit pkgs stdenv callPackage; } self // {