Commit 7c9b541f authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fix the build when the bootstrapping compiler has a newer Cabal than us

We need to forcibly use the in-tree Cabal, or we get version mismatch errors
parent a54b5fa2
......@@ -120,9 +120,6 @@ ifeq "$(ghc_ge_605)" "NO"
CABAL_GHC_FLAGS += -cpp
endif
# Euch, hideous hack:
CABAL_VERSION = $(shell grep "^Version:" Cabal/Cabal.cabal | sed -e "s/^Version: //" -e 's/\./,/g')
BOOTSTRAPPING_FLAGS = $(CABAL_GHC_FLAGS) -DCABAL_VERSION=$(CABAL_VERSION) -odir $(HERE_ABS)/bootstrapping -hidir $(HERE_ABS)/bootstrapping -i$(HERE_ABS)/Cabal -i$(HERE_ABS)/filepath -i$(HERE_ABS)/hpc
.PHONY: boot
......
nothing=
space=$(nothing) $(nothing)
comma=,
GHC_PKG_INSTALL_PROG = $(FPTOOLS_TOP_ABS)/utils/ghc-pkg/dist-install/build/ghc-pkg/ghc-pkg
......@@ -11,6 +12,11 @@ INSTALL_PACKAGE = \
$(UTILS_ABS)/installPackage/install-inplace/bin/installPackage
STAGE3_PACKAGE_CONF = $(FPTOOLS_TOP_ABS)/stage3.package.conf
# Euch, hideous hack:
CABAL_DOTTED_VERSION = $(shell grep "^Version:" $(LIBRARIES_ABS)/Cabal/Cabal.cabal | sed "s/^Version: //")
CABAL_VERSION = $(subst .,$(comma),$(CABAL_DOTTED_VERSION))
CABAL_CONSTRAINT = --constraint="Cabal == $(CABAL_DOTTED_VERSION)"
# We rely on all the CONFIGURE_ARGS being quoted with '...', and there
# being no 's inside the values.
FLAGGED_CONFIGURE_ARGS = $(subst $(space)',\
......
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment