From 8da4d55f72da2272aabfdf073464815480389185 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 2 Oct 2021 12:44:03 +0200 Subject: [PATCH] haskellPackages.ghcup: fix build by providing up to date deps Previously ghcup was failing because of incompatibilities between optics 0.3 and 0.4. I'm personally not sure if hspec-golden-aeson 0.9.0.0 is strictly necessary, but we may as well use this opportunity to start ironing out the issues its quirky behavior since 0.8.0.0 causes. --- .../haskell-modules/configuration-common.nix | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index fe4954009738..3b2717ea1693 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1913,9 +1913,34 @@ EOT # https://github.com/Porges/email-validate-hs/issues/58 email-validate = doJailbreak super.email-validate; - # 2021-06-20: Outdated upper bounds - # https://github.com/Porges/email-validate-hs/issues/58 - ghcup = doJailbreak super.ghcup; + # 2021-10-02: Make optics 0.4 packages work together + optics-th_0_4 = super.optics-th_0_4.override { + optics-core = self.optics-core_0_4; + }; + optics-extra_0_4 = super.optics-extra_0_4.override { + optics-core = self.optics-core_0_4; + }; + optics_0_4 = super.optics_0_4.override { + optics-core = self.optics-core_0_4; + optics-extra = self.optics-extra_0_4; + optics-th = self.optics-th_0_4; + }; + + # https://github.com/plow-technologies/hspec-golden-aeson/issues/17 + hspec-golden-aeson_0_9_0_0 = dontCheck super.hspec-golden-aeson_0_9_0_0; + + # 2021-10-02: Doesn't compile with optics < 0.4 + ghcup = overrideCabal (super.ghcup.override { + hspec-golden-aeson = self.hspec-golden-aeson_0_9_0_0; + optics = self.optics_0_4; + }) (drv: { + # golden files are not shipped with the hackage tarball and hspec-golden-aeson + # needs some encouraging to create the missing files after version 0.8.0.0. + # See: https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/255 + preCheck = '' + export CREATE_MISSING_GOLDEN=yes + '' + (drv.preCheck or ""); + }); # Break out of "Cabal < 3.2" constraint. stylish-haskell = doJailbreak super.stylish-haskell;