From a6f307ada4ca6a2f3723d54907904f6e1ce30c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Sun, 7 May 2023 18:36:25 +0200 Subject: [PATCH] haskell.packages.ghcjs: misc fixes Various fixes I needed to build a project that depends on lens. --- .../haskell-modules/configuration-common.nix | 1 + .../haskell-modules/configuration-ghcjs.nix | 24 ++++++++++++++++++- .../haskell-modules/configuration-nix.nix | 3 ++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 484889cea73..ee1001b684a 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1619,6 +1619,7 @@ self: super: { # Also, we need QuickCheck-2.14.x to build the test suite, which isn't easy in LTS-16.x. # So let's not go there and just disable the tests altogether. hspec-core = dontCheck super.hspec-core; + hspec-core_2_7_10 = doDistribute (dontCheck super.hspec-core_2_7_10); # tests seem to require a different version of hspec-core hspec-contrib = dontCheck super.hspec-contrib; diff --git a/pkgs/development/haskell-modules/configuration-ghcjs.nix b/pkgs/development/haskell-modules/configuration-ghcjs.nix index a7b90341a62..c2cafa14a67 100644 --- a/pkgs/development/haskell-modules/configuration-ghcjs.nix +++ b/pkgs/development/haskell-modules/configuration-ghcjs.nix @@ -27,7 +27,7 @@ self: super: # GHCJS does not ship with the same core packages as GHC. # https://github.com/ghcjs/ghcjs/issues/676 stm = doJailbreak self.stm_2_5_1_0; - exceptions = dontCheck self.exceptions_0_10_5; + exceptions = dontCheck self.exceptions_0_10_7; ## OTHER PACKAGES @@ -108,4 +108,26 @@ self: super: # Need hedgehog for tests, which fails to compile due to dep on concurrent-output zenc = dontCheck super.zenc; + + hspec = self.hspec_2_7_10; + hspec-core = self.hspec-core_2_7_10; + hspec-meta = self.hspec-meta_2_7_8; + hspec-discover = self.hspec-discover_2_7_10; + + # ReferenceError: h$primop_ShrinkSmallMutableArrayOp_Char is not defined + unordered-containers = dontCheck super.unordered-containers; + + # Without this revert, test suites using tasty fail with: + # ReferenceError: h$getMonotonicNSec is not defined + # https://github.com/UnkindPartition/tasty/pull/345#issuecomment-1538216407 + tasty = appendPatch (pkgs.fetchpatch { + name = "tasty-ghcjs.patch"; + url = "https://github.com/UnkindPartition/tasty/commit/e692065642fd09b82acccea610ad8f49edd207df.patch"; + revert = true; + relative = "core"; + hash = "sha256-ryABU2ywkVOEPC/jWv8humT3HaRpCwMYEk+Ux3hhi/M="; + }) super.tasty; + + # Tests take unacceptably long. + vector = dontCheck super.vector; } diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index d6e103049c8..3ae94f1a994 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -514,7 +514,8 @@ self: super: builtins.intersectAttrs super { libraryHaskellDepends = (drv.libraryHaskellDepends or []) ++ lib.optionals (!(pkgs.stdenv.hostPlatform.isAarch64 - || pkgs.stdenv.hostPlatform.isx86_64)) [ + || pkgs.stdenv.hostPlatform.isx86_64) + || (self.ghc.isGhcjs or false)) [ self.unbounded-delays ]; }) super.tasty;