From 0c06eaca884d2e2606cc7ccb0726fdb520164b5d Mon Sep 17 00:00:00 2001 From: Andrey Mokhov Date: Fri, 29 Jan 2016 01:07:51 +0000 Subject: [PATCH] Build hpc-bin. See #187. --- src/Builder.hs | 2 ++ src/GHC.hs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/Builder.hs b/src/Builder.hs index bfb757f22a..71399a7e05 100644 --- a/src/Builder.hs +++ b/src/Builder.hs @@ -36,6 +36,7 @@ data Builder = Alex | GhcPkg Stage | Haddock | Happy + | Hpc | HsColour | HsCpp | Hsc2Hs @@ -63,6 +64,7 @@ builderProvenance = \case GhcCabalHsColour -> builderProvenance $ GhcCabal GhcPkg stage -> if stage > Stage0 then Just (Stage0, ghcPkg) else Nothing Haddock -> Just (Stage2, haddock) + Hpc -> Just (Stage1, hpcBin) Hsc2Hs -> Just (Stage0, hsc2hs) Unlit -> Just (Stage0, unlit) _ -> Nothing diff --git a/src/GHC.hs b/src/GHC.hs index 7504c275a3..0262243a95 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -112,6 +112,9 @@ programPath stage pkg | pkg `elem` [touchy, unlit] = case stage of Stage0 -> Just $ "inplace/lib/bin" -/- pkgNameString pkg <.> exe _ -> Nothing + | pkg == hpcBin = case stage of + Stage1 -> Just $ inplaceProgram "hpc" + _ -> Nothing | isProgram pkg = case stage of Stage0 -> Just . inplaceProgram $ pkgNameString pkg _ -> Just . installProgram $ pkgNameString pkg