[commit: ghc] master: Build system tweak: Do the package checks at configure time (cdf1655)

Ian Lynagh igloo at earth.li
Sat Feb 16 02:42:18 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/cdf16555ef5e2670a01bb5fa1462e7177b921fe0

>---------------------------------------------------------------

commit cdf16555ef5e2670a01bb5fa1462e7177b921fe0
Author: Ian Lynagh <ian at well-typed.com>
Date:   Fri Feb 15 23:41:21 2013 +0000

    Build system tweak: Do the package checks at configure time
    
    This removes the '.PHONY' rule, so means that "make" in a built tree
    won't repeat the check.
    
    We also now check the .cabal files for the executables as well as the
    libraries.

>---------------------------------------------------------------

 compiler/ghc.mk             |    5 +++++
 ghc.mk                      |   17 -----------------
 ghc/ghc.mk                  |    5 +++++
 rules/build-package-data.mk |    8 ++++++++
 rules/build-package.mk      |    8 --------
 utils/ghc-pkg/ghc-pkg.cabal |    2 +-
 6 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 9621f1d..854b756 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -24,6 +24,11 @@ compiler_stage3_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES
 
 compiler_stage1_C_FILES_NODEPS = compiler/parser/cutils.c
 
+# This package doesn't pass the Cabal checks because include-dirs
+# points outside the source directory. This isn't a real problem, so
+# we just skip the check.
+compiler_NO_CHECK = YES
+
 ifneq "$(BINDIST)" "YES"
 compiler/stage1/package-data.mk : compiler/stage1/build/Config.hs
 compiler/stage2/package-data.mk : compiler/stage2/build/Config.hs
diff --git a/ghc.mk b/ghc.mk
index 8bd7859..3e926dc 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -566,23 +566,6 @@ libraries/dph/dph-lifted-copy_dist-install_EXCLUDED_WAYS := dyn
 libraries/dph/dph-lifted-vseg_dist-install_EXCLUDED_WAYS := dyn
 endif
 
-# ----------------------------------------------
-# Checking packages with 'cabal check'
-
-ifeq "$(phase)" "final"
-ifeq "$(CHECK_PACKAGES)" "YES"
-all: check_packages
-endif
-endif
-
-# These packages don't pass the Cabal checks because hs-source-dirs
-# points outside the source directory. This isn't a real problem in
-# these cases, so we just skip checking them.
-# NB. these must come before we include the ghc.mk files below, because
-# they disable the relevant rules.
-# In compiler's case, include-dirs points outside of the source tree
-CHECKED_compiler = YES
-
 # -----------------------------------------------------------------------------
 # Include build instructions from all subdirs
 
diff --git a/ghc/ghc.mk b/ghc/ghc.mk
index 6df1a50..71356fc 100644
--- a/ghc/ghc.mk
+++ b/ghc/ghc.mk
@@ -31,6 +31,11 @@ ifeq "$(compiler_stage1_VERSION_MUNGED)" "YES"
 ghc_stage1_CONFIGURE_OPTS += --constraint "ghc == $(compiler_stage1_MUNGED_VERSION)"
 endif
 
+# This package doesn't pass the Cabal checks because data-dir
+# points outside the source directory. This isn't a real problem, so
+# we just skip the check.
+ghc_NO_CHECK = YES
+
 ghc_stage1_MORE_HC_OPTS = $(GhcStage1HcOpts)
 ghc_stage2_MORE_HC_OPTS = $(GhcStage2HcOpts)
 ghc_stage3_MORE_HC_OPTS = $(GhcStage3HcOpts)
diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk
index 17def03..7cee00b 100644
--- a/rules/build-package-data.mk
+++ b/rules/build-package-data.mk
@@ -102,6 +102,14 @@ $1/$2/build/autogen/cabal_macros.h : $1/$2/package-data.mk
 # for our build system, and registers the package for use in-place in
 # the build tree.
 $1/$2/package-data.mk : $$(GHC_CABAL_INPLACE) $$($1_$2_GHC_PKG_DEP) $1/$$($1_PACKAGE).cabal $$(wildcard $1/configure) $$(LAX_DEPS_FOLLOW) $$($1_$2_HC_CONFIG_DEP)
+# Checking packages built with the bootstrapping compiler would
+# generally be a waste of time. Either we will rebuild them with
+# stage1/stage2, or we don't really care about them.
+ifneq "$3" "0"
+ifneq "$$($1_NO_CHECK)" "YES"
+	CROSS_COMPILE="$(CrossCompilePrefix)" "$$(GHC_CABAL_INPLACE)" check $1
+endif
+endif
 	CROSS_COMPILE="$(CrossCompilePrefix)" "$$(GHC_CABAL_INPLACE)" configure --with-ghc="$$($1_$2_HC_CONFIG)" --with-ghc-pkg="$$($1_$2_GHC_PKG)" $$($1_CONFIGURE_OPTS) $$($1_$2_CONFIGURE_OPTS) -- $2 $1
 ifeq "$$($1_$2_PROG)" ""
 ifneq "$$($1_$2_REGISTER_PACKAGE)" "NO"
diff --git a/rules/build-package.mk b/rules/build-package.mk
index e64754c..47b706e 100644
--- a/rules/build-package.mk
+++ b/rules/build-package.mk
@@ -137,14 +137,6 @@ ifneq "$$($1_$2_GROUP)" ""
 all_$$($1_$2_GROUP): all_$1_$2
 endif
 
-ifneq "$$(CHECKED_$1)" "YES"
-CHECKED_$1 = YES
-check_packages: check_$1
-.PHONY: check_$1
-check_$1: $$(GHC_CABAL_INPLACE)
-	CROSS_COMPILE="$(CrossCompilePrefix)" $$(GHC_CABAL_INPLACE) check $1
-endif
-
 ifneq "$3" "0"
 $(call haddock,$1,$2)
 endif
diff --git a/utils/ghc-pkg/ghc-pkg.cabal b/utils/ghc-pkg/ghc-pkg.cabal
index e7f1d53..2f42e31 100644
--- a/utils/ghc-pkg/ghc-pkg.cabal
+++ b/utils/ghc-pkg/ghc-pkg.cabal
@@ -11,7 +11,7 @@ Description:
 	XXX
 Category: Development
 build-type: Simple
-cabal-version: >=1.2
+cabal-version: >=1.4
 
 Executable ghc-pkg
     Main-Is: Main.hs





More information about the ghc-commits mailing list