hadrian: build ghc-iserv-dyn
authorDavid Eichmann <EichmannD@gmail.com>
Wed, 14 Nov 2018 14:43:57 +0000 (15:43 +0100)
committerAlp Mestanogullari <alp@well-typed.com>
Wed, 14 Nov 2018 14:43:58 +0000 (15:43 +0100)
... 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

hadrian/src/Packages.hs
hadrian/src/Rules/Program.hs
hadrian/src/Rules/Test.hs

index 4ce1a2c..24f5690 100644 (file)
@@ -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'.
index 7128a75..aeed026 100644 (file)
@@ -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
index 6a02ce6..de73390 100644 (file)
@@ -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