[Hackage] #306: can't figure out how to use data-files

Hackage trac at galois.com
Wed Jun 25 04:30:57 EDT 2008

#306: can't figure out how to use data-files
  Reporter:  claus          |        Owner:           
      Type:  defect         |       Status:  closed   
  Priority:  normal         |    Milestone:           
 Component:  Cabal library  |      Version:  HEAD     
  Severity:  normal         |   Resolution:  duplicate
  Keywords:                 |   Difficulty:  normal   
Ghcversion:  6.9            |     Platform:           
Comment (by claus):

 > In any case this will all go away once we have dependency chasing. There
 will be no need to specify `other-modules` at all.

 Good, looking forward to it!

 > > I'd suggest to (a) mention this in the user guide
 > Yes, it's not explicitly documented that every module must be listed
 either in exposed-modules or other-modules. So we should add that and at
 the same place point out that this includes modules generated by Cabal if
 the package chooses to use them.

 I was specifically thinking of 3.2, something like: "if your package wants
 to install and use data files, remember to list the files in `data-files`
 and the `Paths_package` module in `other-modules`".

 > > and (b) add `Paths_package` implicitly if the cabal file has `data-
 files` (not much sense giving an error message if the fix is uniquely
 > I don't think this is necessary or necessarily a good idea.

 Okay. In that case I'd suggest issueing a warning "There are `data-files`,
 but `Paths_package` isn't listed in `other-modules` (see user guide,

 Perhaps it would be useful to distinguish `extra-files` from `data-files`?

 > > Btw, having `--prefix` not apply to all dirs is very counter-
 > In most circumstances all the dirs are relative to $prefix however for
 the specific case of data files of packages containing a library and only
 on Windows, the default is not relative to the prefix.

 It being an exception to the rule is exactly why I find it counter-
 intuitive and easy to forget/get wrong.

 > I can't remember exactly why it's this way but I think it's to do with
 relocatable packages and being able to find the data files for libs.
 Libraries with data files cannot be relocatable since we cannot then find
 the files at runtime.

 When you remember the reason, could you please add it to the users guide,
 where `--prefix` is explained?

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

More information about the cabal-devel mailing list