From 1bda5b199d3bf976e9367ea3c51d854f6e8bcbde Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 3 Sep 2025 03:42:44 +0100 Subject: [PATCH] =?UTF-8?q?haskell.compiler.ghc{924,963,984}Binary:=20remo?= =?UTF-8?q?ve=20LLVM=E2=80=90related=20dead=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These binary packages are available for a fixed set of platforms, all of which support the native code generator. Therefore, the `llvmPackages` argument was never used. We leave an assertion around, just in case. --- pkgs/development/compilers/ghc/9.2.4-binary.nix | 10 +++------- pkgs/development/compilers/ghc/9.6.3-binary.nix | 10 +++------- pkgs/development/compilers/ghc/9.8.4-binary.nix | 10 +++------- pkgs/top-level/haskell-packages.nix | 12 +++--------- 4 files changed, 12 insertions(+), 30 deletions(-) diff --git a/pkgs/development/compilers/ghc/9.2.4-binary.nix b/pkgs/development/compilers/ghc/9.2.4-binary.nix index 77986b76d64b..d867b7926684 100644 --- a/pkgs/development/compilers/ghc/9.2.4-binary.nix +++ b/pkgs/development/compilers/ghc/9.2.4-binary.nix @@ -10,7 +10,6 @@ libiconv, numactl, libffi, - llvmPackages, coreutils, targetPackages, @@ -193,8 +192,6 @@ let ) binDistUsed.archSpecificLibraries )).nixPackage; - useLLVM = !(import ./common-have-ncg.nix { inherit lib stdenv version; }); - libPath = lib.makeLibraryPath ( # Add arch-specific libraries. map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries @@ -207,9 +204,6 @@ let targetPackages.stdenv.cc.bintools coreutils # for cat ] - ++ lib.optionals useLLVM [ - (lib.getBin llvmPackages.llvm) - ] # On darwin, we need unwrapped bintools as well (for otool) ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ targetPackages.stdenv.cc.bintools.bintools @@ -217,6 +211,8 @@ let in +assert import ./common-have-ncg.nix { inherit lib stdenv version; }; + stdenv.mkDerivation { inherit version; pname = "ghc-binary${binDistUsed.variantSuffix}"; @@ -470,7 +466,7 @@ stdenv.mkDerivation { targetPrefix = ""; enableShared = true; - inherit llvmPackages; + llvmPackages = null; # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; diff --git a/pkgs/development/compilers/ghc/9.6.3-binary.nix b/pkgs/development/compilers/ghc/9.6.3-binary.nix index 72367c6b3d80..1557cb48a3df 100644 --- a/pkgs/development/compilers/ghc/9.6.3-binary.nix +++ b/pkgs/development/compilers/ghc/9.6.3-binary.nix @@ -10,7 +10,6 @@ libiconv, numactl, libffi, - llvmPackages, coreutils, targetPackages, @@ -192,8 +191,6 @@ let ) binDistUsed.archSpecificLibraries )).nixPackage; - useLLVM = !(import ./common-have-ncg.nix { inherit lib stdenv version; }); - libPath = lib.makeLibraryPath ( # Add arch-specific libraries. map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries @@ -206,9 +203,6 @@ let targetPackages.stdenv.cc.bintools coreutils # for cat ] - ++ lib.optionals useLLVM [ - (lib.getBin llvmPackages.llvm) - ] # On darwin, we need unwrapped bintools as well (for otool) ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ targetPackages.stdenv.cc.bintools.bintools @@ -216,6 +210,8 @@ let in +assert import ./common-have-ncg.nix { inherit lib stdenv version; }; + stdenv.mkDerivation { inherit version; pname = "ghc-binary${binDistUsed.variantSuffix}"; @@ -449,7 +445,7 @@ stdenv.mkDerivation { targetPrefix = ""; enableShared = true; - inherit llvmPackages; + llvmPackages = null; # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; diff --git a/pkgs/development/compilers/ghc/9.8.4-binary.nix b/pkgs/development/compilers/ghc/9.8.4-binary.nix index e8e1e5e4397a..b691715f8795 100644 --- a/pkgs/development/compilers/ghc/9.8.4-binary.nix +++ b/pkgs/development/compilers/ghc/9.8.4-binary.nix @@ -9,7 +9,6 @@ libiconv, numactl, libffi, - llvmPackages, coreutils, targetPackages, @@ -206,8 +205,6 @@ let ) binDistUsed.archSpecificLibraries )).nixPackage; - useLLVM = !(import ./common-have-ncg.nix { inherit lib stdenv version; }); - libPath = lib.makeLibraryPath ( # Add arch-specific libraries. map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries @@ -220,9 +217,6 @@ let targetPackages.stdenv.cc.bintools coreutils # for cat ] - ++ lib.optionals useLLVM [ - (lib.getBin llvmPackages.llvm) - ] # On darwin, we need unwrapped bintools as well (for otool) ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ targetPackages.stdenv.cc.bintools.bintools @@ -230,6 +224,8 @@ let in +assert import ./common-have-ncg.nix { inherit lib stdenv version; }; + stdenv.mkDerivation { inherit version; pname = "ghc-binary${binDistUsed.variantSuffix}"; @@ -464,7 +460,7 @@ stdenv.mkDerivation { targetPrefix = ""; enableShared = true; - inherit llvmPackages; + llvmPackages = null; # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index c6920778ef86..ab8358c19a00 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -74,17 +74,11 @@ in llvmPackages = pkgs.llvmPackages_12; }; - ghc924Binary = callPackage ../development/compilers/ghc/9.2.4-binary.nix { - llvmPackages = pkgs.llvmPackages_12; - }; + ghc924Binary = callPackage ../development/compilers/ghc/9.2.4-binary.nix { }; - ghc963Binary = callPackage ../development/compilers/ghc/9.6.3-binary.nix { - llvmPackages = pkgs.llvmPackages_15; - }; + ghc963Binary = callPackage ../development/compilers/ghc/9.6.3-binary.nix { }; - ghc984Binary = callPackage ../development/compilers/ghc/9.8.4-binary.nix { - llvmPackages = pkgs.llvmPackages_15; - }; + ghc984Binary = callPackage ../development/compilers/ghc/9.8.4-binary.nix { }; ghc948 = callPackage ../development/compilers/ghc/9.4.8.nix { bootPkgs =