[Hackage] #89: Sharing of object files between executable builds?

Hackage trac at galois.com
Mon Mar 10 00:59:59 EDT 2008

#89: Sharing of object files between executable builds?
  Reporter:  bjorn at bringert.net     |        Owner:        
      Type:  enhancement            |       Status:  new   
  Priority:  low                    |    Milestone:        
 Component:  Cabal library          |      Version:        
  Severity:  minor                  |   Resolution:        
  Keywords:  jgoerzen at complete.org  |   Difficulty:  normal
Ghcversion:  6.4.2                  |     Platform:  Linux 
Comment (by guest):

 I'd mention that this lack of sharing between sections has bitten me
 recently (as in an error and not an inefficiency sense) while I was
 updating Greencard.

 So the Greencard package provides two main things; it provides a src/
 which contains all sorts of modules which gets compiled down to the
 executable 'greencard-bin', and it provides a library, Foreign.Greencard,
 which naturally requires Greencard to be compiled.

 The makefile accomplishes this by building greencard-bin in place in src/,
 and then running something like ../src/greencard-bin on the lib/ files.
 Everything comes out hunky-dory. But when put into Cabal format, it needs
 to be split between Executable and Library sections. So, suppose someone
 goes to install a Cabalized greencard. (This means no greencard is
 installed.) Cabal begins the configuration. It detects that no greencard
 is accessible - 'No greencard found'. It's otherwise happy, and it begins
 chasing down the files. Everything in 'Executable greencard'? Good. .lhs
 and .hs files, no sweat. Everything in 'Library'? Uh oh! This
 'lib/Foreign/GreenCard.gc', it requires 'greencard'!

 And the build barfs. Which is silly, since it could and would be able to
 build the greencard necessary for the library!

 I think I'm going to have split greencard up, and have a greencard and
 greencard-lib, making greencard-lib depend on greencard. This was the
 solution I used the last time I encountered a problem like this...


Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/89#comment:4>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list