[Git][ghc/ghc][master] Hadrian: don't accept p_dyn for executables, to fix --flavour=prof

Marge Bot gitlab at gitlab.haskell.org
Sun Apr 14 13:07:43 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
1825f50d by Alp Mestanogullari at 2019-04-14T13:01:38Z
Hadrian: don't accept p_dyn for executables, to fix --flavour=prof

- - - - -


2 changed files:

- hadrian/src/Settings.hs
- hadrian/src/Settings/Flavours/Profiled.hs


Changes:

=====================================
hadrian/src/Settings.hs
=====================================
@@ -60,10 +60,14 @@ programContext :: Stage -> Package -> Action Context
 programContext stage pkg = do
     profiled <- ghcProfiled <$> flavour
     dynGhcProgs <- dynamicGhcPrograms =<< flavour
-    return . Context stage pkg . wayFromUnits . concat $
-        [ [ Profiling  | pkg == ghc && profiled && stage > Stage0 ]
-        , [ Dynamic    | dynGhcProgs && stage > Stage0 ]
-        ]
+    return $ Context stage pkg (wayFor profiled dynGhcProgs)
+
+    where wayFor prof dyn
+            | prof && dyn                          =
+                error "programContext: profiling+dynamic not supported"
+            | pkg == ghc && prof && stage > Stage0 = profiling
+            | dyn && stage > Stage0                = dynamic
+            | otherwise                            = vanilla
 
 -- TODO: switch to Set Package as the order of packages should not matter?
 -- Otherwise we have to keep remembering to sort packages from time to time.


=====================================
hadrian/src/Settings/Flavours/Profiled.hs
=====================================
@@ -10,7 +10,8 @@ profiledFlavour :: Flavour
 profiledFlavour = defaultFlavour
     { name        = "prof"
     , args        = defaultBuilderArgs <> profiledArgs <> defaultPackageArgs
-    , ghcProfiled = True }
+    , ghcProfiled = True
+    , dynamicGhcPrograms = pure False }
 
 profiledArgs :: Args
 profiledArgs = sourceArgs SourceArgs



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/1825f50d1736401724ef644e4d481cc26e8f47e5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/1825f50d1736401724ef644e4d481cc26e8f47e5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190414/15cfe7fc/attachment-0001.html>


More information about the ghc-commits mailing list