summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-06-22 13:26:28 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2022-07-01 10:21:00 +0100
commit6bbe941b78d476fd10cb56d246fed93866948b05 (patch)
tree0e73bf90998c364aa7722232cdf57325c8b3e88a
parent16b9100c9ef6b34b88a52b3b9e663dd40abd028f (diff)
downloadhaskell-wip/vendor-filepath.tar.gz
Vendor filepath inside template-haskellwip/vendor-filepath
Adding filepath as a dependency of template-haskell means that it can't be reinstalled if any build-plan depends on template-haskell. This is a temporary solution for the 9.4 release. A longer term solution is to split-up the template-haskell package into the wired-in part and a non-wired-in part which can be reinstalled. This was deemed quite risky on the 9.4 release timescale. Fixes #21738
-rw-r--r--ghc.mk4
-rw-r--r--ghc/ghc.mk5
-rw-r--r--hadrian/src/Settings/Packages.hs7
-rw-r--r--libraries/template-haskell/template-haskell.cabal.in21
-rw-r--r--rules/build-package-data.mk8
-rw-r--r--testsuite/tests/driver/T20604/T20604.stdout17
6 files changed, 39 insertions, 23 deletions
diff --git a/ghc.mk b/ghc.mk
index d1ca1bf3e7..a06bd18746 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -478,6 +478,10 @@ libraries/haskeline_CONFIGURE_OPTS += --flags=-examples
# described in #20724.
libraries/text_CONFIGURE_OPTS += --flags=-simdutf
+# Filepath is vendored for template-haskell to avoid making it non-resinstallable.
+# see #21738
+libraries/template-haskell_CONFIGURE_OPTS += --flags=+vendor-filepath
+
libraries/ghc-bignum_CONFIGURE_OPTS += -f $(BIGNUM_BACKEND)
ifeq "$(BIGNUM_BACKEND)" "gmp"
diff --git a/ghc/ghc.mk b/ghc/ghc.mk
index fcfb61f65a..db5efbec96 100644
--- a/ghc/ghc.mk
+++ b/ghc/ghc.mk
@@ -23,11 +23,6 @@ ghc_stage2_CONFIGURE_OPTS += --flags=internal-interpreter
ghc_stage3_CONFIGURE_OPTS += --flags=internal-interpreter
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/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs
index 96c09ba856..aa61147ccd 100644
--- a/hadrian/src/Settings/Packages.hs
+++ b/hadrian/src/Settings/Packages.hs
@@ -13,6 +13,7 @@ packageArgs :: Args
packageArgs = do
stage <- getStage
path <- getBuildPath
+ root <- getBuildRoot
compilerPath <- expr $ buildPath (vanillaContext stage compiler)
let -- Do not bind the result to a Boolean: this forces the configure rule
@@ -211,6 +212,12 @@ packageArgs = do
--------------------------------- hpcBin ----------------------------------
, package hpcBin
? builder (Cabal Flags) ? arg "-build-tool-depends"
+
+ --------------------------------- template-haskell ----------------------------------
+
+ , package templateHaskell
+ ? mconcat [ builder (Cabal Flags) ? notStage0 ? arg "+vendor-filepath"
+ , builder Ghc ? notStage0 ? arg ("-i" <> (root </> pkgPath filepath)) ]
]
ghcBignumArgs :: Args
diff --git a/libraries/template-haskell/template-haskell.cabal.in b/libraries/template-haskell/template-haskell.cabal.in
index 58d0d70d7d..6cbe41fe01 100644
--- a/libraries/template-haskell/template-haskell.cabal.in
+++ b/libraries/template-haskell/template-haskell.cabal.in
@@ -27,6 +27,14 @@ source-repository head
location: https://gitlab.haskell.org/ghc/ghc.git
subdir: libraries/template-haskell
+
+-- We give the option to vendor filepath to avoid making filepath non-reinstallable..
+-- see #21738 for why we are doing this now and what the plan is for the future.
+Flag vendor-filepath
+ Description: Vendor the dependency on filepath
+ Default: False
+ Manual: True
+
Library
default-language: Haskell2010
other-extensions:
@@ -58,9 +66,20 @@ Library
base >= 4.11 && < 4.18,
ghc-boot-th == @ProjectVersionMunged@,
ghc-prim,
- filepath,
pretty == 1.1.*
+ if flag(vendor-filepath)
+ other-modules:
+ System.FilePath
+ System.FilePath.Posix
+ System.FilePath.Windows
+ hs-source-dirs: ../filepath .
+ default-extensions:
+ ImplicitPrelude
+ else
+ build-depends: filepath
+ hs-source-dirs: .
+
ghc-options: -Wall
-- We need to set the unit ID to template-haskell (without a
diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk
index c55cb540ef..a8c9c12823 100644
--- a/rules/build-package-data.mk
+++ b/rules/build-package-data.mk
@@ -132,14 +132,6 @@ $1/$2/build/$$(or $$($1_EXECUTABLE),$$($1_$2_PROGNAME),.)/autogen/cabal_macros.h
# for our build system, and registers the package for use in-place in
# the build tree.
$$($1_$2_PKGDATA) : $$$$(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"
- "$$(ghc-cabal_INPLACE)" check $1
-endif
-endif
"$$(ghc-cabal_INPLACE)" configure $1 $2 --with-ghc="$$($1_$2_HC_CONFIG)" --with-ghc-pkg="$$($1_$2_GHC_PKG)" $$($1_CONFIGURE_OPTS) $$($1_$2_CONFIGURE_OPTS)
ifeq "$$($1_$2_PROG)" ""
$$(call cmd,$1_$2_GHC_PKG) update -v0 --force $$($1_$2_GHC_PKG_OPTS) $1/$2/inplace-pkg-config
diff --git a/testsuite/tests/driver/T20604/T20604.stdout b/testsuite/tests/driver/T20604/T20604.stdout
index 864f215cb3..c44ef21667 100644
--- a/testsuite/tests/driver/T20604/T20604.stdout
+++ b/testsuite/tests/driver/T20604/T20604.stdout
@@ -1,11 +1,10 @@
A1
A
-addDependentFile "/home/matt/ghc-numa/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20220210/libHSghc-prim-0.8.0-ghc9.3.20220210.so" 9f60cabb62a3305daa26440cde34be2b
-addDependentFile "/home/matt/ghc-numa/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20220210/libHSghc-bignum-1.3-ghc9.3.20220210.so" 5da53b9a870ae800132527a10de182ef
-addDependentFile "/home/matt/ghc-numa/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20220210/libHSbase-4.16.0.0-ghc9.3.20220210.so" ed1808d3e2f7368d81345094adfea50f
-addDependentFile "/home/matt/ghc-numa/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20220210/libHSfilepath-1.4.2.1-ghc9.3.20220210.so" 08b9514f12122be71c467bddf9edf99b
-addDependentFile "/home/matt/ghc-numa/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20220210/libHSghc-boot-th-9.3-ghc9.3.20220210.so" 165417fb87110cd768173641e96854d7
-addDependentFile "/home/matt/ghc-numa/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20220210/libHSarray-0.5.4.0-ghc9.3.20220210.so" 267bb3b9d1d59920b08f6d81ddb1f5f4
-addDependentFile "/home/matt/ghc-numa/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20220210/libHSdeepseq-1.4.7.0-ghc9.3.20220210.so" 4d4f1682b257ae7674e1dc6b84f1f8ae
-addDependentFile "/home/matt/ghc-numa/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20220210/libHSpretty-1.1.3.6-ghc9.3.20220210.so" dd0fddaebe5d06357fe1748efefd1705
-addDependentFile "/home/matt/ghc-numa/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20220210/libHStemplate-haskell-2.18.0.0-ghc9.3.20220210.so" 72cdf17fd485c6bb49e684730a0a55b6
+addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSghc-prim-0.8.0-ghc9.5.20220622.so" 3cd9ec17e96be7de19c80aee03da0dad
+addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSghc-bignum-1.3-ghc9.5.20220622.so" 7c71dbe91c74e815aeb4928a4c16fd49
+addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSbase-4.16.0.0-ghc9.5.20220622.so" b1260b12bcd267b0e1a3faf77ede36e4
+addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSghc-boot-th-9.5-ghc9.5.20220622.so" 3eaffd72b71f9ad82898ae3e477f3115
+addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSarray-0.5.4.0-ghc9.5.20220622.so" 580e9d5afc1d691b2dbfe97f9f35dc54
+addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSdeepseq-1.4.7.0-ghc9.5.20220622.so" a31d063d48c6c1c7b10132d56b564497
+addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSpretty-1.1.3.6-ghc9.5.20220622.so" 7d0e89188b10c1de8c2894689ff11cac
+addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHStemplate-haskell-2.18.0.0-ghc9.5.20220622.so" 67d8b5d7026175f7e9b3e214955acc69