summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-04-20 12:18:20 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-04-25 10:18:17 -0400
commit6c7a49139cf120a9bf9370ff472aa2839b4289c6 (patch)
treecac7b8adad18c3ff47b3efa1e3c7808854fcc37b /hadrian
parent18e5103f0f73570e31421e67e54f1693936f5efd (diff)
downloadhaskell-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 'hadrian')
-rw-r--r--hadrian/src/Packages.hs7
-rw-r--r--hadrian/src/Rules/Test.hs20
-rw-r--r--hadrian/src/Settings/Default.hs2
3 files changed, 8 insertions, 21 deletions
diff --git a/hadrian/src/Packages.hs b/hadrian/src/Packages.hs
index 9ca18f14c3..d1b49c35b1 100644
--- a/hadrian/src/Packages.hs
+++ b/hadrian/src/Packages.hs
@@ -5,7 +5,7 @@ module Packages (
checkExact, countDeps,
compareSizes, compiler, containers, deepseq, deriveConstants, directory,
exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh,
- ghcCompact, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline,
+ ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline,
hsc2hs, hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, iservProxy,
libffi, libiserv, mtl, parsec, pretty, primitive, process, remoteIserv, rts,
runGhc, stm, templateHaskell, terminfo, text, time, timeout, touchy,
@@ -37,7 +37,7 @@ ghcPackages =
[ array, base, binary, bytestring, cabalSyntax, cabal, checkPpr, checkExact, countDeps
, compareSizes, compiler, containers, deepseq, deriveConstants, directory
, exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh
- , ghcCompact, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs
+ , ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs
, hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, libffi, libiserv, mtl
, parsec, pretty, process, rts, runGhc, stm, templateHaskell
, terminfo, text, time, touchy, transformers, unlit, unix, win32, xhtml
@@ -53,7 +53,7 @@ isGhcPackage = (`elem` ghcPackages)
array, base, binary, bytestring, cabalSyntax, cabal, checkPpr, checkExact, countDeps,
compareSizes, compiler, containers, deepseq, deriveConstants, directory,
exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh,
- ghcCompact, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs,
+ ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs,
hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, iservProxy, remoteIserv, libffi, libiserv, mtl,
parsec, pretty, primitive, process, rts, runGhc, stm, templateHaskell,
terminfo, text, time, touchy, transformers, unlit, unix, win32, xhtml,
@@ -84,6 +84,7 @@ ghcBignum = lib "ghc-bignum"
ghcBoot = lib "ghc-boot"
ghcBootTh = lib "ghc-boot-th"
ghcCompact = lib "ghc-compact"
+ghcConfig = prg "ghc-config" `setPath` "testsuite/ghc-config"
ghcHeap = lib "ghc-heap"
ghci = lib "ghci"
ghciWrapper = prg "ghci-wrapper" `setPath` "driver/ghci"
diff --git a/hadrian/src/Rules/Test.hs b/hadrian/src/Rules/Test.hs
index f7d3a6c883..a1bc0612ef 100644
--- a/hadrian/src/Rules/Test.hs
+++ b/hadrian/src/Rules/Test.hs
@@ -21,12 +21,6 @@ import Utilities
import Context.Type
import qualified System.Directory as IO
-ghcConfigHsPath :: FilePath
-ghcConfigHsPath = "testsuite/mk/ghc-config.hs"
-
-ghcConfigProgPath :: FilePath
-ghcConfigProgPath = "test/bin/ghc-config" <.> exe
-
checkPprProgPath, checkPprSourcePath :: FilePath
checkPprProgPath = "test/bin/check-ppr" <.> exe
checkPprSourcePath = "utils/check-ppr/Main.hs"
@@ -109,13 +103,6 @@ testRules = do
testsuiteDeps
- -- Using program shipped with testsuite to generate ghcconfig file.
- root -/- ghcConfigProgPath %> \_ -> do
- ghc0Path <- getCompilerPath "stage0"
- -- Invoke via bash to work around #17362.
- -- Reasons why this is required are not entirely clear.
- cmd ["bash"] ["-c", ghc0Path ++ " " ++ ghcConfigHsPath ++ " -o " ++ (root -/- ghcConfigProgPath)]
-
-- we need to create wrappers to test the stage1 compiler
-- as the stage1 compiler needs the stage2 libraries
-- to have any hope of passing tests.
@@ -179,11 +166,10 @@ testRules = do
ghcPath <- getCompilerPath testGhc
whenJust (stageOf testGhc) $ \stg ->
need . (:[]) =<< programPath (Context stg ghc vanilla)
+ ghcConfigProgPath <- programPath =<< programContext Stage0 ghcConfig
cwd <- liftIO $ IO.getCurrentDirectory
- need [makeRelative cwd ghcPath]
- need [root -/- ghcConfigProgPath]
- cmd [FileStdout $ root -/- ghcConfigPath] (root -/- ghcConfigProgPath)
- [ghcPath]
+ need [makeRelative cwd ghcPath, ghcConfigProgPath]
+ cmd [FileStdout $ root -/- ghcConfigPath] ghcConfigProgPath [ghcPath]
root -/- timeoutPath %> \_ -> timeoutProgBuilder
diff --git a/hadrian/src/Settings/Default.hs b/hadrian/src/Settings/Default.hs
index 5e2c5f54f7..3b3498461c 100644
--- a/hadrian/src/Settings/Default.hs
+++ b/hadrian/src/Settings/Default.hs
@@ -157,7 +157,7 @@ stage2Packages = stage1Packages
-- | Packages that are built only for the testsuite.
testsuitePackages :: Action [Package]
-testsuitePackages = return ([ timeout | windowsHost ] ++ [ checkPpr, checkExact, countDeps ])
+testsuitePackages = return ([ timeout | windowsHost ] ++ [ checkPpr, checkExact, countDeps, ghcConfig ])
-- | Default build ways for library packages:
-- * We always build 'vanilla' way.