From 30a27a0d273639bf219aafd602b0a491f4166cbd Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 15 Sep 2024 12:32:52 +0200 Subject: [PATCH 1/5] pkgsStatic.haskellPackages: run checks by default The default for doCheck is meant to disable tests, when they can't be executed in cross environments. However, pkgsStatic and some other package sets are technically implemented as cross, even though the binaries can be executed just fine. Using canExecute is a much better check for this, thus enabling tests on pkgsStatic by default. --- pkgs/development/haskell-modules/generic-builder.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 8b24fbe3ebd79..cf4d855c8f897 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -43,7 +43,7 @@ in , buildFlags ? [] , haddockFlags ? [] , description ? null -, doCheck ? !isCross +, doCheck ? stdenv.buildPlatform.canExecute stdenv.hostPlatform , doBenchmark ? false , doHoogle ? true , doHaddockQuickjump ? doHoogle From 7cd3f1c942fa13e65f47f74e74c2c356e32c5422 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 15 Sep 2024 13:01:32 +0200 Subject: [PATCH 2/5] pkgsStatic.haskellPackages.hashable: disable checks --- pkgs/development/haskell-modules/configuration-common.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index b2f626a022fcd..0d207082142a5 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2261,6 +2261,13 @@ self: super: { # Too strict bound on hspec (<2.11) utf8-light = doJailbreak super.utf8-light; + # Fails to build in pkgsStatic with: + # Preprocessing test suite 'hashable-tests' for hashable-1.4.4.0.. + # Mmap.hsc: In function ‘_hsc2hs_test13’: + # Mmap.hsc:54:20: error: storage size of ‘test_array’ isn’t constant + # compilation failed + hashable = dontCheckIf pkgs.stdenv.hostPlatform.isStatic super.hashable; + # BSON defaults to requiring network instead of network-bsd which is # required nowadays: https://github.com/mongodb-haskell/bson/issues/26 bson = appendConfigureFlag "-f-_old_network" (super.bson.override { From adeb1ea44058f53a57d9cc8b5a6049261f1f9fa5 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 21 Dec 2024 20:01:52 +0100 Subject: [PATCH 3/5] pkgsStatic.haskellPackages.unliftio: disable checks --- pkgs/development/haskell-modules/configuration-common.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 0d207082142a5..81d56981e0caf 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2268,6 +2268,14 @@ self: super: { # compilation failed hashable = dontCheckIf pkgs.stdenv.hostPlatform.isStatic super.hashable; + # Fails to build in pkgsStatic with: + # Building test suite 'unliftio-spec' for unliftio-0.2.25.0.. + # ghc: could not execute: hspec-discover + # + # Because of this in Spec.hs: + # {-# OPTIONS_GHC -F -pgmF hspec-discover #-} + unliftio = dontCheckIf pkgs.stdenv.hostPlatform.isStatic super.unliftio; + # BSON defaults to requiring network instead of network-bsd which is # required nowadays: https://github.com/mongodb-haskell/bson/issues/26 bson = appendConfigureFlag "-f-_old_network" (super.bson.override { From 67c5c2a150770424c4ff478acf95d2be775bd642 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 21 Dec 2024 20:06:31 +0100 Subject: [PATCH 4/5] pkgsStatic.haskellPackages.infer-license: disable checks --- pkgs/development/haskell-modules/configuration-common.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 81d56981e0caf..3dcb8d4e2c807 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2276,6 +2276,14 @@ self: super: { # {-# OPTIONS_GHC -F -pgmF hspec-discover #-} unliftio = dontCheckIf pkgs.stdenv.hostPlatform.isStatic super.unliftio; + # Fails to build in pkgsStatic with: + # Building test suite 'spec' for infer-license-0.2.0.. + # ghc: could not execute: hspec-discover + # + # Because of this in Spec.hs: + # {-# OPTIONS_GHC -fforce-recomp -F -pgmF hspec-discover #-} + infer-license = dontCheckIf pkgs.stdenv.hostPlatform.isStatic super.infer-license; + # BSON defaults to requiring network instead of network-bsd which is # required nowadays: https://github.com/mongodb-haskell/bson/issues/26 bson = appendConfigureFlag "-f-_old_network" (super.bson.override { From 7a63cb974632178a89317d8d048faff41d0bd46a Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 21 Dec 2024 20:08:59 +0100 Subject: [PATCH 5/5] pkgsStatic.haskellPackages.interpolate: disable checks --- pkgs/development/haskell-modules/configuration-common.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 3dcb8d4e2c807..a8145728df5e1 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2284,6 +2284,14 @@ self: super: { # {-# OPTIONS_GHC -fforce-recomp -F -pgmF hspec-discover #-} infer-license = dontCheckIf pkgs.stdenv.hostPlatform.isStatic super.infer-license; + # Fails to build in pkgsStatic with: + # Building test suite 'spec' for interpolate-0.2.1.. + # ghc: could not execute: hspec-discover + # + # Because of this in Spec.hs: + # {-# OPTIONS_GHC -F -pgmF hspec-discover #-} + interpolate = dontCheckIf pkgs.stdenv.hostPlatform.isStatic super.interpolate; + # BSON defaults to requiring network instead of network-bsd which is # required nowadays: https://github.com/mongodb-haskell/bson/issues/26 bson = appendConfigureFlag "-f-_old_network" (super.bson.override {