summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/cabal/default.nix15
-rw-r--r--pkgs/build-support/fetchsvn/builder.sh2
2 files changed, 15 insertions, 2 deletions
diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix
index cfa6175744f5..6dc83963d19d 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
@@ -140,6 +141,10 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
             # and run any regression test suites the package might have
             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
             # configure stage to enable building shared libraries
             inherit enableStaticLibraries;
@@ -195,7 +200,15 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
               ''}
 
               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 \
+              ${optionalString self.strictConfigurePhase ''
+                | ${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"
             '';
diff --git a/pkgs/build-support/fetchsvn/builder.sh b/pkgs/build-support/fetchsvn/builder.sh
index 68dce2cc585b..3ab6e730a51b 100644
--- a/pkgs/build-support/fetchsvn/builder.sh
+++ b/pkgs/build-support/fetchsvn/builder.sh
@@ -22,7 +22,7 @@ fi;
 # server's certificate.  This is perfectly safe: we don't care
 # whether the server is being spoofed --- only the cryptographic
 # hash of the output matters. Pass in extra p's to handle redirects.
-printf 'p\np\np\n' | svn export ${ignoreExternals:+--ignore-externals} \
+printf 'p\np\np\n' | svn export --trust-server-cert --non-interactive ${ignoreExternals:+--ignore-externals} \
     -r "$rev" "$url" "$out"
 
 stopNest