From 016aa581a757d468e35a03c6f8a3a0309af95e31 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 29 Dec 2017 19:32:12 +0100 Subject: [PATCH] haskell: extend generic builder to recognize mis-configured Cabal 2.x builds Cabal 1.x says: | Warning: This package indirectly depends on multiple versions of the same | package. This is highly likely to cause a compile failure. But in version 2.x, that warning is split into two lines differently: | Warning: | This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure. This commit modifies the call to "egrep" to recognize both versions by virtue of the "-z" flag, which essentially interprets the whole configure-time output as one long line. --- 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 96de6ab6d3f..c633310a37a 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -276,7 +276,7 @@ stdenv.mkDerivation ({ echo configureFlags: $configureFlags ${setupCommand} configure $configureFlags 2>&1 | ${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 + if ${gnugrep}/bin/egrep -q -z '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