diff --git a/cabal.project.local.travis b/cabal.project.local.travis
new file mode 100644
index 0000000000000000000000000000000000000000..31f8bf09018970d2ab9f4750197b3d925caf1bf7
--- /dev/null
+++ b/cabal.project.local.travis
@@ -0,0 +1,20 @@
+-- Force error messages to be better
+-- Parallel new-build error messages are non-existent.
+-- Turn off parallelization to get good errors.
+jobs: 1
+
+-- We vendor a copy of hackage-repo-tool so that we can
+-- build it reliably.  If we eventually get new-install
+-- in the bootstrap, this can go away.
+optional-packages: hackage-repo-tool-*/
+-- hackage-repo-tool has upper bound on time
+allow-newer: hackage-repo-tool:time
+
+-- The -fno-warn-orphans is a hack to make Cabal-1.24
+-- build properly (unfortunately the flags here get applied
+-- to the dependencies too!)
+package Cabal
+  ghc-options: -Werror -fno-warn-orphans
+
+package cabal-install
+  ghc-options: -Werror
diff --git a/cabal.project.travis.libonly b/cabal.project.travis.libonly
new file mode 100644
index 0000000000000000000000000000000000000000..6cc029bd1d5c825c9ce1339d93cd2390158f3de8
--- /dev/null
+++ b/cabal.project.travis.libonly
@@ -0,0 +1,24 @@
+-- A copy of cabal.project, but with a trimmed down 'packages'
+-- field. Needed for LIB_ONLY configurations that can't build cabal-install,
+-- only lib:Cabal.
+
+packages: Cabal/ cabal-testsuite/
+
+-- Uncomment to allow picking up extra local unpacked deps:
+--optional-packages: */
+
+program-options
+  -- So us hackers get all the assertion failures early:
+  --
+  -- NOTE: currently commented out, see
+  -- https://github.com/haskell/cabal/issues/3911
+  --
+  -- ghc-options: -fno-ignore-asserts
+  --
+  -- as a workaround we specify it for each package individually:
+package Cabal
+  ghc-options: -fno-ignore-asserts
+package cabal-testsuite
+  ghc-options: -fno-ignore-asserts
+package cabal-install
+  ghc-options: -fno-ignore-asserts
diff --git a/travis-script.sh b/travis-script.sh
index a2fa2455ab6d50b000383553cd8121bf8ae5a7f1..80724b6c23d4e843c2188fd05eebf0937731529f 100755
--- a/travis-script.sh
+++ b/travis-script.sh
@@ -82,10 +82,13 @@ timed cabal update
 # ---------------------------------------------------------------------
 
 make cabal-install-monolithic
-cp cabal.project.travis cabal.project.local
+if [ "x$CABAL_LIB_ONLY" = "xYES" ]; then
+    cp cabal.project.travis.libonly cabal.project
+fi
+cp cabal.project.local.travis cabal.project.local
 
 # hackage-repo-tool is a bit touchy to install on GHC 8.0, so instead we
-# do it via new-build.  See also cabal.project.travis.  The downside of
+# do it via new-build.  See also cabal.project.local.travis.  The downside of
 # doing it this way is that the build product cannot be cached, but
 # hackage-repo-tool is a relatively small package so it's good.
 timed cabal unpack hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}