Cabal-1.4: library-dirs and include-dirs missing from package description after install

I'm trying to build and install Takusen 0.8.2 with a new .cabal and Setup, using Cabal-1.4.0.0. The Setup program writes out an updated Takusen.buildinfo (below) from the postConf hook. However, the library-dirs and include-dirs fields are not included in the package description when installed. Any ideas as to what I'm doing wrong? Alistair --------------- Takusen.buildinfo --------------------- buildable: True build-tools: odbcconf -any, sqlplus -any, pg_config -any, sqlite3 -any cpp-options: cc-options: ld-options: --enable-stdcall-fixup pkgconfig-depends: frameworks: c-sources: extensions: CPP extra-libraries: odbc32 oci pq sqlite3 extra-lib-dirs: "C:\\Program Files\\sqlite3\\" C:/PROGRA~1/POSTGR~1/8.1/lib C:\oracle\product\10.2.0\client_1\bin includes: install-includes: include-dirs: "C:\\Program Files\\sqlite3\\" C:/PROGRA~1/POSTGR~1/8.1/include C:/PROGRA~1/POSTGR~1/8.1/include/server C:\oracle\product\10.2.0\client_1\oci\include hs-source-dirs: . other-modules: Database.InternalEnumerator ghc-prof-options: -prof -auto-all ghc-shared-options: -prof -auto-all ghc-options: hugs-options: nhc98-options: jhc-options: ------------------------------------------------------------------------ ghc-pkg describe Takusen-0.8.2: name: Takusen version: 0.8.2 license: BSD3 copyright: 2003-2008, Alistair Bayley, Oleg Kiselyov maintainer: alistair@abayley.org, oleg@pobox.com stability: experimental homepage: http://darcs.haskell.org/takusen package-url: http://darcs.haskell.org/takusen description: Takusen is a DBMS access library. ... <trimmed> category: Database author: Alistair Bayley, Oleg Kiselyov exposed: True exposed-modules: Database.ODBC.Enumerator Database.ODBC.OdbcFunctions Database.Oracle.Enumerator Database.Oracle.OCIConstants Database.Oracle.OCIFunctions Database.PostgreSQL.Enumerator Database.PostgreSQL.PGFunctions Database.Sqlite.Enumerator Database.Sqlite.SqliteFunctions Database.Enumerator Database.Util Database.Stub.Enumerator Control.Exception.MonadIO Foreign.C.UTF8 hidden-modules: Database.InternalEnumerator import-dirs: "C:\\Program Files\\Haskell\\Takusen-0.8.2\\ghc-6.8.1" library-dirs: "C:\\Program Files\\Haskell\\Takusen-0.8.2\\ghc-6.8.1" hs-libraries: HSTakusen-0.8.2 extra-libraries: odbc32 oci pq sqlite3 extra-ghci-libraries: include-dirs: includes: depends: base-3.0.0.0 mtl-1.1.0.0 old-time-1.0.0.0 time-1.1.2.0 hugs-options: cc-options: ld-options: --enable-stdcall-fixup framework-dirs: frameworks: haddock-interfaces: "C:\\Program Files\\Haskell\\doc\\Takusen-0.8.2\\html\\Takusen.haddock" haddock-html: "C:\\Program Files\\Haskell\\doc\\Takusen-0.8.2\\html"

On Mon, 2008-06-16 at 14:15 +0100, Alistair Bayley wrote:
I'm trying to build and install Takusen 0.8.2 with a new .cabal and Setup, using Cabal-1.4.0.0. The Setup program writes out an updated Takusen.buildinfo (below) from the postConf hook. However, the library-dirs and include-dirs fields are not included in the package description when installed.
Any ideas as to what I'm doing wrong?
I cannot reproduce this problem. It works fine for me. I made a dummy takusen.cabal: name: takusen version: 0 build-type: Configure library -- nothing here and your takusen.buildinfo
--------------- Takusen.buildinfo --------------------- buildable: True build-tools: odbcconf -any, sqlplus -any, pg_config -any, sqlite3 -any cpp-options: cc-options: ld-options: --enable-stdcall-fixup pkgconfig-depends: frameworks: c-sources: extensions: CPP extra-libraries: odbc32 oci pq sqlite3 extra-lib-dirs: "C:\\Program Files\\sqlite3\\" C:/PROGRA~1/POSTGR~1/8.1/lib C:\oracle\product\10.2.0\client_1\bin
I assume you did actually have the above line properly indented. With it as it is you get a parse error when reading in the buildinfo file.
includes: install-includes: include-dirs: "C:\\Program Files\\sqlite3\\" C:/PROGRA~1/POSTGR~1/8.1/include C:/PROGRA~1/POSTGR~1/8.1/include/server C:\oracle\product\10.2.0\client_1\oci\include hs-source-dirs: . other-modules: Database.InternalEnumerator ghc-prof-options: -prof -auto-all ghc-shared-options: -prof -auto-all ghc-options: hugs-options: nhc98-options: jhc-options:
Then I do $ cabal configure $ cabal register --gen-pkg-config and looking at the takusen-0.conf the library-dirs and include-dirs contain all the dirs given in takusen.buildinfo. This is obviously on Windows. On linux it would not work since C:\etc are not absolute paths on unix but they are on Windows. So I'll need more precise details on how to reproduce the problem. Is there a darcs repo I should use? What commands should I use exactly? Duncan

