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

Hackage trac at galois.com
Tue Jun 24 19:52:12 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 duncan):

 Replying to [comment:3 claus]:
 > Thanks, that works! But since `Paths_p` was generated behind my back, it
 seems odd that I have to list it myself, especially since a non-empty
 `data-files` field makes no sense at all without it (no dependency chasing
 needed for this one).

 Well yes and no. There has always been the requirement that packages list
 all the modules they use. Packages can want to use the Paths module even
 if there are no data files and people sometimes install data files without
 needing to find them at runtime in the standard way.

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

 > 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.

 > 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
 determined).

 I don't think this is necessary or necessarily a good idea.

 > Btw, having `--prefix` not apply to all dirs is very counter-intuitive.

 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.

 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.

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


More information about the cabal-devel mailing list