[Hackage] #187: Paths_pkgname module is hard to use in a library

#187: Paths_pkgname module is hard to use in a library ------------------------------+--------------------------------------------- Reporter: duncan | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal | Version: 1.2.2.0 Severity: normal | Keywords: Difficulty: easy (<4 hours) | Ghcversion: 6.8.1 Platform: Linux | ------------------------------+--------------------------------------------- Most users of the auto-generated {{{Paths_pkgname}}} module are programs. With GHC at least they can get away with not specifying the {{{Paths_pkgname}}} in the {{{Other-Modules}}} field. Get away with in the sense that it does not lead to linker errors because {{{ghc --make}}} does dependency chasing and links in all the necessary .o files. However for a library you must specify every module in {{{Exposed- Modules}}} or {{{Other-Modules}}} or one does get linker errors when you try to use the packages. That's because the missing module's .o files will not have been included in the library .a archive. See bug #128. So for a library one must specify {{{Other-Modules: Paths_pkgname}}} but then of course Cabal cannot find that module since it is not in the normal source directories but in {{{dist/build/autogen}}}. So people have to hack around it by adding {{{dist/build/autogen}}} to the {{{Hs-Source-Dirs}}} field. Obviously that's rather unsatisfactory. Probably the right solution is for Cabal to automatically add that directory to the end of the source dir search path. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/187 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#187: Paths_pkgname module is hard to use in a library ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: defect | Status: new Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.1 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * platform: Linux => * milestone: => Cabal-1.4 -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/187#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#187: Paths_pkgname module is hard to use in a library
----------------------------+-----------------------------------------------
Reporter: duncan | Owner:
Type: defect | Status: closed
Priority: normal | Milestone: Cabal-1.4
Component: Cabal library | Version: 1.2.2.0
Severity: normal | Resolution: fixed
Keywords: | Difficulty: easy (<4 hours)
Ghcversion: 6.8.1 | Platform:
----------------------------+-----------------------------------------------
Changes (by duncan):
* status: new => closed
* resolution: => fixed
Comment:
Close the right ticket this time...
{{{
Sat Apr 12 22:49:04 CEST 2008 Andres Loeh

#187: Paths_pkgname module is hard to use in a library ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: defect | Status: closed Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: fixed Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.1 | Platform: ----------------------------+----------------------------------------------- Comment (by guest): There's still a problem for sdist: sdist shouldn't care about Paths_pkgname because it's installation dependent, but if you have Paths_pkgname in Other-modules sdist tries to include that module in the tarball, and so fails to create the package because it can't find the file. two ways to solve this might be: (i) add Paths_pkgname automatically during build, install and haddock. (ii) filter Paths_pkgname out in sdist. but maybe the cleanest solution is to have a dedicated field in the package description? -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/187#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#187: Paths_pkgname module is hard to use in a library ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: defect | Status: reopened Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.1 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * status: closed => reopened * resolution: fixed => -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/187#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#187: Paths_pkgname module is hard to use in a library ----------------------------+----------------------------------------------- Reporter: duncan | Owner: Type: defect | Status: closed Priority: normal | Milestone: Cabal-1.4 Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: fixed Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.1 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * status: reopened => closed * resolution: => fixed Comment: Replying to [comment:3 guest]:
two ways to solve this might be: (i) add Paths_pkgname automatically during build, install and haddock. (ii) filter Paths_pkgname out in sdist.
Taking option (ii):
{{{
Thu Jun 12 10:18:10 BST 2008 Duncan Coutts
participants (1)
-
Hackage