Merge pull request #52257 from shlevy/haskell-allow-inconsistent-dependencies

haskell generic builder: Add flag to allow inconsistent dependencies.
This commit is contained in:
Ryan Mulligan 2018-12-15 14:54:20 -08:00 committed by GitHub
commit 82c5101266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 5 deletions

View File

@ -74,6 +74,10 @@ in
, hardeningDisable ? stdenv.lib.optional (ghc.isHaLVM or false) "all" , hardeningDisable ? stdenv.lib.optional (ghc.isHaLVM or false) "all"
, enableSeparateDataOutput ? false , enableSeparateDataOutput ? false
, enableSeparateDocOutput ? doHaddock , enableSeparateDocOutput ? doHaddock
, # Don't fail at configure time if there are multiple versions of the
# same package in the (recursive) dependencies of the package being
# built. Will delay failures, if any, to compile time.
allowInconsistentDependencies ? false
} @ args: } @ args:
assert editedCabalFile != null -> revision != null; assert editedCabalFile != null -> revision != null;
@ -336,11 +340,12 @@ stdenv.mkDerivation ({
echo configureFlags: $configureFlags echo configureFlags: $configureFlags
${setupCommand} configure $configureFlags 2>&1 | ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log" ${setupCommand} configure $configureFlags 2>&1 | ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log"
${stdenv.lib.optionalString (!allowInconsistentDependencies) ''
if ${gnugrep}/bin/egrep -q -z '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" echo >&2 "*** abort because of serious configure-time warning from Cabal"
exit 1 exit 1
fi fi
''}
export GHC_PACKAGE_PATH="$packageConfDir:" export GHC_PACKAGE_PATH="$packageConfDir:"
runHook postConfigure runHook postConfigure

View File

@ -408,4 +408,11 @@ rec {
*/ */
generateOptparseApplicativeCompletions = commands: pkg: generateOptparseApplicativeCompletions = commands: pkg:
pkgs.lib.foldr generateOptparseApplicativeCompletion pkg commands; pkgs.lib.foldr generateOptparseApplicativeCompletion pkg commands;
# Don't fail at configure time if there are multiple versions of the
# same package in the (recursive) dependencies of the package being
# built. Will delay failures, if any, to compile time.
allowInconsistentDependencies = drv: overrideCabal drv (drv: {
allowInconsistentDependencies = true;
});
} }