From ff96d815221573c2172a8928a294edc90c4371d7 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Fri, 21 Mar 2025 16:14:24 +0000 Subject: [PATCH] ghc: Use --hash-unit-ids when supported The compilers produced by nixpkgs don't use the detailed ABI hash. ("Project Unit Id","ghc-9.10.1-inplace") which should rather be ("Project Unit Id","ghc-9.10.1-")) This flag is supported on ghc-9.8 and upwards. From 9.14, this behaviour will be enabled by default. https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13444 Co-authored-by: sternenseemann --- .../development/compilers/ghc/common-hadrian.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index e6d90a785c15..6449ec17eb0a 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -660,11 +660,17 @@ stdenv.mkDerivation ( depsTargetTarget = map lib.getDev (libDeps targetPlatform); depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform); - hadrianFlags = [ - "--flavour=${ghcFlavour}" - "--bignum=${if enableNativeBignum then "native" else "gmp"}" - "--docs=${if enableDocs then "no-sphinx-pdfs" else "no-sphinx"}" - ]; + hadrianFlags = + [ + "--flavour=${ghcFlavour}" + "--bignum=${if enableNativeBignum then "native" else "gmp"}" + "--docs=${if enableDocs then "no-sphinx-pdfs" else "no-sphinx"}" + ] + ++ lib.optionals (lib.versionAtLeast version "9.8") [ + # In 9.14 this will be default with release flavour. + # See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13444 + "--hash-unit-ids" + ]; buildPhase = '' runHook preBuild