Building haddock when accessing data files from package code

Hi all, When creating a cabal package that contains module that import Paths_<mybraryname> (as tutored in http://www.haskell.org/cabal/release/latest/doc/users-guide/authors.html#pat...), haddock complains that it cannot find such module, since it is generated automatically by cabal: $ runhaskell Setup.lhs haddock ... Setup.lhs: can't find source for module Paths_GHood How do I tell haddock to ignore such module? Should this be handled in the Setup.lhs file? I am using the default Simple file. Thanks in advance, hugo -- www.di.uminho.pt/~hpacheco

On Fri, 2008-11-28 at 11:59 +0000, Hugo Pacheco wrote:
Hi all,
When creating a cabal package that contains module that import Paths_<mybraryname> (as tutored in http://www.haskell.org/cabal/release/latest/doc/users-guide/authors.html#pat...), haddock complains that it cannot find such module, since it is generated automatically by cabal:
$ runhaskell Setup.lhs haddock ... Setup.lhs: can't find source for module Paths_GHood
How do I tell haddock to ignore such module? Should this be handled in the Setup.lhs file? I am using the default Simple file.
The bug is that these auto-generated modules are not generated as part of the haddock command. The workaround is to build first. The ticket is: http://hackage.haskell.org/trac/hackage/ticket/396 It should be a simple fix for a new Cabal hacker. Now is a good chance to get involved! :-) Duncan

I don't know if I got the ideia.I have always built before and always got
the error:
$ runhaskell Setup.lhs configure
$ runhaskell Setup.lhs build
$ runhaskell Setup.lhs haddock
..
Setup.lhs: can't find source for module Paths_module
Thanks,
hugo
On Fri, Nov 28, 2008 at 2:17 PM, Duncan Coutts
On Fri, 2008-11-28 at 11:59 +0000, Hugo Pacheco wrote:
Hi all,
When creating a cabal package that contains module that import Paths_<mybraryname> (as tutored in http://www.haskell.org/cabal/release/latest/doc/users-guide/authors.html#pat...), haddock complains that it cannot find such module, since it is generated automatically by cabal:
$ runhaskell Setup.lhs haddock ... Setup.lhs: can't find source for module Paths_GHood
How do I tell haddock to ignore such module? Should this be handled in the Setup.lhs file? I am using the default Simple file.
The bug is that these auto-generated modules are not generated as part of the haddock command. The workaround is to build first. The ticket is:
http://hackage.haskell.org/trac/hackage/ticket/396
It should be a simple fix for a new Cabal hacker. Now is a good chance to get involved! :-)
Duncan
-- www.di.uminho.pt/~hpacheco

On Fri, 2008-11-28 at 14:25 +0000, Hugo Pacheco wrote:
I don't know if I got the ideia. I have always built before and always got the error:
$ runhaskell Setup.lhs configure $ runhaskell Setup.lhs build $ runhaskell Setup.lhs haddock .. Setup.lhs: can't find source for module Paths_module
Ok, that is supposed to work. We'll need more details, eg the Cabal lib version and the .cabal file you're using. There was a bug in this area in Cabal-1.4.x: http://hackage.haskell.org/trac/hackage/ticket/187 Duncan

Well, I am using
cabal-install version 0.6.0
using version 1.6.0.1 of the Cabal library
The suggested trick (adding dist/build/autogen to Hs-Source-Dirs) solved the
problem.
Here goes the important part of my .cabal file:
Data-files: GHood.jar Build-type: Simple Cabal-Version: >=1.2 Flag splitBase
Description: Choose the new smaller, split-up base package. Library
Hs-Source-Dirs: src, dist/build/autogen Build-Depends: base, haskell98 if
flag(splitBase) Build-Depends: base >= 3, array >= 0.1, pretty >= 1.0 else
Build-Depends: base < 3 exposed-modules: Debug.Observe other-modules:
Paths_GHood extensions: ScopedTypeVariables Rank2Types TypeSynonymInstances
On Fri, Nov 28, 2008 at 3:37 PM, Duncan Coutts
On Fri, 2008-11-28 at 14:25 +0000, Hugo Pacheco wrote:
I don't know if I got the ideia. I have always built before and always got the error:
$ runhaskell Setup.lhs configure $ runhaskell Setup.lhs build $ runhaskell Setup.lhs haddock .. Setup.lhs: can't find source for module Paths_module
Ok, that is supposed to work. We'll need more details, eg the Cabal lib version and the .cabal file you're using.
There was a bug in this area in Cabal-1.4.x: http://hackage.haskell.org/trac/hackage/ticket/187
Duncan
-- www.di.uminho.pt/~hpacheco

On Tue, 2008-12-02 at 03:15 +0000, Hugo Pacheco wrote:
Well, I am using
cabal-install version 0.6.0 using version 1.6.0.1 of the Cabal library
The suggested trick (adding dist/build/autogen to Hs-Source-Dirs) solved the problem.
If possible would you mind testing the patch that we think fixes this bug: http://hackage.haskell.org/trac/hackage/ticket/396 It's in the development version of Cabal. If it works for you then I'll push it to the Cabal-1.6 branch and it'll appear in Cabal-1.6.0.2. The development version of the Cabal lib lives at: darcs get http://darcs.haskell.org/cabal/ Alternatively if your code is available then I could use that to confirm the fix. Duncan

It worked!
Thanks,
hugo
On Wed, Dec 3, 2008 at 12:25 PM, Duncan Coutts
On Tue, 2008-12-02 at 03:15 +0000, Hugo Pacheco wrote:
Well, I am using
cabal-install version 0.6.0 using version 1.6.0.1 of the Cabal library
The suggested trick (adding dist/build/autogen to Hs-Source-Dirs) solved the problem.
If possible would you mind testing the patch that we think fixes this bug:
http://hackage.haskell.org/trac/hackage/ticket/396
It's in the development version of Cabal. If it works for you then I'll push it to the Cabal-1.6 branch and it'll appear in Cabal-1.6.0.2.
The development version of the Cabal lib lives at: darcs get http://darcs.haskell.org/cabal/
Alternatively if your code is available then I could use that to confirm the fix.
Duncan
-- www.di.uminho.pt/~hpacheco
participants (2)
-
Duncan Coutts
-
Hugo Pacheco