HDBC-ODBC build/install problem.

Hi, I am trying to make HaskellDB work with HDBC-ODBC. I did builds of HDBC/HDBC-ODBC. But when I am building HaskellDB-HDBC-ODBC, I get the following message. -------------- "[1 of 1] Compiling Database.HaskellDB.HDBC.ODBC ( Database/HaskellDB/HDBC/ODBC.hs, dist\build/Database/HaskellDB/HDBC/ODBC.o ) C:\Program Files\Haskell\HDBC-odbc-1.1.2.0\ghc-6.6.1/Database/HDBC/ODBC/Connection.hi Declaration for connectODBC: Failed to load interface for `Database.HDBC.ODBC.ConnectionImpl': Use -v to see a list of the files searched for. Cannot continue after interface file error" --------------
From this, I know the problem is the linkage between Database.HDBC.ODBC.Connection and Database.HDBC.ODBC.ConnectionImple. (Also I looked at the code to see the reference.)
I did a little further investigation. I looked at the package registry area (C:\Program Files\Haskell\HDBC-odbc-1.1.2.0\ghc-6.6.1\Database\HDBC\ODBC) and notice that ConnectionImpl.hi is not there. I went back to the build directory and did find ConnectoinImpl.hi and ConnectionImpl.o. It seems like runghc Setup.hs install, did not install ConnectionImpl.hi. I looked into the file named ".installed-pkg-config" and I saw this: ------------ exposed-modules: Database.HDBC.ODBC hidden-modules: Database.HDBC.ODBC.Connection Database.HDBC.ODBC.Statement Database.HDBC.ODBC.Types Database.HDBC.ODBC.Utils Database.HDBC.ODBC.TypeConv import-dirs: "C:\\Program Files\\Haskell\\HDBC-odbc-1.1.2.0\\ghc-6.6.1" library-dirs: "C:\\Program Files\\Haskell\\HDBC-odbc-1.1.2.0\\ghc-6.6.1" hs-libraries: HSHDBC-odbc-1.1.2.0 extra-libraries: odbc32 -------------- No mention of ConnectionImple.hi. It looks like the setup up script did not install ConnectionImpl.hi. Did ConnectionImpl.o get bound into "libHSHDBC-odbc-1.1.2.0.a" even though ConnectionImpl.hi did not get successfully installed? Does anyone know why the install target does not install ConnectionImpl.hi and how I can get around this problem? (Where is the odbc32 to be found anyways?) Here are a few things I did try which did NOT work: 1. Copy ConnectionImpl.hi over manually. HaskellDB-HDBC-ODBC builds, but at runtime there is a link error. 2. Manually alter ".installed-pkg-config" to add ConnectionImpl.hi as hidden module. Please comment on why these would not work ( I will learn from this.) Help would be appreciated. Edward Ing

On Jul 12, 2007, at 23:35 , Edward Ing wrote:
Hi, I am trying to make HaskellDB work with HDBC-ODBC. I did builds of HDBC/HDBC-ODBC. But when I am building HaskellDB-HDBC-ODBC, I get the following message.
-------------- "[1 of 1] Compiling Database.HaskellDB.HDBC.ODBC ( Database/HaskellDB/HDBC/ODBC.hs, dist\build/Database/HaskellDB/HDBC/ODBC.o ) C:\Program Files\Haskell\HDBC-odbc-1.1.2.0\ghc-6.6.1/Database/HDBC/ ODBC/Connection.hi Declaration for connectODBC: Failed to load interface for `Database.HDBC.ODBC.ConnectionImpl': Use -v to see a list of the files searched for. Cannot continue after interface file error" --------------
From this, I know the problem is the linkage between Database.HDBC.ODBC.Connection and Database.HDBC.ODBC.ConnectionImple. (Also I looked at the code to see the reference.)
I did a little further investigation. I looked at the package registry area (C:\Program Files\Haskell\HDBC-odbc-1.1.2.0\ghc-6.6.1\Database\HDBC\ODBC) and notice that ConnectionImpl.hi is not there.
I went back to the build directory and did find ConnectoinImpl.hi and ConnectionImpl.o. It seems like runghc Setup.hs install, did not install ConnectionImpl.hi.
I looked into the file named ".installed-pkg-config" and I saw this:
------------ exposed-modules: Database.HDBC.ODBC hidden-modules: Database.HDBC.ODBC.Connection Database.HDBC.ODBC.Statement Database.HDBC.ODBC.Types Database.HDBC.ODBC.Utils Database.HDBC.ODBC.TypeConv import-dirs: "C:\\Program Files\\Haskell\\HDBC-odbc-1.1.2.0\ \ghc-6.6.1" library-dirs: "C:\\Program Files\\Haskell\\HDBC-odbc-1.1.2.0\ \ghc-6.6.1" hs-libraries: HSHDBC-odbc-1.1.2.0 extra-libraries: odbc32 --------------
No mention of ConnectionImple.hi. It looks like the setup up script did not install ConnectionImpl.hi.
Did ConnectionImpl.o get bound into "libHSHDBC-odbc-1.1.2.0.a" even though ConnectionImpl.hi did not get successfully installed?
Does anyone know why the install target does not install ConnectionImpl.hi and how I can get around this problem?
(Where is the odbc32 to be found anyways?)
Here are a few things I did try which did NOT work:
1. Copy ConnectionImpl.hi over manually. HaskellDB-HDBC-ODBC builds, but at runtime there is a link error.
2. Manually alter ".installed-pkg-config" to add ConnectionImpl.hi as hidden module.
Please comment on why these would not work ( I will learn from this.)
Help would be appreciated.
Hi Edward, the right approach would be to add it to other-modules in HDBC- odbc.cabal file, where it should have been all along. This is a bug in HDBC-odbc, I recommend that you send a patch to the maintainer. Approach 1 doesn't work since that does not include the .o file in the installed .a archive. Approach 2 doesn't work for several reasons, which exactly depend on what else you did, and which .installed-pkg-config file you changed. /Björn

