From 7d577eb8227be980330bf220bc58217e898398d8 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 24 Dec 2013 17:49:48 +0100 Subject: [PATCH] build-support/cabal: recognize the "this package indirectly depends on multiple versions of the same package" warning from Cabal and abort the build if it occurs. --- pkgs/build-support/cabal/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index d99faf41f88..b98fef27ecb 100644 --- a/pkgs/build-support/cabal/default.nix +++ b/pkgs/build-support/cabal/default.nix @@ -1,6 +1,7 @@ # generic builder for Cabal packages { stdenv, fetchurl, lib, pkgconfig, ghc, Cabal, jailbreakCabal, glibcLocales +, gnugrep, coreutils , enableLibraryProfiling ? false , enableSharedLibraries ? false , enableSharedExecutables ? false @@ -188,7 +189,13 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version; done echo "configure flags: $extraConfigureFlags $configureFlags" - ./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' --libsubdir='$pkgid' $extraConfigureFlags $configureFlags + ./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \ + --libsubdir='$pkgid' $extraConfigureFlags $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 + echo >&2 "*** abort because of serious configure-time warning from Cabal" + exit 1 + fi eval "$postConfigure" '';