haskellPackages: fix eval cycle when doCheck is enabled for cross

This commit is contained in:
Alexandre Esteves
2026-02-02 17:30:38 +00:00
parent d97271a2cf
commit b388850ca4
2 changed files with 14 additions and 32 deletions
@@ -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;
@@ -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
;
})