This solved the particular problem as you suggested, but I ran into
other problems and stuck at another one.
So I have another question.
When I am using DBDirect from haskelldb to connect through HDBC-odbc.
I get the following error message (I got pass the compile problems)
"DBDirect.exe: user error (Couldn't load
Database.HaskellDB.HDBC.ODBC.driver from package
haskelldb-hdbc-odbc-0.10)"
I looked into the package directories and the *.o and *.a file is there.
Also I looked into the "installed.pkg-config" file and found.
exposed: True
exposed-modules: Database.HaskellDB.HDBC.ODBC
So it appears to me that Database.HaskellDB.HDBC.ODBC has been
installed properly.
Does the build of DBDirect have to be configured some way? I did not
configure anything for DBDirect.
Has it anything to do with hs-plugins?
Your help would be appreciated.
Edward Ing
On 7/13/07, Bjorn Bringert
On Jul 12, 2007, at 23:35 , Edward Ing wrote:
Hi Edward,
the right approach would be to add it to other-modules in HDBC- odbc.cabal file, where it should have been all along. This is a bug in HDBC-odbc, I recommend that you send a patch to the maintainer.
/Björn

This is probably a HaskellDB or hs-plugins problem. DBDirect uses hs- plugins to load driver modules, and I believe hs-plugins has undergone some changes to work with GHC 6.6.1, which DBDirect might not take into account. I don't use the DBDirect executable myself, since it tends to run into this sort of problems. Instead I write a small wrapper program around the DBDirect API that uses the driver I'm interested in at the moment. If you want to try to fix it, see driver-dynamic/Database/HaskellDB/ DynConnect.hs. My guess is that the loadPackageFunction function there doesn't work with the current hs-plugins. /Björn On Jul 13, 2007, at 17:56 , Edward Ing wrote:
This solved the particular problem as you suggested, but I ran into other problems and stuck at another one. So I have another question.
When I am using DBDirect from haskelldb to connect through HDBC-odbc. I get the following error message (I got pass the compile problems)
"DBDirect.exe: user error (Couldn't load Database.HaskellDB.HDBC.ODBC.driver from package haskelldb-hdbc-odbc-0.10)"
I looked into the package directories and the *.o and *.a file is there. Also I looked into the "installed.pkg-config" file and found.
exposed: True exposed-modules: Database.HaskellDB.HDBC.ODBC
So it appears to me that Database.HaskellDB.HDBC.ODBC has been installed properly.
Does the build of DBDirect have to be configured some way? I did not configure anything for DBDirect. Has it anything to do with hs-plugins?
Your help would be appreciated.
Edward Ing
On 7/13/07, Bjorn Bringert
wrote: On Jul 12, 2007, at 23:35 , Edward Ing wrote:
Hi Edward,
the right approach would be to add it to other-modules in HDBC- odbc.cabal file, where it should have been all along. This is a bug in HDBC-odbc, I recommend that you send a patch to the maintainer.
/Björn
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Bjorn Bringert
-
Edward Ing