[Hackage] #832: Cabal aggregates dependencies for executables

Hackage cvs-ghc at haskell.org
Mon Apr 18 05:50:29 CEST 2011

#832: Cabal aggregates dependencies for executables
  Reporter:  juhp           |        Owner:          
      Type:  defect         |       Status:  new     
  Priority:  normal         |    Milestone:          
 Component:  Cabal library  |      Version:
  Severity:  normal         |     Keywords:          
Difficulty:  unknown        |   Ghcversion:          
  Platform:                 |  
 I discovered over the weekend while trying to subpackage bluetile,
 that Cabal seems to aggregate dependencies of executables.

 For example
 generates several executables.  Some depend on gtk, others not,
 and yet Cabal passes "--package-id gtk-..." to "ghc --make" for all of
 and as a result the bluetile program (which doesn't depend on gtk)
 gets linked against gtk (and glade), leading to executable/dependency

 Only the executables that are listed with explicit build-depends on gtk
 should be linked against the gtk package, etc.

 I will try to dig into the source later and maybe even cook up
 a patch if I can: a code pointer would be appreciated.
 I assume Cabal is currently just accumulating all the build-depends which
 sub-optimal.  (Arguably ghc shouldn't link unused libraries
 to executables either, though I think that is pretty standard compiler
 behaviour.  But I can file a bug against ghc too if appropriate.)

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

More information about the cabal-devel mailing list