
#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.
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
Good, looking forward to it! 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 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
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
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, 3.2)". Perhaps it would be useful to distinguish `extra-files` from `data-files`? 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. 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