From 461141205e9005e2da8b70d9b803d40f9d64822d Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Tue, 27 Jan 2026 03:13:29 +0000 Subject: [PATCH 1/2] haskellPackages: enable ncurses when compiling for same triple rather than same platform --- pkgs/development/compilers/ghc/common-hadrian.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index e21e4033b9087..364eac1a492ab 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -72,10 +72,13 @@ stdenv.targetPlatform.isWindows || stdenv.targetPlatform.isGhcjs # Before , - # we couldn't force hadrian to build terminfo for cross. + # we couldn't force hadrian to build terminfo for different triples. || ( lib.versionOlder version "9.15.20250808" - && (stdenv.buildPlatform != stdenv.hostPlatform || stdenv.hostPlatform != stdenv.targetPlatform) + && ( + stdenv.buildPlatform.config != stdenv.hostPlatform.config + || stdenv.hostPlatform.config != stdenv.targetPlatform.config + ) ) ), From c83edba0a54b880af3bce98f69d74d55392b9ff2 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Tue, 27 Jan 2026 23:07:13 +0000 Subject: [PATCH 2/2] haskellPackages: prepend triple to `targetPrefix` only when the target is a different triple --- pkgs/development/compilers/ghc/common-hadrian.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index 364eac1a492ab..0fe3796c00b7f 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -356,7 +356,9 @@ let inherit (stdenv) buildPlatform hostPlatform targetPlatform; # TODO(@Ericson2314) Make unconditional - targetPrefix = lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; + targetPrefix = lib.optionalString ( + targetPlatform.config != hostPlatform.config + ) "${targetPlatform.config}-"; # TODO(@sternenseemann): there's no stage0:exe:haddock target by default, # so haddock isn't available for GHC cross-compilers. Can we fix that?