Fix the build when the bootstrapping compiler has a newer Cabal than us
[ghc-hetmet.git] / utils / installPackage / Makefile
index e963060..758442d 100644 (file)
@@ -3,7 +3,11 @@ TOP=../..
 include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/cabal.mk
 
-# We should stop installPackage being installed itself, but we do need
-# to build it with the stage2 compiler as we need to use it when
-# installing.
+# If the bootstrapping compiler already has a newer version of Cabal
+# than the in-tree Cabal, then we need to forcibly use the in-tree one.
+# Otherwise we use one Cabal for some things and the other Cabal for
+# other things, and Cabal (rightly) complains about the version
+# mismatch.
+EXTRA_INPLACE_CONFIGURE_FLAGS += $(CABAL_CONSTRAINT)
+EXTRA_STAGE2_CONFIGURE_FLAGS  += $(CABAL_CONSTRAINT)