[commit: ghc] wip/ghc-8.8-merges: Fix hadrian prof flavour so that it builds a profiled version of GHC (49c1f88)

git at git.haskell.org git at git.haskell.org
Thu Feb 21 15:09:04 UTC 2019


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

On branch  : wip/ghc-8.8-merges
Link       : http://ghc.haskell.org/trac/ghc/changeset/49c1f88c850ef0bc2ed8e8eff08e29abd9e73908/ghc

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

commit 49c1f88c850ef0bc2ed8e8eff08e29abd9e73908
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date:   Tue Jan 22 11:33:18 2019 +0000

    Fix hadrian prof flavour so that it builds a profiled version of GHC
    
    In Alp's refactoring of `getProgramContexts` he removed a call to
    `getProgramContext` which was where the logic for this used to be
    implemented.
    
    Fixes #16214


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

49c1f88c850ef0bc2ed8e8eff08e29abd9e73908
 hadrian/src/Rules/Program.hs | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/hadrian/src/Rules/Program.hs b/hadrian/src/Rules/Program.hs
index c9df6f5..d7bcb48 100644
--- a/hadrian/src/Rules/Program.hs
+++ b/hadrian/src/Rules/Program.hs
@@ -13,6 +13,7 @@ import Settings
 import Settings.Default
 import Target
 import Utilities
+import Flavour
 
 -- | TODO: Drop code duplication
 buildProgramRules :: [(Resource, Int)] -> Rules ()
@@ -44,12 +45,18 @@ getProgramContexts stage = do
     -- make sure that we cover these
     -- "prof-build-under-other-name" cases.
     -- iserv gets its names from Packages.hs:programName
-    let allCtxs = [ vanillaContext stage pkg
+    --
+    profiled <- ghcProfiled <$> flavour
+    let allCtxs =
+          if pkg == ghc && profiled && stage > Stage0
+            then [ Context stage pkg profiling ]
+            else [ vanillaContext stage pkg
                   , Context stage pkg profiling
                   -- TODO Dynamic way has been reverted as the dynamic build is
                   --      broken. See #15837.
                   -- , Context stage pkg dynamic
-                  ]
+                 ]
+
     forM allCtxs $ \ctx -> do
       name <- programName ctx
       return (name <.> exe, ctx)



More information about the ghc-commits mailing list