
Hi, the Hackage upload script performs some checks on the packages being uploaded. In my case, a library, I need to use the cabal generated Paths_package file to access some locale data stored in a data file directory. This requires to include in "hs-source-dirs" "dist/build/autogen", which doesn't exist in the source tree, since it's generated by cabal in the build process (the inclusion is made necessary by a bug in Cabal-1.2 which doesn't automatically search dist/build/autogen, see [1]). And so Hackage complains: I needed to manually include such an empty directory in the source code archive. Any way out? TIA Andrea [1] http://www.haskell.org/pipermail/libraries/2008-July/010078.html

On Sat, 2008-09-13 at 20:36 +0200, Andrea Rossato wrote:
Hi,
the Hackage upload script performs some checks on the packages being uploaded. In my case, a library, I need to use the cabal generated Paths_package file to access some locale data stored in a data file directory.
This requires to include in "hs-source-dirs" "dist/build/autogen", which doesn't exist in the source tree, since it's generated by cabal in the build process (the inclusion is made necessary by a bug in Cabal-1.2 which doesn't automatically search dist/build/autogen, see [1]).
Any path in your .cabal file that uses dist/ is wrong. Sorry. The dist path can be changed by the user (--builddir) and its internal layout is not fixed.
And so Hackage complains: I needed to manually include such an empty directory in the source code archive.
Any way out?
I can't think of any other workaround for 1.2 so I think you'll have to require Cabal-1.4 for your package. Duncan

On Sat, Sep 13, 2008 at 08:12:07PM +0100, Duncan Coutts wrote:
Any path in your .cabal file that uses dist/ is wrong. [...] I can't think of any other workaround for 1.2 so I think you'll have to require Cabal-1.4 for your package.
Well, since ghc-6.8.3 comes with Cabal-1.2.4, having a package that works for the great majority of ghc users may be "less wrong" then having a correct cabal package that requires you to upgrade Cabal, in order to get rid of strange and incomprehensible error such as "Unknown symbol" linker complains. Or at least this is what I thought. I believe I can cope with users complaining for unexpected results when --builddir is used. They should be hopefully less, even though I'm not so sure. Correctness seems a minor problem, here. Andrea

Duncan Coutts
I can't think of any other workaround for 1.2 so I think you'll have to require Cabal-1.4 for your package.
Even with 1.4, if I don't give any extra source directory, I get: dhcp-192-157:yi-stable bernardy$ cabal sdist Building source dist for yi-0.4.6.2... Preprocessing library yi-0.4.6.2... cabal: can't find source for Paths_yi in ., dist/src/yi-0.4.6.2/dist/build/autogen Is there something I'm missing? Thanks, -- JP
participants (3)
-
Andrea Rossato
-
Duncan Coutts
-
Jean-Philippe Bernardy