I cannot reproduce this problem. It works fine for me.
I made a dummy takusen.cabal: and your takusen.buildinfo I assume you did actually have the above line properly indented. With it as it is you get a parse error when reading in the buildinfo file.
Yes, cut'n'paste error.
So I'll need more precise details on how to reproduce the problem. Is there a darcs repo I should use? What commands should I use exactly?
I've pushed the current Setup and .cabal to our repo. You can say: darcs get http://darcs.haskell.org/takusen Then do this: ghc --make Setup setup configure -fodbc -fsqlite -fpostgres (note that you need to have these backends on your path; perhaps just -fodbc -fsqlite for you?) setup register --gen-pkg-config I've just done this. Takusen.buildinfo contains: extra-libraries: odbc32 pq sqlite3 extra-lib-dirs: "C:\\Program Files\\sqlite3\\" C:/PROGRA~1/POSTGR~1/8.1/lib includes: install-includes: include-dirs: "C:\\Program Files\\sqlite3\\" C:/PROGRA~1/POSTGR~1/8.1/include C:/PROGRA~1/POSTGR~1/8.1/include/server but Takusen-0.8.2.conf has: import-dirs: "C:\\Program Files\\Haskell\\Takusen-0.8.2\\ghc-6.8.1" library-dirs: "C:\\Program Files\\Haskell\\Takusen-0.8.2\\ghc-6.8.1" hs-libraries: HSTakusen-0.8.2 extra-libraries: odbc32 pq sqlite3 extra-ghci-libraries: include-dirs: includes: Alistair

On Tue, 2008-06-17 at 11:50 +0100, Alistair Bayley wrote:
I've pushed the current Setup and .cabal to our repo. You can say: darcs get http://darcs.haskell.org/takusen
Then do this: ghc --make Setup setup configure -fodbc -fsqlite -fpostgres (note that you need to have these backends on your path; perhaps just -fodbc -fsqlite for you?) setup register --gen-pkg-config
I've just done this. Takusen.buildinfo contains:
extra-libraries: odbc32 pq sqlite3 extra-lib-dirs: "C:\\Program Files\\sqlite3\\" C:/PROGRA~1/POSTGR~1/8.1/lib includes: install-includes: include-dirs: "C:\\Program Files\\sqlite3\\" C:/PROGRA~1/POSTGR~1/8.1/include C:/PROGRA~1/POSTGR~1/8.1/include/server
Ok, so the issue is that only the autoconfUserHooks looks for .buildinfo files. The assumption was that configure scripts would want to write a .buildinfo file while Setup.hs scripts can do it directly without needing to go via any file. However the UserHooks api doesn't make it all that convenient to return an adjusted BuildInfo record. There is: preConf :: Args -> ConfigFlags -> IO HookedBuildInfo, which looks like what you want, but because it runs before configure it doesn't give you access to all the stuff that the configure step does (all the stuff in LocalBuildInfo). So probably the easiest thing to do is to use the autoconfUserHooks anyway and make sure you override postConf otherwise it'll try to find a ./configure script to run. The reason I couldn't reproduce it before of course is that I was making assumptions about what you were doing and using autoconfUserHooks :-) Duncan

2008/6/19 Duncan Coutts
Ok, so the issue is that only the autoconfUserHooks looks for .buildinfo files. The assumption was that configure scripts would want to write a .buildinfo file while Setup.hs scripts can do it directly without needing to go via any file.
So probably the easiest thing to do is to use the autoconfUserHooks anyway and make sure you override postConf otherwise it'll try to find a ./configure script to run.
The reason I couldn't reproduce it before of course is that I was making assumptions about what you were doing and using autoconfUserHooks :-)
Well, partly my fault. I was using defaultUserHooks, but this is now marked as deprecated, so I changed it to simpleUserHooks. Make a change, something breaks, is there a connection? :-) We were always overriding the postConf hook, so using autoconfUserHooks as a defaultUserHooks replacement seems to work. Thanks, Alistair

On Fri, 2008-06-20 at 10:19 +0100, Alistair Bayley wrote:
2008/6/19 Duncan Coutts
: Ok, so the issue is that only the autoconfUserHooks looks for .buildinfo files. The assumption was that configure scripts would want to write a .buildinfo file while Setup.hs scripts can do it directly without needing to go via any file.
So probably the easiest thing to do is to use the autoconfUserHooks anyway and make sure you override postConf otherwise it'll try to find a ./configure script to run.
The reason I couldn't reproduce it before of course is that I was making assumptions about what you were doing and using autoconfUserHooks :-)
Well, partly my fault. I was using defaultUserHooks, but this is now marked as deprecated, so I changed it to simpleUserHooks. Make a change, something breaks, is there a connection? :-)
Yep. defaultUserHooks was completely misleading as it was not the default. (!!?!) Yes, you might reasonably have expected that defaultMain = defaultMainWithHooks defaultUserHooks but no. defaultUserHooks was actually really autoconfUserHooks except that if a ./configure script was not found it did not complain. This caused confusion all round (especially for packages that really did need a ./configure but where ./configure was not executable eg because it was from a darcs repo or because it had to be generated with autoconf).
We were always overriding the postConf hook, so using autoconfUserHooks as a defaultUserHooks replacement seems to work.
Ok. Duncan
participants (2)
-
Alistair Bayley
-
Duncan Coutts