summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Wilson <douglas.wilson@gmail.com>2022-07-27 16:55:57 +0100
committerDouglas Wilson <douglas.wilson@gmail.com>2022-08-03 11:51:07 +0100
commite5365b95e40d06b95dc1f6a682996bf6cf8e8b52 (patch)
tree76f433fa4a7c281afe6cf997473452e7c96d9f32
parent55f8541f6d5cc666d97e02cefacaf6eb4afe7e0d (diff)
downloadhaskell-wip/dougwilson/9.4-custom-makefile-changes.tar.gz
ghc-9.4: make build system: Detect too-new boot compiler and docswip/dougwilson/9.4-custom-makefile-changes
-rw-r--r--configure.ac4
-rw-r--r--ghc.mk21
2 files changed, 25 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3d3b53b2a3..fa0cc77351 100644
--- a/configure.ac
+++ b/configure.ac
@@ -230,6 +230,10 @@ MinBootGhcVersion="9.0"
FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[$MinBootGhcVersion],
[AC_MSG_ERROR([GHC version $MinBootGhcVersion or later is required to compile GHC.])])
+# See Note [Support for building ghc 9.4 with the make build system]
+FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[9.1],
+ [AC_SUBST([CanBootWithMake],"YES")])
+
if test `expr $GhcMinVersion % 2` = "1"
then
if test "$EnableBootstrapWithDevelSnaphost" = "NO"
diff --git a/ghc.mk b/ghc.mk
index 51f79c9d2a..476dfe520a 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -100,6 +100,24 @@ else
$(error Make has restarted itself $(MAKE_RESTARTS) times; is there a makefile bug? See https://gitlab.haskell.org/ghc/ghc/wikis/building/troubleshooting#make-has-restarted-itself-3-times-is-there-a-makefile-bug for details)
endif
+##################################################
+# {- Note [Support for building ghc 9.4 with the make build system] -}
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# For ghc-9.6 and forward we will be removing the make build system in favour of
+# the in-tree hadrian build system. However for ghc-9.4 we do still support
+# make. This support is fragile, and we do recommend that you build with
+# hadrian if you are able to do so. The blog post
+# https://www.haskell.org/ghc/blog/20220805-make-to-hadrian.html gives advice to
+# packagers adapting to hadrian.
+#
+# There are several hacks in place to allow ghc-9.4 to build with make:
+# * We require a boot compiler < ghc-9.2. See issue #21914
+# * We carefully build stage0 Cabal with the boot compiler's process library,
+# which does not satisfy Cabal's bounds. See issue #21953
+ifneq "$(CanBootWithMake)" "YES"
+$(error The make build system requires a boot compiler older than ghc-9.2. Your boot compiler is too new and cannot be used to build ghc-9.4 with make. Either boot with ghc 9.0.2 or build with hadrian. See https://www.haskell.org/ghc/blog/20220805-make-to-hadrian.html for advice on transitioning to hadrian.)
+endif
+
# -----------------------------------------------------------------------------
# Misc GNU make utils
@@ -484,6 +502,9 @@ libraries/template-haskell_CONFIGURE_OPTS += --flags=+vendor-filepath
libraries/ghc-bignum_CONFIGURE_OPTS += -f $(BIGNUM_BACKEND)
+# See Note [Support for building ghc 9.4 with the make build system]
+# Here we carefully configure stage0 Cabal to build with the boot compiler's
+# process, which does not satisfy Cabal's bounds.
CABAL_DEPS = text transformers mtl parsec Cabal/Cabal-syntax
CABAL_BOOT_DEPS = process array filepath base bytestring containers deepseq time unix pretty directory