[commit: ghc] master: rts.cabal.in: advertise profiling flavours of libraries, behind a flag (0c2350c)

git at git.haskell.org git at git.haskell.org
Thu Feb 15 07:27:32 UTC 2018


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

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

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

commit 0c2350c293b82e4cb24a66e00b904933bdb1c8f3
Author: Alp Mestanogullari <alp at well-typed.com>
Date:   Thu Feb 15 15:23:01 2018 +0800

    rts.cabal.in: advertise profiling flavours of libraries, behind a flag
    
    The make build system appears to be doing a bit of magic in order to supply
    the profiled flavours of libHSrts and libCffi, as they're not advertised in
    the 'extra-library-flavours' field of rts.cabal.in. This patch explicitly
    advertises _p and _thr_p flavours of the RTS library and libCffi, but only
    when the RTS is configured with the (newly introduced) 'profiling' flag.
    
    This is necessary for Hadrian, as a branch (soon to be merged) does away with
    ghc-cabal and relies just on Cabal to get package information. Without this
    patch, Cabal can never inform us that _p and _thr_p flavours should be
    built (and registered in the package db) as well, which obviously prevents us
    from building a profiled GHC.
    
    Reviewers: bgamari, erikd, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4409


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

0c2350c293b82e4cb24a66e00b904933bdb1c8f3
 rts/rts.cabal.in | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index a895c9c..67fb9c5 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -26,6 +26,8 @@ flag leading-underscore
   default: @CabalLeadingUnderscore@
 flag smp
   default: True
+flag profiling
+  default: False
 
 library
     -- rts is a wired in package and
@@ -43,7 +45,16 @@ library
     -- libCffi_debug libCffi_ libCffi_l libCffi_p
     -- libCffi_thr libCffi_thr_debug libCffi_thr_l libCffi_thr_p
     extra-library-flavours: _debug _l _thr _thr_debug _thr_l
-    -- TODO: _p and _thr_p only if profiling.
+
+    -- The make build system seems to be doing something "magic"/special
+    -- for generating profiled builds of those libraries, but we need to
+    -- be transparent for hadrian which gets information about the rts
+    -- "package" through Cabal and this cabal file. We therefore declare
+    -- two profiling-enabled flavours to be available when passing the
+    -- 'profiling' flag when configuring the RTS from hadrian, using Cabal.
+    if flag(profiling)
+      extra-library-flavours: _p _thr_p
+
     exposed: True
     exposed-modules:
     if flag(libm)



More information about the ghc-commits mailing list