Skip to content

Commit

Permalink
haskell: extend generic builder to recognize mis-configured Cabal 2.x…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
peti committed Dec 30, 2017
1 parent a05d950 commit 016aa58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 016aa58

Please sign in to comment.