diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-04-20 12:18:20 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-25 10:18:17 -0400 |
commit | 6c7a49139cf120a9bf9370ff472aa2839b4289c6 (patch) | |
tree | cac7b8adad18c3ff47b3efa1e3c7808854fcc37b /testsuite | |
parent | 18e5103f0f73570e31421e67e54f1693936f5efd (diff) | |
download | haskell-6c7a49139cf120a9bf9370ff472aa2839b4289c6.tar.gz |
testsuite: Cabalify ghc-config
To ensure that the build benefits from Hadrian's usual logic for building
packages, avoiding #21409.
Closes #21409.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/ghc-config/ghc-config.cabal | 11 | ||||
-rw-r--r-- | testsuite/ghc-config/ghc-config.hs (renamed from testsuite/mk/ghc-config.hs) | 1 | ||||
-rw-r--r-- | testsuite/mk/boilerplate.mk | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/testsuite/ghc-config/ghc-config.cabal b/testsuite/ghc-config/ghc-config.cabal new file mode 100644 index 0000000000..017cbea8de --- /dev/null +++ b/testsuite/ghc-config/ghc-config.cabal @@ -0,0 +1,11 @@ +cabal-version: 2.4 +name: ghc-config +version: 0.1.0.0 +synopsis: A utility used by GHC's testsuite driver to extract information from @ghc --info@. +author: The GHC Developers +maintainer: ghc-devs@haskell.org + +executable ghc-config + main-is: ghc-config.hs + build-depends: base, process + default-language: Haskell2010 diff --git a/testsuite/mk/ghc-config.hs b/testsuite/ghc-config/ghc-config.hs index f12b579e8d..efb88f81f2 100644 --- a/testsuite/mk/ghc-config.hs +++ b/testsuite/ghc-config/ghc-config.hs @@ -2,6 +2,7 @@ import System.Environment import System.Process import Data.Maybe +main :: IO () main = do [ghc] <- getArgs diff --git a/testsuite/mk/boilerplate.mk b/testsuite/mk/boilerplate.mk index df1b835b0c..8ce5dafb7b 100644 --- a/testsuite/mk/boilerplate.mk +++ b/testsuite/mk/boilerplate.mk @@ -246,7 +246,7 @@ endif # the results, and emits a little .mk file with make bindings for the values. # This way we cache the results for different values of $(TEST_HC) -$(TOP)/mk/ghc-config : $(TOP)/mk/ghc-config.hs +$(TOP)/ghc-config/ghc-config : $(TOP)/ghc-config/ghc-config.hs "$(TEST_HC)" --make -o $@ $< empty= @@ -254,8 +254,8 @@ space=$(empty) $(empty) ifeq "$(ghc_config_mk)" "" ghc_config_mk = $(TOP)/mk/ghcconfig$(subst $(space),_,$(subst :,_,$(subst /,_,$(subst \,_,$(TEST_HC))))).mk -$(ghc_config_mk) : $(TOP)/mk/ghc-config - $(TOP)/mk/ghc-config "$(TEST_HC)" >"$@"; if [ "$$?" != "0" ]; then $(RM) "$@"; exit 1; fi +$(ghc_config_mk) : $(TOP)/ghc-config/ghc-config + $(TOP)/ghc-config/ghc-config "$(TEST_HC)" >"$@"; if [ "$$?" != "0" ]; then $(RM) "$@"; exit 1; fi # If the ghc-config fails, remove $@, and fail endif |