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>.
This commit is contained in:
Peter Simons 2013-12-26 20:14:31 +01:00
parent 6ea52bf49a
commit 631ad32b5d

View File

@ -141,6 +141,10 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
# and run any regression test suites the package might have # and run any regression test suites the package might have
doCheck = enableCheckPhase; 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 # pass the '--enable-library-vanilla' flag to cabal in the
# configure stage to enable building shared libraries # configure stage to enable building shared libraries
inherit enableStaticLibraries; inherit enableStaticLibraries;
@ -198,11 +202,13 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
echo "configure flags: $extraConfigureFlags $configureFlags" echo "configure flags: $extraConfigureFlags $configureFlags"
./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \ ./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \
--libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \ --libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \
${optionalString self.strictConfigurePhase ''
| ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log" | ${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 '^Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then
echo >&2 "*** abort because of serious configure-time warning from Cabal" echo >&2 "*** abort because of serious configure-time warning from Cabal"
exit 1 exit 1
fi fi
''}
eval "$postConfigure" eval "$postConfigure"
''; '';