From 1912d246583067bf68ca30d3b9455228610c68a5 Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Mon, 25 May 2026 18:50:45 +0200 Subject: [PATCH] haskellPackages.ghc-typelits-natnormalise: fix tests Tests spawn ghc with -fplugin and need the package's in-place package database in NIX_GHC_PACKAGE_PATH_FOR_TEST. Put the override in configuration-nix.nix so it applies across GHC package sets. Assisted-by: OpenAI Codex (GPT-5) --- pkgs/development/haskell-modules/configuration-nix.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index ab279e0a1a63..865968f1077b 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -1663,6 +1663,15 @@ builtins.intersectAttrs super { (disableCabalFlag "icu") ]; + # Tests spawn ghc with -fplugin and need this package's in-place package db. + # The trailing colon keeps GHC's default package db in the package path. + # https://hydra.nixos.org/build/329190094 + ghc-typelits-natnormalise = overrideCabal (drv: { + preCheck = (drv.preCheck or "") + '' + export NIX_GHC_PACKAGE_PATH_FOR_TEST=$PWD/dist/package.conf.inplace/:$packageConfDir: + ''; + }) super.ghc-typelits-natnormalise; + # based on https://github.com/gibiansky/IHaskell/blob/aafeabef786154d81ab7d9d1882bbcd06fc8c6c4/release.nix ihaskell = overrideCabal (drv: { # ihaskell's cabal file forces building a shared executable, which we need