From 1df940707450f714b8467cc585f1eeb9593e6a54 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sun, 29 Jun 2025 00:40:22 +0200 Subject: [PATCH] haskellPackages.env-extra: fix flaky test failures --- .../haskell-modules/configuration-common.nix | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 29627ab88bd7..d9e03a232e10 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -362,6 +362,26 @@ with haskellLib; # 2023-07-17: Outdated base bound https://github.com/srid/lvar/issues/5 lvar = doJailbreak super.lvar; + # Don't call setEnv in parallel in the test suite (which leads to flaky failures) + env-extra = + appendPatches + [ + (pkgs.fetchpatch { + name = "env-extra-no-parallel-setenv.patch"; + url = "https://github.com/d12frosted/env-extra/commit/4fcbc031b210e71e4243fcfe7c48d381e2f51d78.patch"; + sha256 = "sha256-EbXk+VOmxMJAMCMTXpTiW8fkbNI9za7f1alzCeaJaV4="; + excludes = [ "package.yaml" ]; + }) + ] + ( + overrideCabal (drv: { + prePatch = '' + ${drv.prePatch or ""} + ${lib.getExe' pkgs.buildPackages.dos2unix "dos2unix"} *.cabal + ''; + }) super.env-extra + ); + # This used to be a core package provided by GHC, but then the compiler # dropped it. We define the name here to make sure that old packages which # depend on this library still evaluate (even though they won't compile