summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2021-02-21 21:23:40 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-20 07:48:38 -0400
commit95275a5f25a2e70b71240d4756109180486af1b1 (patch)
treeeb4801bb0e00098b8b9d513479de4fbbd779ddac /hadrian
parentf940fd466a86c2f8e93237b36835797be3f3c898 (diff)
downloadhaskell-95275a5f25a2e70b71240d4756109180486af1b1.tar.gz
GHC Exactprint main commit
Metric Increase: T10370 parsing001 Updates haddock submodule
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Packages.hs7
-rw-r--r--hadrian/src/Rules/BinaryDist.hs4
-rw-r--r--hadrian/src/Rules/Test.hs31
-rw-r--r--hadrian/src/Settings/Builders/Make.hs4
4 files changed, 27 insertions, 19 deletions
diff --git a/hadrian/src/Packages.hs b/hadrian/src/Packages.hs
index a1916b20cd..b107a6e512 100644
--- a/hadrian/src/Packages.hs
+++ b/hadrian/src/Packages.hs
@@ -1,7 +1,8 @@
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module Packages (
-- * GHC packages
- array, base, binary, bytestring, cabal, checkApiAnnotations, checkPpr,
+ array, base, binary, bytestring, cabal, checkPpr,
+ checkExact,
compareSizes, compiler, containers, deepseq, deriveConstants, directory,
exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh,
ghcCompact, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline,
@@ -31,7 +32,7 @@ import Oracles.Setting
-- packages and modify build default build conditions in "UserSettings".
ghcPackages :: [Package]
ghcPackages =
- [ array, base, binary, bytestring, cabal, checkPpr, checkApiAnnotations
+ [ array, base, binary, bytestring, cabal, checkPpr
, compareSizes, compiler, containers, deepseq, deriveConstants, directory
, exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh
, ghcCompact, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs
@@ -50,8 +51,8 @@ base = lib "base"
binary = lib "binary"
bytestring = lib "bytestring"
cabal = lib "Cabal" `setPath` "libraries/Cabal/Cabal"
-checkApiAnnotations = util "check-api-annotations"
checkPpr = util "check-ppr"
+checkExact = util "check-exact"
compareSizes = util "compareSizes" `setPath` "utils/compare_sizes"
compiler = top "ghc" `setPath` "compiler"
containers = lib "containers" `setPath` "libraries/containers/containers"
diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs
index a527664b23..8a4fd2c4ec 100644
--- a/hadrian/src/Rules/BinaryDist.hs
+++ b/hadrian/src/Rules/BinaryDist.hs
@@ -171,8 +171,8 @@ bindistRules = do
-- other machine.
need $ map (bindistFilesDir -/-)
(["configure", "Makefile"] ++ bindistInstallFiles)
- need $ map ((bindistFilesDir -/- "wrappers") -/-) ["check-api-annotations"
- , "check-ppr", "ghc", "ghc-iserv", "ghc-pkg"
+ need $ map ((bindistFilesDir -/- "wrappers") -/-)
+ [ "check-ppr", "check-exact", "ghc", "ghc-iserv", "ghc-pkg"
, "ghci-script", "haddock", "hpc", "hp2ps", "hsc2hs"
, "runghc"]
diff --git a/hadrian/src/Rules/Test.hs b/hadrian/src/Rules/Test.hs
index b1e328368f..43982b9549 100644
--- a/hadrian/src/Rules/Test.hs
+++ b/hadrian/src/Rules/Test.hs
@@ -27,15 +27,20 @@ ghcConfigProgPath = "test/bin/ghc-config" <.> exe
checkPprProgPath, checkPprSourcePath :: FilePath
checkPprProgPath = "test/bin/check-ppr" <.> exe
checkPprSourcePath = "utils/check-ppr/Main.hs"
+checkPprExtra :: Maybe String
+checkPprExtra = Nothing
-checkApiAnnotationsProgPath, checkApiAnnotationsSourcePath :: FilePath
-checkApiAnnotationsProgPath = "test/bin/check-api-annotations" <.> exe
-checkApiAnnotationsSourcePath = "utils/check-api-annotations/Main.hs"
+checkExactProgPath, checkExactSourcePath :: FilePath
+checkExactProgPath = "test/bin/check-exact" <.> exe
+checkExactSourcePath = "utils/check-exact/Main.hs"
+checkExactExtra :: Maybe String
+checkExactExtra = Just "-iutils/check-exact"
-checkPrograms :: [(FilePath, FilePath, Package)]
+
+checkPrograms :: [(FilePath, FilePath, Maybe String, Package)]
checkPrograms =
- [ (checkPprProgPath, checkPprSourcePath, checkPpr)
- , (checkApiAnnotationsProgPath, checkApiAnnotationsSourcePath, checkApiAnnotations)
+ [ (checkPprProgPath, checkPprSourcePath, checkPprExtra, checkPpr)
+ , (checkExactProgPath, checkExactSourcePath, checkExactExtra, checkExact)
]
ghcConfigPath :: FilePath
@@ -53,9 +58,10 @@ testRules = do
-- Reasons why this is required are not entirely clear.
cmd ["bash"] ["-c", ghc0Path ++ " " ++ ghcConfigHsPath ++ " -o " ++ (root -/- ghcConfigProgPath)]
- -- Rules for building check-ppr and check-ppr-annotations with the compiler
- -- we are going to test (in-tree or out-of-tree).
- forM_ checkPrograms $ \(progPath, sourcePath, progPkg) ->
+ -- Rules for building check-ppr, check-exact and
+ -- check-ppr-annotations with the compiler we are going to test
+ -- (in-tree or out-of-tree).
+ forM_ checkPrograms $ \(progPath, sourcePath, mextra, progPkg) ->
root -/- progPath %> \path -> do
need [ sourcePath ]
testGhc <- testCompiler <$> userSetting defaultTestArgs
@@ -79,6 +85,7 @@ testRules = do
cmd [bindir </> "ghc" <.> exe] $
concatMap (\p -> ["-package", pkgName p]) depsPkgs ++
["-o", top -/- path, top -/- sourcePath] ++
+ (maybe [] (\e -> [e]) mextra) ++
-- If GHC is build with debug options, then build check-ppr
-- also with debug options. This allows, e.g., to print debug
-- messages of various RTS subsystems while using check-ppr.
@@ -125,7 +132,8 @@ testRules = do
]
pythonPath <- builderPath Python
- need [ root -/- checkPprProgPath, root -/- checkApiAnnotationsProgPath ]
+ need [ root -/- checkPprProgPath
+ , root -/- checkExactProgPath ]
-- Set environment variables for test's Makefile.
-- TODO: Ideally we would define all those env vars in 'env', so that
@@ -141,8 +149,7 @@ testRules = do
setEnv "TEST_HC_OPTS" ghcFlags
setEnv "TEST_HC_OPTS_INTERACTIVE" ghciFlags
setEnv "CHECK_PPR" (top -/- root -/- checkPprProgPath)
- setEnv "CHECK_API_ANNOTATIONS"
- (top -/- root -/- checkApiAnnotationsProgPath)
+ setEnv "CHECK_EXACT" (top -/- root -/- checkExactProgPath)
-- This lets us bypass the need to generate a config
-- through Make, which happens in testsuite/mk/boilerplate.mk
diff --git a/hadrian/src/Settings/Builders/Make.hs b/hadrian/src/Settings/Builders/Make.hs
index 12f01e7774..9efea20275 100644
--- a/hadrian/src/Settings/Builders/Make.hs
+++ b/hadrian/src/Settings/Builders/Make.hs
@@ -25,13 +25,13 @@ validateBuilderArgs = builder (Make "testsuite/tests") ? do
top <- expr topDirectory
compiler <- expr $ fullpath ghc
checkPpr <- expr $ fullpath checkPpr
- checkApiAnnotations <- expr $ fullpath checkApiAnnotations
+ checkExact <- expr $ fullpath checkExact
args <- expr $ userSetting defaultTestArgs
return [ setTestSpeed $ testSpeed args
, "THREADS=" ++ show threads
, "TEST_HC=" ++ (top -/- compiler)
, "CHECK_PPR=" ++ (top -/- checkPpr)
- , "CHECK_API_ANNOTATIONS=" ++ (top -/- checkApiAnnotations)
+ , "CHECK_EXACT=" ++ (top -/- checkExact)
]
where
fullpath :: Package -> Action FilePath