From d44203d04669ff29b3047154a1f2707f4fe42c34 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 25 Sep 2022 15:34:23 +0200 Subject: [PATCH] fix(third_party/overlays/dhall): move haskellPackages overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was overriding the overrides in haskellPackages, which we didn’t notice because there is no overrides in the hasell overlay atm. I also removed the `with` blocks and inlined `overrides`. Change-Id: Ide72109dbd2568b6cb2435b15024cf1523bec1fe Reviewed-on: https://cl.tvl.fyi/c/depot/+/6785 Autosubmit: Profpatsch Reviewed-by: sterni Tested-by: BuildkiteCI --- third_party/overlays/dhall/default.nix | 18 ++----------- third_party/overlays/haskell/default.nix | 32 ++++++++++++++++-------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/third_party/overlays/dhall/default.nix b/third_party/overlays/dhall/default.nix index d944905e8..462503599 100644 --- a/third_party/overlays/dhall/default.nix +++ b/third_party/overlays/dhall/default.nix @@ -3,15 +3,6 @@ self: super: let - dhall-source = subdir: pkg: super.haskell.lib.overrideSrc pkg { - src = "${super.fetchFromGitHub { - owner = "Profpatsch"; - repo = "dhall-haskell"; - # https://github.com/dhall-lang/dhall-haskell/pull/2426 - rev = "82123817316192d39f9a3e68b8ce9c9cff0a48ed"; - sha256 = "sha256-gbHoUKIdLPIttqeV471jsT8OJz6uiI6LpHOwtLbBGHY="; - }}/${subdir}"; - }; # binary releases of dhall tools, since the build in nixpkgs is # broken most of the time. The binaries are also fully static @@ -25,13 +16,8 @@ let { pkgs = self; }; in { - # TODO: this is to fix a bug in dhall-nix - haskellPackages = super.haskellPackages.override { - overrides = hsSelf: hsSuper: { - dhall = dhall-source "dhall" hsSuper.dhall; - dhall-nix = dhall-source "dhall-nix" hsSuper.dhall-nix; - }; - }; + # ATTN: see the haskell overlay for some overrides we need. + # dhall = easy-dhall-nix.dhall-simple; # dhall-nix = easy-dhall-nix.dhall-nix-simple; dhall-bash = easy-dhall-nix.dhall-bash-simple; diff --git a/third_party/overlays/haskell/default.nix b/third_party/overlays/haskell/default.nix index 0ed0196a2..54d278a78 100644 --- a/third_party/overlays/haskell/default.nix +++ b/third_party/overlays/haskell/default.nix @@ -7,25 +7,35 @@ self: super: # overlay parameters for the nixpkgs overlay let - overrides = hsSelf: hsSuper: with self.haskell.lib.compose; { - # No overrides for the default package set necessary at the moment + dhall-source = subdir: pkg: super.haskell.lib.overrideSrc pkg { + src = "${super.fetchFromGitHub { + owner = "Profpatsch"; + repo = "dhall-haskell"; + # https://github.com/dhall-lang/dhall-haskell/pull/2426 + rev = "82123817316192d39f9a3e68b8ce9c9cff0a48ed"; + sha256 = "sha256-gbHoUKIdLPIttqeV471jsT8OJz6uiI6LpHOwtLbBGHY="; + }}/${subdir}"; }; + + in { haskellPackages = super.haskellPackages.override { - inherit overrides; + overrides = hsSelf: hsSuper: { + # TODO: this is to fix a bug in dhall-nix + dhall = dhall-source "dhall" hsSuper.dhall; + dhall-nix = dhall-source "dhall-nix" hsSuper.dhall-nix; + }; }; haskell = lib.recursiveUpdate super.haskell { packages.ghc8107 = super.haskell.packages.ghc8107.override { - overrides = lib.composeExtensions overrides ( - hsSelf: hsSuper: with self.haskell.lib.compose; { - # TODO(sterni): TODO(grfn): patch xanthous to work with random-fu 0.3.*, - # so we can use GHC 9.0.2 and benefit from upstream binary cache. - random-fu = hsSelf.callPackage ./extra-pkgs/random-fu-0.2.nix { }; - rvar = hsSelf.callPackage ./extra-pkgs/rvar-0.2.nix { }; - } - ); + overrides = hsSelf: hsSuper: { + # TODO(sterni): TODO(grfn): patch xanthous to work with random-fu 0.3.*, + # so we can use GHC 9.0.2 and benefit from upstream binary cache. + random-fu = hsSelf.callPackage ./extra-pkgs/random-fu-0.2.nix { }; + rvar = hsSelf.callPackage ./extra-pkgs/rvar-0.2.nix { }; + }; }; }; }