From d2bf2674c8f2bd3eb126ac61d82c9e9b24320293 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 24 Jul 2025 15:23:44 +0200 Subject: [PATCH] haskellPackages.llvm-ffi: 20.0 -> 21.0 We keep using LLVM 20, though, since LLVM 21 is still just a release candidate on our branch and llvm-ffi doesn't yet supported a released LLVM 21, just the git version. We can use the older version by passing a specific cabal flag. The evaluation warning reminding us to upgrade now also checks whether LLVM is a release candidate before triggering. --- .../configuration-hackage2nix/main.yaml | 2 -- .../haskell-modules/configuration-nix.nix | 27 +++++++++++-------- .../haskell-modules/hackage-packages.nix | 25 ----------------- 3 files changed, 16 insertions(+), 38 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml index 657c958b1d722..590ac810b2918 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml @@ -37,8 +37,6 @@ default-package-overrides: - hsc3 < 0.21 # 2024-12-31: last version that's compatible with GHC < 9.9 - htree < 0.2.0.0 - # 2025-07-10: use latest released version of LLVM - - llvm-ffi == 20.* # 2025-06-11: last version that supports pandoc == 3.6.* which is prescribed by LTS 23 - pandoc-crossref < 0.3.20 # keep-sorted end diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 0cb803f1c80cb..2980fbfd0416e 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -508,19 +508,24 @@ builtins.intersectAttrs super { # LLVM input that llvm-ffi declares. llvm-ffi = let - matchingLlvmVersion = lib.strings.toInt (lib.versions.major super.llvm-ffi.version); - nextLlvmVersion = matchingLlvmVersion + 1; + chosenLlvmVersion = 20; + nextLlvmAttr = "llvmPackages_${toString (chosenLlvmVersion + 1)}"; + shouldUpgrade = + pkgs ? ${nextLlvmAttr} && (lib.strings.match ".+rc.+" pkgs.${nextLlvmAttr}.llvm.version) == null; in - lib.warnIf (pkgs ? "llvmPackages_${toString nextLlvmVersion}") - # This package can be updated by changing the version constraint in - # configuration-hackage2nix/main.yaml and regenerating the haskellPackages set. - "haskellPackages.llvm-ffi: LLVM ${toString nextLlvmVersion} is available in Nixpkgs, consider updating." - addBuildDepends + lib.warnIf shouldUpgrade + "haskellPackages.llvm-ffi: ${nextLlvmAttr} is available in Nixpkgs, consider updating." + lib.pipe + super.llvm-ffi [ - pkgs."llvmPackages_${toString matchingLlvmVersion}".llvm.lib - pkgs."llvmPackages_${toString matchingLlvmVersion}".llvm.dev - ] - super.llvm-ffi; + # ATTN: There is no matching flag for the latest supported LLVM version, + # so you may need to remove this when updating chosenLlvmVersion + (enableCabalFlag "LLVM${toString chosenLlvmVersion}00") + (addBuildDepends [ + pkgs."llvmPackages_${toString chosenLlvmVersion}".llvm.lib + pkgs."llvmPackages_${toString chosenLlvmVersion}".llvm.dev + ]) + ]; # Needs help finding LLVM. spaceprobe = addBuildTool self.buildHaskellPackages.llvmPackages.llvm super.spaceprobe; diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix index c45ec5bff676f..259c7a611ccbb 100644 --- a/pkgs/development/haskell-modules/hackage-packages.nix +++ b/pkgs/development/haskell-modules/hackage-packages.nix @@ -425715,30 +425715,6 @@ self: { ) { }; "llvm-ffi" = callPackage ( - { - mkDerivation, - base, - enumset, - LLVM, - }: - mkDerivation { - pname = "llvm-ffi"; - version = "20.0"; - sha256 = "1vd9rzqq9fcml9zgrxrvplcgxd925xyy7ixprcxb8j4vc0a8hgzc"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - base - enumset - ]; - librarySystemDepends = [ LLVM ]; - description = "FFI bindings to the LLVM compiler toolkit"; - license = lib.licenses.bsd3; - maintainers = [ lib.maintainers.thielema ]; - } - ) { LLVM = null; }; - - "llvm-ffi_21_0" = callPackage ( { mkDerivation, base, @@ -425758,7 +425734,6 @@ self: { librarySystemDepends = [ LLVM-21git ]; description = "FFI bindings to the LLVM compiler toolkit"; license = lib.licenses.bsd3; - hydraPlatforms = lib.platforms.none; maintainers = [ lib.maintainers.thielema ]; } ) { LLVM-21git = null; };