[commit: ghc] master: Hadrian: bump Cabal submodule, install extra dynamic flavours of RTS (fb99716)

git at git.haskell.org git at git.haskell.org
Thu Nov 29 16:16:21 UTC 2018


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

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

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

commit fb9971607c5a41ade71338188c683ee9cb8ca6fc
Author: Alp Mestanogullari <alp at well-typed.com>
Date:   Thu Nov 29 17:14:57 2018 +0100

    Hadrian: bump Cabal submodule, install extra dynamic flavours of RTS
    
    Previously, Hadrian was building all the appropriate dynamic ways for
    libHSrts
    but they were not picked up and installed in the package database when
    we register the rts library. Since we use Cabal for registering
    packages and
    the .cabal files of packages as sources of truth for configuring and
    installing,
    we ended up patching Cabal to add a new field,
    'extra-dynamic-library-flavours',
    to specify those extra flavours to install in .cabal files:
    
        https://github.com/haskell/cabal/pull/5606
    
    We now make use of this in rts.cabal.in to expose dynamic flavours
    behind a
    Cabal flag, which Hadrian will use whenever we are building a GHC
    flavour that
    requires dynamic libraries.
    
    This is all part of a larger plan to build a dynamic stage 2 GHC by
    default,
    like with make, which in turn will fix a lot of test failures. See
    
    Test Plan:
    hadrian/build.sh _build/stage1/lib/package.conf.d/rts-1.0.conf
    _build/stage1/lib/x86_64-.../ should contain many libHSrts-*.so
    
    Reviewers: snowleopard, DavidEichmann, bgamari, erikd, simonmar
    
    Reviewed By: snowleopard, DavidEichmann
    
    Subscribers: rwbarton, carter
    
    GHC Trac Issues: #15837
    
    Differential Revision: https://phabricator.haskell.org/D5385


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

fb9971607c5a41ade71338188c683ee9cb8ca6fc
 hadrian/src/Oracles/Setting.hs   |  2 +-
 hadrian/src/Rules/Library.hs     |  4 ++--
 hadrian/src/Settings/Packages.hs |  1 +
 libraries/Cabal                  |  2 +-
 rts/rts.cabal.in                 | 10 +++++++++-
 5 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs
index 1cdcddf..5197b8e 100644
--- a/hadrian/src/Oracles/Setting.hs
+++ b/hadrian/src/Oracles/Setting.hs
@@ -218,4 +218,4 @@ libsuf way
         extension <- setting DynamicExtension -- e.g., .dll or .so
         version   <- setting ProjectVersion   -- e.g., 7.11.20141222
         let suffix = waySuffix (removeWayUnit Dynamic way)
-        return ("-ghc" ++ version ++ suffix ++ extension)
+        return (suffix ++ "-ghc" ++ version ++ extension)
diff --git a/hadrian/src/Rules/Library.hs b/hadrian/src/Rules/Library.hs
index b53bcc8..334d687 100644
--- a/hadrian/src/Rules/Library.hs
+++ b/hadrian/src/Rules/Library.hs
@@ -134,7 +134,7 @@ data LibA = LibA String [Integer] Way deriving (Eq, Show)
 -- | > <so or dylib>
 data DynLibExt = So | Dylib deriving (Eq, Show)
 
--- | > libHS<pkg name>-<pkg version>-ghc<ghc version>[_<way suffix>].<so or dylib>
+-- | > libHS<pkg name>-<pkg version>[_<way suffix>]-ghc<ghc version>.<so|dylib>
 data LibDyn = LibDyn String [Integer] Way DynLibExt deriving (Eq, Show)
 
 -- | > HS<pkg name>-<pkg version>[_<way suffix>].o
@@ -231,8 +231,8 @@ parseLibDynFilename :: String -> Parsec.Parsec String () LibDyn
 parseLibDynFilename ext = do
     _ <- Parsec.string "libHS"
     (pkgname, pkgver) <- parsePkgId
-    _ <- optional $ Parsec.string "-ghc" *> parsePkgVersion
     way <- addWayUnit Dynamic <$> parseWaySuffix dynamic
+    _ <- optional $ Parsec.string "-ghc" *> parsePkgVersion
     _ <- Parsec.string ("." ++ ext)
     return (LibDyn pkgname pkgver way $ if ext == "so" then So else Dylib)
 
diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs
index 4d75e32..51a980c 100644
--- a/hadrian/src/Settings/Packages.hs
+++ b/hadrian/src/Settings/Packages.hs
@@ -285,6 +285,7 @@ rtsPackageArgs = package rts ? do
           [ any (wayUnit Profiling) rtsWays ? arg "profiling"
           , any (wayUnit Debug) rtsWays ? arg "debug"
           , any (wayUnit Logging) rtsWays ? arg "logging"
+          , any (wayUnit Dynamic) rtsWays ? arg "dynamic"
           ]
         , builder (Cc FindCDependencies) ? cArgs
         , builder (Ghc CompileCWithGhc) ? map ("-optc" ++) <$> cArgs
diff --git a/libraries/Cabal b/libraries/Cabal
index 3da088e..064d9e9 160000
--- a/libraries/Cabal
+++ b/libraries/Cabal
@@ -1 +1 @@
-Subproject commit 3da088e281f5cbc8a731e18ceb698cfea2e45004
+Subproject commit 064d9e9082c825f538655db1868108c48240377e
diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index a20aa57..e9cc7d1 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -1,4 +1,4 @@
-cabal-version: 2.1
+cabal-version: 2.5
 name: rts
 version: 1.0
 license: BSD-3-Clause
@@ -39,6 +39,8 @@ flag debug
   default: False
 flag logging
   default: False
+flag dynamic
+  default: False
 
 library
     -- rts is a wired in package and
@@ -65,8 +67,14 @@ library
         extra-library-flavours: _debug_p _thr_debug_p
     if flag(debug)
       extra-library-flavours: _debug _thr_debug
+      if flag(dynamic)
+        extra-dynamic-library-flavours: _debug _thr_debug
     if flag(logging)
       extra-library-flavours: _l _thr_l
+      if flag(dynamic)
+        extra-dynamic-library-flavours: _l _thr_l
+    if flag(dynamic)
+      extra-dynamic-library-flavours: _thr
 
     exposed: True
     exposed-modules:



More information about the ghc-commits mailing list