[commit: ghc] master: hadrian: build ghc-iserv-dyn (89fa34e)

git at git.haskell.org git at git.haskell.org
Wed Nov 14 14:46:00 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/89fa34ecd326de879145e6d854306eb17722bf6c/ghc

>---------------------------------------------------------------

commit 89fa34ecd326de879145e6d854306eb17722bf6c
Author: David Eichmann <EichmannD at gmail.com>
Date:   Wed Nov 14 15:43:57 2018 +0100

    hadrian: build ghc-iserv-dyn
    
    ... in addition to ghc-iserv and ghc-iserv-prof, as it is required
    to get 10+ tests to pass
    
    Reviewers: bgamari, alpmestan
    
    Reviewed By: alpmestan
    
    Subscribers: alpmestan, rwbarton, carter
    
    Differential Revision: https://phabricator.haskell.org/D5327


>---------------------------------------------------------------

89fa34ecd326de879145e6d854306eb17722bf6c
 hadrian/src/Packages.hs      | 12 ++++++++----
 hadrian/src/Rules/Program.hs | 23 +++++++++++++----------
 hadrian/src/Rules/Test.hs    |  2 +-
 3 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/hadrian/src/Packages.hs b/hadrian/src/Packages.hs
index 4ce1a2c..24f5690 100644
--- a/hadrian/src/Packages.hs
+++ b/hadrian/src/Packages.hs
@@ -139,10 +139,14 @@ programName Context {..} = do
     return $ prefix ++ case package of
                               p | p == ghc    -> "ghc"
                                 | p == hpcBin -> "hpc"
-                                | p == iserv  ->
-                                    if Profiling `wayUnit` way
-                                      then "ghc-iserv-prof"
-                                      else "ghc-iserv"
+                                | p == iserv  -> "ghc-iserv" ++ concat [
+                                    if wayUnit' `wayUnit` way
+                                        then suffix
+                                        else ""
+                                    | (wayUnit', suffix) <- [
+                                        (Profiling, "-prof"),
+                                        (Dynamic,   "-dyn")
+                                    ]]
                               _               -> pkgName package
 
 -- | The 'FilePath' to a program executable in a given 'Context'.
diff --git a/hadrian/src/Rules/Program.hs b/hadrian/src/Rules/Program.hs
index 7128a75..aeed026 100644
--- a/hadrian/src/Rules/Program.hs
+++ b/hadrian/src/Rules/Program.hs
@@ -29,18 +29,21 @@ buildProgram rs = do
             let allPackages = sPackages
                            ++ if stage == Stage1 then tPackages else []
             nameToCtxList <- fmap concat . forM allPackages $ \pkg -> do
-                -- the iserv pkg results in two different programs at
-                -- the moment, ghc-iserv (built the vanilla way)
-                -- and ghc-iserv-prof (built the profiling way), and
-                -- the testsuite requires both to be present, so we
+                -- the iserv pkg results in three different programs at
+                -- the moment, ghc-iserv (built the vanilla way),
+                -- ghc-iserv-prof (built the profiling way), and
+                -- ghc-iserv-dyn (built the dynamic way).
+                -- The testsuite requires all to be present, so we
                 -- make sure that we cover these
                 -- "prof-build-under-other-name" cases.
-                -- iserv gets its two names from Packages.hs:programName
-                let ctxV = vanillaContext stage pkg
-                    ctxProf = Context stage pkg profiling
-                nameV <- programName ctxV
-                nameProf <- programName ctxProf
-                return [ (nameV <.> exe, ctxV), (nameProf <.> exe, ctxProf) ]
+                -- iserv gets its names from Packages.hs:programName
+                let allCtxs = [ vanillaContext stage pkg
+                              , Context stage pkg profiling
+                              , Context stage pkg dynamic
+                              ]
+                forM allCtxs $ \ctx -> do
+                    name <- programName ctx
+                    return (name <.> exe, ctx)
 
             case lookup (takeFileName bin) nameToCtxList of
                 Nothing -> error $ "Unknown program " ++ show bin
diff --git a/hadrian/src/Rules/Test.hs b/hadrian/src/Rules/Test.hs
index 6a02ce6..de73390 100644
--- a/hadrian/src/Rules/Test.hs
+++ b/hadrian/src/Rules/Test.hs
@@ -106,7 +106,7 @@ timeoutProgBuilder = do
 needIservBins :: Action ()
 needIservBins =
     need =<< traverse programPath
-      [ Context Stage1 iserv w | w <- [vanilla, profiling] ]
+      [ Context Stage1 iserv w | w <- [vanilla, profiling, dynamic] ]
 
 needTestBuilders :: Action ()
 needTestBuilders = do



More information about the ghc-commits mailing list