From 517cb71b026be805c41945dc86a7352b1bf8aa92 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 24 Dec 2021 21:12:56 +0100 Subject: [PATCH] haskellPackages.inline-c-cpp: Fix tests on darwin --- .../haskell-modules/configuration-darwin.nix | 2 -- .../haskell-modules/configuration-ghc-8.10.x.nix | 7 +++++++ .../haskell-modules/configuration-ghc-8.6.x.nix | 6 ++++++ .../haskell-modules/configuration-ghc-8.8.x.nix | 7 +++++++ .../haskell-modules/configuration-ghc-9.0.x.nix | 10 ++++++++++ .../haskell-modules/configuration-ghc-9.2.x.nix | 9 +++++++++ .../haskell-modules/configuration-ghc-head.nix | 9 +++++++++ 7 files changed, 48 insertions(+), 2 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-darwin.nix b/pkgs/development/haskell-modules/configuration-darwin.nix index 84be174e97e8..f8ae9807cd1d 100644 --- a/pkgs/development/haskell-modules/configuration-darwin.nix +++ b/pkgs/development/haskell-modules/configuration-darwin.nix @@ -287,8 +287,6 @@ self: super: ({ # https://github.com/fpco/unliftio/issues/87 unliftio = dontCheck super.unliftio; - # https://github.com/fpco/inline-c/issues/127 - inline-c-cpp = dontCheck super.inline-c-cpp; # https://github.com/haskell-crypto/cryptonite/issues/360 cryptonite = appendPatch ./patches/cryptonite-remove-argon2.patch super.cryptonite; diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix index 097946690447..84d0a30858f3 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix @@ -2,6 +2,10 @@ with haskellLib; +let + inherit (pkgs.stdenv.hostPlatform) isDarwin; +in + self: super: { llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; @@ -121,4 +125,7 @@ self: super: { ] super.mysql-simple; taffybar = markUnbroken (doDistribute super.taffybar); + + # https://github.com/fpco/inline-c/issues/127 (recommend to upgrade to Nixpkgs GHC >=9.0) + inline-c-cpp = (if isDarwin then dontCheck else x: x) super.inline-c-cpp; } diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix index d712ab9d1a2b..5eaa1ae413d4 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix @@ -2,6 +2,10 @@ with haskellLib; +let + inherit (pkgs.stdenv.hostPlatform) isDarwin; +in + self: super: { llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; @@ -104,4 +108,6 @@ self: super: { mime-string = disableOptimization super.mime-string; + # https://github.com/fpco/inline-c/issues/127 (recommend to upgrade to Nixpkgs GHC >=9.0) + inline-c-cpp = (if isDarwin then dontCheck else x: x) super.inline-c-cpp; } diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix index c0e9b7aab5ae..6b56d9eb7354 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix @@ -2,6 +2,10 @@ with haskellLib; +let + inherit (pkgs.stdenv.hostPlatform) isDarwin; +in + self: super: { llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; @@ -150,4 +154,7 @@ self: super: { mysql-simple = addBuildDepends [ self.blaze-textual ] super.mysql-simple; + + # https://github.com/fpco/inline-c/issues/127 (recommend to upgrade to Nixpkgs GHC >=9.0) + inline-c-cpp = (if isDarwin then dontCheck else x: x) super.inline-c-cpp; } diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix index f36c77d636a7..855afa28101d 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix @@ -2,6 +2,10 @@ with haskellLib; +let + inherit (pkgs.stdenv.hostPlatform) isDarwin; +in + self: super: { llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; @@ -118,4 +122,10 @@ self: super: { multistate = doJailbreak super.multistate; # https://github.com/lspitzner/butcher/issues/7 butcher = doJailbreak super.butcher; + + # We use a GHC patch to support the fix for https://github.com/fpco/inline-c/issues/127 + # which means that the upstream cabal file isn't allowed to add the flag. + inline-c-cpp = + (if isDarwin then appendConfigureFlags ["--ghc-option=-fcompact-unwind"] else x: x) + super.inline-c-cpp; } diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix index eb1245191cb8..b55429da65b5 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix @@ -2,6 +2,10 @@ with haskellLib; +let + inherit (pkgs.stdenv.hostPlatform) isDarwin; +in + self: super: { llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; @@ -236,4 +240,9 @@ self: super: { hls-retrie-plugin = null; hls-splice-plugin = null; })); + + # https://github.com/fpco/inline-c/pull/131 + inline-c-cpp = + (if isDarwin then appendConfigureFlags ["--ghc-option=-fcompact-unwind"] else x: x) + super.inline-c-cpp; } diff --git a/pkgs/development/haskell-modules/configuration-ghc-head.nix b/pkgs/development/haskell-modules/configuration-ghc-head.nix index e1e3f2c99884..9c7895d4fe6d 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-head.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-head.nix @@ -9,6 +9,10 @@ with haskellLib; +let + inherit (pkgs.stdenv.hostPlatform) isDarwin; +in + self: super: { llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; @@ -74,4 +78,9 @@ self: super: { # Break out of "yaml >=0.10.4.0 && <0.11": https://github.com/commercialhaskell/stack/issues/4485 stack = doJailbreak super.stack; + # https://github.com/fpco/inline-c/pull/131 + # and/or https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7739 + inline-c-cpp = + (if isDarwin then appendConfigureFlags ["--ghc-option=-fcompact-unwind"] else x: x) + super.inline-c-cpp; }