summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-09-27 15:22:37 -0400
committerBen Gamari <ben@smart-cactus.org>2017-09-27 17:37:29 -0400
commit1e9f90af7311c33de0f7f5b7dba594725596d675 (patch)
tree705865c81d93f3084934825917eadb4e42296fac
parent4364f1e7543b6803cfaef321105d253e0bdf08a4 (diff)
downloadhaskell-1e9f90af7311c33de0f7f5b7dba594725596d675.tar.gz
Move check-ppr and check-api-annotations to testsuite/utils
These are needed by the testsuite and consequently must be shipped in the testsuite tarball to ensure that we can test binary distributions. See #13897. Test Plan: Validate Reviewers: austin Subscribers: snowleopard, rwbarton, thomie GHC Trac Issues: #13897 Differential Revision: https://phabricator.haskell.org/D4039
-rw-r--r--.gitignore1
-rw-r--r--Makefile10
-rw-r--r--ghc.mk34
-rw-r--r--testsuite/utils/check-api-annotations/Main.hs (renamed from utils/check-api-annotations/Main.hs)0
-rw-r--r--testsuite/utils/check-api-annotations/README (renamed from utils/check-api-annotations/README)0
-rw-r--r--testsuite/utils/check-api-annotations/check-api-annotations.cabal (renamed from utils/check-api-annotations/check-api-annotations.cabal)0
-rw-r--r--testsuite/utils/check-api-annotations/ghc.mk20
-rw-r--r--testsuite/utils/check-ppr/Main.hs (renamed from utils/check-ppr/Main.hs)0
-rw-r--r--testsuite/utils/check-ppr/README (renamed from utils/check-ppr/README)0
-rw-r--r--testsuite/utils/check-ppr/check-ppr.cabal (renamed from utils/check-ppr/check-ppr.cabal)0
-rw-r--r--testsuite/utils/check-ppr/ghc.mk20
-rw-r--r--utils/check-api-annotations/ghc.mk18
-rw-r--r--utils/check-ppr/ghc.mk18
13 files changed, 76 insertions, 45 deletions
diff --git a/.gitignore b/.gitignore
index 245b2a527d..710c6bfd6f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -76,6 +76,7 @@ _darcs/
/libraries/dist-haddock/
/rts/dist/
/utils/*/dist*/
+/testsuite/utils/*/dist-install/
/compiler/stage1/
/compiler/stage2/
/compiler/stage3/
diff --git a/Makefile b/Makefile
index 8046e36e14..cffd4ec914 100644
--- a/Makefile
+++ b/Makefile
@@ -215,13 +215,17 @@ endif
# out-of-date, it is useful if Phabricator, via a normal `./validate` and `make
# test`, runs each test at least once.
.PHONY: fasttest
-fasttest:
+fasttest: testsuite_utils
$(MAKE) -C testsuite/tests CLEANUP=1 SUMMARY_FILE=../../testsuite_summary.txt fast
.PHONY: test
-test:
+test: testsuite_utils
$(MAKE) -C testsuite/tests CLEANUP=1 SUMMARY_FILE=../../testsuite_summary.txt
.PHONY: slowtest fulltest
-slowtest fulltest:
+slowtest fulltest: testsuite_utils
$(MAKE) -C testsuite/tests CLEANUP=1 SUMMARY_FILE=../../testsuite_summary.txt slow
+
+.PHONY: testsuite_utils
+testsuite_utils:
+ $(MAKE) -f ghc.mk testsuite_utils
diff --git a/ghc.mk b/ghc.mk
index 8918441b83..c3edc5eb1a 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -560,8 +560,8 @@ ghc/stage2/package-data.mk: compiler/stage2/package-data.mk
# all the other libraries' package-data.mk files.
utils/haddock/dist/package-data.mk: compiler/stage2/package-data.mk
utils/ghctags/dist-install/package-data.mk: compiler/stage2/package-data.mk
-utils/check-api-annotations/dist-install/package-data.mk: compiler/stage2/package-data.mk
-utils/check-ppr/dist-install/package-data.mk: compiler/stage2/package-data.mk
+testsuite/utils/check-api-annotations/dist-install/package-data.mk: compiler/stage2/package-data.mk
+testsuite/utils/check-ppr/dist-install/package-data.mk: compiler/stage2/package-data.mk
# add the final package.conf dependency: ghc-prim depends on RTS
libraries/ghc-prim/dist-install/package-data.mk : rts/dist/package.conf.inplace
@@ -684,8 +684,6 @@ BUILD_DIRS += utils/hsc2hs
BUILD_DIRS += utils/ghc-pkg
BUILD_DIRS += utils/testremove
BUILD_DIRS += utils/ghctags
-BUILD_DIRS += utils/check-api-annotations
-BUILD_DIRS += utils/check-ppr
BUILD_DIRS += utils/ghc-cabal
BUILD_DIRS += utils/hpc
BUILD_DIRS += utils/runghc
@@ -695,6 +693,19 @@ BUILD_DIRS += utils/count_lines
BUILD_DIRS += utils/compare_sizes
BUILD_DIRS += iserv
+# If we are in a tree derived from a source tarball the testsuite/ directory may
+# not exist, meaning we can't build the testsuite/utils packages.
+ifeq "$(wildcard testsuite/Makefile)" ""
+HaveTestsuite = NO
+else
+HaveTestsuite = YES
+endif
+
+ifeq "$(HaveTestsuite)" "YES"
+BUILD_DIRS += testsuite/utils/check-api-annotations
+BUILD_DIRS += testsuite/utils/check-ppr
+endif
+
# ----------------------------------------------
# Actually include the sub-ghc.mk's
@@ -734,8 +745,8 @@ ifneq "$(CrossCompiling) $(Stage1Only)" "NO NO"
# See Note [No stage2 packages when CrossCompiling or Stage1Only].
# See Note [Stage1Only vs stage=1] in mk/config.mk.in.
BUILD_DIRS := $(filter-out utils/ghctags,$(BUILD_DIRS))
-BUILD_DIRS := $(filter-out utils/check-api-annotations,$(BUILD_DIRS))
-BUILD_DIRS := $(filter-out utils/check-ppr,$(BUILD_DIRS))
+BUILD_DIRS := $(filter-out testsuite/utils/check-api-annotations,$(BUILD_DIRS))
+BUILD_DIRS := $(filter-out testsuite/utils/check-ppr,$(BUILD_DIRS))
endif
endif # CLEANING
@@ -1572,3 +1583,14 @@ phase_0_builds: $(utils/deriveConstants_dist_depfile_c_asm)
.PHONY: phase_1_builds
phase_1_builds: $(PACKAGE_DATA_MKS)
+
+# Various utilities in testsuite/utils which must be built before
+# the testsuite is run.
+.PHONY: testsuite_utils
+testsuite_utils:
+ifeq "$(HaveTestsuite)" "NO"
+ @echo "The testsuite/ directory appears to be unavailable."
+ @echo ""
+ @echo "If this tree is from a source tarball please download and extract"
+ @echo "the corresponding testsuite tarball."
+endif
diff --git a/utils/check-api-annotations/Main.hs b/testsuite/utils/check-api-annotations/Main.hs
index 6b973e12e8..6b973e12e8 100644
--- a/utils/check-api-annotations/Main.hs
+++ b/testsuite/utils/check-api-annotations/Main.hs
diff --git a/utils/check-api-annotations/README b/testsuite/utils/check-api-annotations/README
index fcadc50ff6..fcadc50ff6 100644
--- a/utils/check-api-annotations/README
+++ b/testsuite/utils/check-api-annotations/README
diff --git a/utils/check-api-annotations/check-api-annotations.cabal b/testsuite/utils/check-api-annotations/check-api-annotations.cabal
index 880f4d6603..880f4d6603 100644
--- a/utils/check-api-annotations/check-api-annotations.cabal
+++ b/testsuite/utils/check-api-annotations/check-api-annotations.cabal
diff --git a/testsuite/utils/check-api-annotations/ghc.mk b/testsuite/utils/check-api-annotations/ghc.mk
new file mode 100644
index 0000000000..f2af7d0d2c
--- /dev/null
+++ b/testsuite/utils/check-api-annotations/ghc.mk
@@ -0,0 +1,20 @@
+# -----------------------------------------------------------------------------
+#
+# (c) 2009 The University of Glasgow
+#
+# This file is part of the GHC build system.
+#
+# To understand how the build system works and how to modify it, see
+# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
+# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
+#
+# -----------------------------------------------------------------------------
+
+testsuite/utils/check-api-annotations_USES_CABAL = YES
+testsuite/utils/check-api-annotations_PACKAGE = check-api-annotations
+testsuite/utils/check-api-annotations_dist-install_PROGNAME = check-api-annotations
+testsuite/utils/check-api-annotations_dist-install_INSTALL = NO
+testsuite/utils/check-api-annotations_dist-install_INSTALL_INPLACE = YES
+$(eval $(call build-prog,testsuite/utils/check-api-annotations,dist-install,2))
+
+testsuite_utils: $(testsuite/utils/check-api-annotations_dist-install_INPLACE)
diff --git a/utils/check-ppr/Main.hs b/testsuite/utils/check-ppr/Main.hs
index a5aeee2f1d..a5aeee2f1d 100644
--- a/utils/check-ppr/Main.hs
+++ b/testsuite/utils/check-ppr/Main.hs
diff --git a/utils/check-ppr/README b/testsuite/utils/check-ppr/README
index f9b502e4a7..f9b502e4a7 100644
--- a/utils/check-ppr/README
+++ b/testsuite/utils/check-ppr/README
diff --git a/utils/check-ppr/check-ppr.cabal b/testsuite/utils/check-ppr/check-ppr.cabal
index 584558b3ff..584558b3ff 100644
--- a/utils/check-ppr/check-ppr.cabal
+++ b/testsuite/utils/check-ppr/check-ppr.cabal
diff --git a/testsuite/utils/check-ppr/ghc.mk b/testsuite/utils/check-ppr/ghc.mk
new file mode 100644
index 0000000000..62b8de6505
--- /dev/null
+++ b/testsuite/utils/check-ppr/ghc.mk
@@ -0,0 +1,20 @@
+# -----------------------------------------------------------------------------
+#
+# (c) 2009 The University of Glasgow
+#
+# This file is part of the GHC build system.
+#
+# To understand how the build system works and how to modify it, see
+# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
+# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
+#
+# -----------------------------------------------------------------------------
+
+testsuite/utils/check-ppr_USES_CABAL = YES
+testsuite/utils/check-ppr_PACKAGE = check-ppr
+testsuite/utils/check-ppr_dist-install_PROGNAME = check-ppr
+testsuite/utils/check-ppr_dist-install_INSTALL = NO
+testsuite/utils/check-ppr_dist-install_INSTALL_INPLACE = YES
+$(eval $(call build-prog,testsuite/utils/check-ppr,dist-install,2))
+
+testsuite_utils: $(testsuite/utils/check-ppr_dist-install_INPLACE)
diff --git a/utils/check-api-annotations/ghc.mk b/utils/check-api-annotations/ghc.mk
deleted file mode 100644
index 61f896d3d7..0000000000
--- a/utils/check-api-annotations/ghc.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-# -----------------------------------------------------------------------------
-#
-# (c) 2009 The University of Glasgow
-#
-# This file is part of the GHC build system.
-#
-# To understand how the build system works and how to modify it, see
-# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
-# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
-#
-# -----------------------------------------------------------------------------
-
-utils/check-api-annotations_USES_CABAL = YES
-utils/check-api-annotations_PACKAGE = check-api-annotations
-utils/check-api-annotations_dist-install_PROGNAME = check-api-annotations
-utils/check-api-annotations_dist-install_INSTALL = NO
-utils/check-api-annotations_dist-install_INSTALL_INPLACE = YES
-$(eval $(call build-prog,utils/check-api-annotations,dist-install,2))
diff --git a/utils/check-ppr/ghc.mk b/utils/check-ppr/ghc.mk
deleted file mode 100644
index 189b447171..0000000000
--- a/utils/check-ppr/ghc.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-# -----------------------------------------------------------------------------
-#
-# (c) 2009 The University of Glasgow
-#
-# This file is part of the GHC build system.
-#
-# To understand how the build system works and how to modify it, see
-# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
-# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
-#
-# -----------------------------------------------------------------------------
-
-utils/check-ppr_USES_CABAL = YES
-utils/check-ppr_PACKAGE = check-ppr
-utils/check-ppr_dist-install_PROGNAME = check-ppr
-utils/check-ppr_dist-install_INSTALL = NO
-utils/check-ppr_dist-install_INSTALL_INPLACE = YES
-$(eval $(call build-prog,utils/check-ppr,dist-install,2))