Add version constraints for the boot packages; fixes trac #3852
authorIan Lynagh <igloo@earth.li>
Sun, 9 May 2010 17:50:51 +0000 (17:50 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 9 May 2010 17:50:51 +0000 (17:50 +0000)
When using the bootstrapping compiler, we now explicitly constrain
the version of boot packages (Cabal, extensible-exceptions, etc) to the
in-tree version, so that the build system is less fragile should the
user have a newer version installed for the bootstrapping compiler.

ghc.mk
rules/build-package-data.mk

diff --git a/ghc.mk b/ghc.mk
index b070777..159f15e 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -356,6 +356,8 @@ endif
 # so we don't have to include it below.
 BOOT_PKGS = Cabal hpc extensible-exceptions binary bin-package-db
 
+BOOT_PKG_CONSTRAINTS := $(foreach p,$(BOOT_PKGS),--constraint "$p == $(shell grep -i "^Version:" libraries/$p/$p.cabal | sed "s/[^0-9.]//g")")
+
 # The actual .a and .so/.dll files: needed for dependencies.
 ALL_STAGE1_LIBS  = $(foreach lib,$(PACKAGES),$(libraries/$(lib)_dist-install_v_LIB))
 ifeq "$(BuildSharedLibs)" "YES"
index 88e2c63..5882e89 100644 (file)
@@ -42,6 +42,10 @@ ifneq "$$(ICONV_LIB_DIRS)" ""
 $1_$2_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="$$(ICONV_LIB_DIRS)"
 endif
 
+ifeq "$3" "0"
+$1_$2_CONFIGURE_OPTS += $$(BOOT_PKG_CONSTRAINTS)
+endif
+
 # This rule configures the package, generates the package-data.mk file
 # for our build system, and registers the package for use in-place in
 # the build tree.