From b388850ca4cf925e67ca757f599202288cebad60 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Mon, 2 Feb 2026 17:30:38 +0000 Subject: [PATCH] haskellPackages: fix eval cycle when doCheck is enabled for cross --- .../haskell-modules/configuration-nix.nix | 29 +++++++++---------- .../haskell-modules/configuration-windows.nix | 17 ----------- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 0c3a8e40410b..221b4d2e30ef 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -2230,21 +2230,20 @@ builtins.intersectAttrs super { botan-bindings = super.botan-bindings.override { botan = pkgs.botan3; }; - # Avoids a cycle by disabling use of the external interpreter for the packages that are dependencies of iserv-proxy. - # These in particular can't rely on template haskell for cross-compilation anyway as they can't rely on iserv-proxy. - inherit - ( - let - noExternalInterpreter = overrideCabal { - enableExternalInterpreter = false; - }; - in - lib.mapAttrs (_: noExternalInterpreter) { inherit (super) libiserv iserv-proxy network; } - ) - libiserv - iserv-proxy - network - ; + iserv-proxy = + let + # Avoid a cycle by disabling tests and the external interpreter for packages that are dependencies of iserv-proxy. + # These in particular can't rely on template haskell for cross-compilation anyway as they can't rely on iserv-proxy. + # Also disable tests during iserv-proxy bootstrap since test packages tend to rely on TH for discovering test cases + breakExternalInterpreterBootstrapCycle = overrideCabal { + doCheck = false; + enableExternalInterpreter = false; + }; + overlay = lib.mapAttrs ( + _: pkg: if (pkg ? isHaskellLibrary) then breakExternalInterpreterBootstrapCycle pkg else pkg + ); + in + super.iserv-proxy.overrideScope (_: overlay); # Workaround for flaky test: https://github.com/basvandijk/threads/issues/10 threads = appendPatch ./patches/threads-flaky-test.patch super.threads; diff --git a/pkgs/development/haskell-modules/configuration-windows.nix b/pkgs/development/haskell-modules/configuration-windows.nix index 5489c415f09c..735a55ca4068 100644 --- a/pkgs/development/haskell-modules/configuration-windows.nix +++ b/pkgs/development/haskell-modules/configuration-windows.nix @@ -37,21 +37,4 @@ with haskellLib; # Root cause seems to be undefined references to libffi as shown by linking errors if we instead use "-Wl,--disable-auto-import" # See https://github.com/rust-lang/rust/issues/132226#issuecomment-2445100058 iserv-proxy = appendConfigureFlag "--ghc-option=-optl=-Wl,--disable-runtime-pseudo-reloc" super.iserv-proxy; - - # Avoids a cycle by disabling use of the external interpreter for the packages that are dependencies of iserv-proxy. - # See configuration-nix.nix, where iserv-proxy and network are handled. - # On Windows, network depends on temporary (see above), which depends on random, which depends on splitmix. - inherit - ( - let - noExternalInterpreter = overrideCabal { - enableExternalInterpreter = false; - }; - in - lib.mapAttrs (_: noExternalInterpreter) { inherit (super) random splitmix temporary; } - ) - random - splitmix - temporary - ; })