From ee9ecae821665a7d9f2c8629264614a8d42c1b5d Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sun, 9 May 2010 17:50:51 +0000 Subject: [PATCH] Add version constraints for the boot packages; fixes trac #3852 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 | 2 ++ rules/build-package-data.mk | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/ghc.mk b/ghc.mk index b070777..159f15e 100644 --- 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" diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk index 88e2c63..5882e89 100644 --- a/rules/build-package-data.mk +++ b/rules/build-package-data.mk @@ -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. -- 1.7.10.4