[Hackage] #788: Optionally exposed modules / APIs should be banned

Hackage cvs-ghc at haskell.org
Tue Jan 11 02:38:23 CET 2011

#788: Optionally exposed modules / APIs should be banned
  Reporter:  duncan         |        Owner:         
      Type:  defect         |       Status:  new    
  Priority:  normal         |    Milestone:         
 Component:  Cabal library  |      Version:
  Severity:  normal         |     Keywords:         
Difficulty:  unknown        |   Ghcversion:         
  Platform:                 |  
 It is a deliberate decision that packages cannot depend on package + flag
 combinations, only on packages. The point is that flags are not supposed
 to change the API of a package.

 This needs to be enforced.

 Consider a real example (from Chart package:
   if flag(gtk)
     build-depends: gtk >= 0.9.11
     exposed-modules: Graphics.Rendering.Chart.Gtk
 The criterion package depends on Chart and imports
 `Graphics.Rendering.Chart.Gtk` meaning that it breaks if you build Chart
 with the gtk flag turned off.

 The solution is that Chart should be prevented from conditionally exposing
 modules. We should add a QA check that looks for exposed modules that are
 conditional on a flag. It is annoying but somewhat less bad for modules to
 change between platforms.

 Should it be a hard failure or just a warning?

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/788>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list