about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2013-12-26 20:14:31 +0100
committerPeter Simons <simons@cryp.to>2013-12-29 12:26:05 +0100
commit631ad32b5dbde2bff2d935669c66ca561997b405 (patch)
treeea372b1bc7cfc121259db1deb7b588ac18328216 /pkgs/build-support
parent6ea52bf49a26938e5c23cebad88880937cd5a35d (diff)
downloadnixlib-631ad32b5dbde2bff2d935669c66ca561997b405.tar
nixlib-631ad32b5dbde2bff2d935669c66ca561997b405.tar.gz
nixlib-631ad32b5dbde2bff2d935669c66ca561997b405.tar.bz2
nixlib-631ad32b5dbde2bff2d935669c66ca561997b405.tar.lz
nixlib-631ad32b5dbde2bff2d935669c66ca561997b405.tar.xz
nixlib-631ad32b5dbde2bff2d935669c66ca561997b405.tar.zst
nixlib-631ad32b5dbde2bff2d935669c66ca561997b405.zip
pkgs/build-support/cabal: the configure-phase warning check can be
disabled by setting 'strictConfigurePhase' to 'false'

This is necessary for some packages, like dns, because cabal warns about
multiple versions of the same dependency being used, but the usage is fine,
actually, so we want the build to succeed. Packages that depend on 'doctest'
also have this issue <https://github.com/sol/doctest-haskell/issues/69>.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/cabal/default.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix
index bf956f6e553e..6dc83963d19d 100644
--- a/pkgs/build-support/cabal/default.nix
+++ b/pkgs/build-support/cabal/default.nix
@@ -141,6 +141,10 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
             # and run any regression test suites the package might have
             doCheck = enableCheckPhase;
 
+            # abort the build if the configure phase detects that the package
+            # depends on multiple versions of the same build input
+            strictConfigurePhase = true;
+
             # pass the '--enable-library-vanilla' flag to cabal in the
             # configure stage to enable building shared libraries
             inherit enableStaticLibraries;
@@ -198,11 +202,13 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
               echo "configure flags: $extraConfigureFlags $configureFlags"
               ./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \
                 --libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \
+              ${optionalString self.strictConfigurePhase ''
                 | ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log"
-              if ${gnugrep}/bin/egrep -q '^Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then
-                echo >&2 "*** abort because of serious configure-time warning from Cabal"
-                exit 1
-              fi
+                if ${gnugrep}/bin/egrep -q '^Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then
+                  echo >&2 "*** abort because of serious configure-time warning from Cabal"
+                  exit 1
+                fi
+              ''}
 
               eval "$postConfigure"
             '';