git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #52257 from shlevy/haskell-allow-inconsistent-dependencies

haskell generic builder: Add flag to allow inconsistent dependencies.

commit82c510126679d71f41234909848492ec0c6b968c authorRyan Mulligan <ryan@ryantm.com> dateSat 15 Dec 2018, 14:54 (8 years ago) parentc1a263030fb5b0
2 files changed+17−5
pkgs/development/haskell-modules/generic-builder.nix+10−5 pkgs/development/haskell-modules/lib.nix+7
pkgs/development/haskell-modules/generic-builder.nix+10−5
@@ -74,6 +74,10 @@ in
7474, hardeningDisable ? stdenv.lib.optional (ghc.isHaLVM or false) "all"
7575, enableSeparateDataOutput ? false
7676, enableSeparateDocOutput ? doHaddock
77+, # Don't fail at configure time if there are multiple versions of the
78+ # same package in the (recursive) dependencies of the package being
79+ # built. Will delay failures, if any, to compile time.
80+ allowInconsistentDependencies ? false
7781} @ args:
7882
7983assert editedCabalFile != null -> revision != null;
@@ -336,11 +340,12 @@ stdenv.mkDerivation ({
336340
337341 echo configureFlags: $configureFlags
338342 ${setupCommand} configure $configureFlags 2>&1 | ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log"
339− if ${gnugrep}/bin/egrep -q -z 'Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then
340− echo >&2 "*** abort because of serious configure-time warning from Cabal"
341− exit 1
342− fi
343−
343+ ${stdenv.lib.optionalString (!allowInconsistentDependencies) ''
344+ if ${gnugrep}/bin/egrep -q -z 'Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then
345+ echo >&2 "*** abort because of serious configure-time warning from Cabal"
346+ exit 1
347+ fi
348+ ''}
344349 export GHC_PACKAGE_PATH="$packageConfDir:"
345350
346351 runHook postConfigure
pkgs/development/haskell-modules/lib.nix+7
@@ -408,4 +408,11 @@ rec {
408408 */
409409 generateOptparseApplicativeCompletions = commands: pkg:
410410 pkgs.lib.foldr generateOptparseApplicativeCompletion pkg commands;
411+
412+ # Don't fail at configure time if there are multiple versions of the
413+ # same package in the (recursive) dependencies of the package being
414+ # built. Will delay failures, if any, to compile time.
415+ allowInconsistentDependencies = drv: overrideCabal drv (drv: {
416+ allowInconsistentDependencies = true;
417+ });
411418}