From c8b5413fa6838f65a62a0682a1cd56008fd028bb Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 1 Jan 2024 14:43:21 +0000 Subject: [PATCH] haskell.packages.ghc865Binary: drop unevaluatable packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `haskell.packages.ghc865Binary` has a few packages that fails to evaluate by referring non-existent attributes. This turns evaluation attempts into unrecoverable errors. Before the change an attempt to instantiate all `ghc810` packages failed as: $ nix-instantiate --strict --eval --expr 'with import ./. {}; lib.mapAttrs (n: v: builtins.tryEval (lib.isDerivation v)) haskell.packages.ghc865Binary' error: … while evaluating the attribute 'llvmPackages' at lib/attrsets.nix:1180:11: 1179| attrs: 1180| attrs // { recurseForDerivations = false; }; | ^ 1181| error: value is null while a set was expected The change follows definition of `pkgs/top-level/haskell-packages.nix` and also sets `llvmPackages` to `null`. While at it dropped other references to deleted packages like `exceptions` pin. --- .../haskell-modules/configuration-ghc-8.6.x.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix index 7cd010e22d9c..1ef49d1f894f 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix @@ -8,7 +8,8 @@ in self: super: { - llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; + # Should be llvmPackages_6 which has been removed from nixpkgs + llvmPackages = null; # Disable GHC 8.6.x core libraries. array = null; @@ -49,6 +50,9 @@ self: super: { # Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work Cabal-syntax = self.Cabal-syntax_3_6_0_0; + # These core package only exist for GHC >= 9.4. The best we can do is feign + # their existence to callPackages, but their is no shim for lower GHC versions. + system-cxx-std-lib = null; # Needs Cabal 3.0.x. jailbreak-cabal = super.jailbreak-cabal.overrideScope (cself: _: { Cabal = cself.Cabal_3_2_1_0; }); @@ -91,7 +95,7 @@ self: super: { ghc-lib-parser-ex = addBuildDepend self.ghc-lib-parser super.ghc-lib-parser-ex; # This became a core library in ghc 8.10., so we don’t have an "exception" attribute anymore. - exceptions = super.exceptions_0_10_4; + exceptions = null; # Older compilers need the latest ghc-lib to build this package. hls-hlint-plugin = addBuildDepend self.ghc-lib super.hls-hlint-plugin;