Paths module in package description or not?

Consider http://code.haskell.org/mohws/mohws.cabal When I include Paths_mohws as Other-Modules, 'cabal haddock' aborts with: thielema@euler:~/programming/haskell/mohws> cabal haddock Preprocessing library mohws-0.2.0.1... Preprocessing executables for mohws-0.2.0.1... Running Haddock for mohws-0.2.0.1... Warning: The documentation for the following packages are not installed. No links will be generated to these packages: rts-1.0 Preprocessing library mohws-0.2.0.1... Preprocessing executables for mohws-0.2.0.1... cabal: can't find source for module Paths_mohws When I remove Paths_mohws from Other-Modules then the library and executables in the package can be built successfully. But when I compile an executable outside the package, then I get a linker error: parallelweb> cabal install Resolving dependencies... Configuring parallelweb-0.0.2... Preprocessing executables for parallelweb-0.0.2... Building parallelweb-0.0.2... Linking dist/build/parallelweb/parallelweb ... /home/thielema/.cabal/lib/mohws-0.2.0.1/ghc-6.10.3/libHSmohws-0.2.0.1.a(Configuration.o): In function `sfyj_info': (.text+0x2d1f): undefined reference to `mohwszm0zi2zi0zi1_Pathszumohws_a7_closure' /home/thielema/.cabal/lib/mohws-0.2.0.1/ghc-6.10.3/libHSmohws-0.2.0.1.a(Configuration.o): In function `seCS_info': (.text+0x86bb): undefined reference to `__stginit_mohwszm0zi2zi0zi1_Pathszumohws_' collect2: ld returned 1 exit status cabal: Error: some packages failed to install: parallelweb-0.0.2 failed during the building phase. The exception was: exit: ExitFailure 1 I use: $ cabal --version cabal-install version 0.6.0 using version 1.6.0.1 of the Cabal library Which way is the intended one? Include Paths_mohws in package description or not? In general, shall automatically generated files appear in Cabal file? I think they should not, since they are not part of the distribution tarball. So can I consider the linker error being a bug?

On Mon, 2009-05-25 at 10:40 +0200, Henning Thielemann wrote:
Consider http://code.haskell.org/mohws/mohws.cabal
When I include Paths_mohws as Other-Modules, 'cabal haddock' aborts with:
[..]
Which way is the intended one? Include Paths_mohws in package description or not?
You should include it in the package description. The bug was fixed in Cabal-1.6.0.2 (which is included with ghc-6.10.2).
In general, shall automatically generated files appear in Cabal file? I think they should not, since they are not part of the distribution tarball.
The source files are generated but the modules are part of the package. If they were not mentioned in the package description then there would be no way to say if they were exposed or not (though usually nobody would want to expose the Paths module).
So can I consider the linker error being a bug?
Well, only in the sense that it'd be nice if you got a better error message at an earlier stage, like Cabal telling you that your package description is incomplete because the package uses a module that's not mentioned in the .cabal file. Duncan
participants (2)
-
Duncan Coutts
-
Henning Thielemann