[commit: ghc] master: rts.cabal.in: add more flags to control the extra flavours (for hadrian) (e3355b7)

git at git.haskell.org git at git.haskell.org
Tue Oct 2 14:00:47 UTC 2018


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

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

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

commit e3355b7c5955df8daab0f3fc75fe021f42d21dbb
Author: Alp Mestanogullari <alp at well-typed.com>
Date:   Tue Oct 2 14:46:28 2018 +0200

    rts.cabal.in: add more flags to control the extra flavours (for hadrian)
    
    Summary:
    In order to properly honor the different ways in which the RTS must
    be built by hadrian, and in particular to have fine grained control over that,
    I'm introducing new Cabal flags in rts.cabal[.in]. This should not affect the
    make build system and will only be used and picked up by hadrian, which uses
    Cabal directly to operate on cabal packages, including libHSrts.
    
    Reviewers: bgamari, erikd, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, carter
    
    Differential Revision: https://phabricator.haskell.org/D5166


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

e3355b7c5955df8daab0f3fc75fe021f42d21dbb
 rts/rts.cabal.in | 40 ++++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index e09c054..76fd353 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -28,8 +28,17 @@ flag leading-underscore
   default: @CabalLeadingUnderscore@
 flag smp
   default: True
+-- Some cabal flags used to control the flavours we want to produce
+-- for libHSrts in hadrian. By default, we just produce vanilla and
+-- threaded. The flags "compose": if you enable debug and profiling,
+-- you will produce vanilla, _thr, _debug, _p but also _thr_p,
+-- _thr_debug_p and so on.
 flag profiling
   default: False
+flag debug
+  default: False
+flag logging
+  default: False
 
 library
     -- rts is a wired in package and
@@ -40,25 +49,24 @@ library
       extra-bundled-libraries: Cffi-6
     else
       extra-bundled-libraries: Cffi
-    -- the rts comes in a variety of flavours that ar built outside
-    -- of cabal.  The combination of extra-bundled-libraries and
-    -- extra-library-flavours results in the following libraries to
-    -- be copied:
-    -- libHSrts-1.0_debug libHSrts-1.0_l libHSrts-1.0_p
-    -- libHSrts-1.0_thr libHSrts-1.0_thr_debug libHSrts-1.0_thr_l
-    -- libHSrts-1.0_thr_p
-    -- 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
 
     -- The make build system does something special in config.mk.in
-    -- 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
-    -- several profiling-enabled flavours to be available when passing the
-    -- 'profiling' flag when configuring the RTS from hadrian, using Cabal.
+    -- for generating profiled, debugged, etc 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 several
+    -- flavours to be available when passing the suitable (combination of)
+    -- flag(s) when configuring the RTS from hadrian, using Cabal.
+    extra-library-flavours: _thr
+
     if flag(profiling)
-      extra-library-flavours: _p _thr_p _debug_p _thr_debug_p
+      extra-library-flavours: _p _thr_p
+      if flag(debug)
+        extra-library-flavours: _debug_p _thr_debug_p
+    if flag(debug)
+      extra-library-flavours: _debug _thr_debug
+    if flag(logging)
+      extra-library-flavours: _l _thr_l
 
     exposed: True
     exposed-modules:



More information about the ghc-commits mailing list