Linker errors when using HaskellDB on HSQL

Bug #103264 reported by George van den Driessche
4
Affects Status Importance Assigned to Milestone
haskelldb (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: libghc6-haskelldb-dev

I've installed the GHC6, HSQL and HaskellDB Ubuntu-packages. I wrote a little test program (DBTest.hs) which is meant to simply dump the list of tables in a test database that I have. But, whether I try to run this program interactively or compile it, I get linker errors. My guess is that something about the installation of the HaskellDB Haskell-package means it isn't aware that it needs to link against the database-specific HSQL Haskell-packages, since the symbols that it is unable to find are certainly present in the HSQL libraries. It could be that the HaskellDB Ubuntu-package hasn't been updated since HSQL was split into several Haskell-packages. The symptoms are as follows:

$ dpkg --list "libghc6-h*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=======================================-=======================================-==============================================================================================
un libghc6-haskell-src-dev <none> (no description available)
un libghc6-haskell98-dev <none> (no description available)
ii libghc6-haskelldb-dev 0.9.cvs.601-8ubuntu3 Haskell library for expressing database queries
un libghc6-hgl-dev <none> (no description available)
ii libghc6-hsql-dev 1.6-5ubuntu4 Multi-Database Interface System for Haskell
ii libghc6-hsql-mysql-dev 1.6-5ubuntu4 Multi-Database Interface System for Haskell
ii libghc6-hsql-odbc-dev 1.6-5ubuntu4 Multi-Database Interface System for Haskell
ii libghc6-hsql-postgresql-dev 1.6-5ubuntu4 Multi-Database Interface System for Haskell
pn libghc6-hsql-sqlite-dev <none> (no description available)
un libghc6-hsql-sqlite3-dev <none> (no description available)
un libghc6-hunit-dev <none> (no description available)

$ ghc-pkg list
/usr/lib/ghc-6.4.1/package.conf:
    rts-1.0, base-1.0, haskell98-1.0, template-haskell-1.0, unix-1.0,
    Cabal-1.0, parsec-1.0, haskell-src-1.0, network-1.0,
    QuickCheck-1.0, HUnit-1.1, mtl-1.0, fgl-5.2, X11-1.1, HGL-3.1,
    stm-1.0, readline-1.0, (lang-1.0), (concurrent-1.0), (posix-1.0),
    (util-1.0), (data-1.0), (text-1.0), (net-1.0), (hssource-1.0),
    hsql-1.6, hsql-mysql-1.6, hsql-odbc-1.6, hsql-postgresql-1.6,
    haskelldb-0.9

$ cat DBTest.hs
module Main where

import Database.HaskellDB
import Database.HaskellDB.HSQL.MySQL

opts = MySQLOptions { server="localhost", db="mydatabase", uid="myuser", pwd="mypassword" }

main' db = do
  tbls <- tables db
  mapM_ putStrLn tbls

main :: IO ()
main = mysqlConnect opts main'

$ ghci
   ___ ___ _
  / _ \ /\ /\/ __(_)
 / /_\// /_/ / / | | GHC Interactive, version 6.4.1, for Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.

Loading package base-1.0 ... linking ... done.
Prelude> :l DBTest.hs
Skipping Main ( DBTest.hs, DBTest.o )
Ok, modules loaded: Main.
Prelude Main> main
Loading package hsql-1.6 ... linking ... done.
Loading package haskelldb-0.9 ... linking ... <interactive>: /usr/lib/haskell-packages/ghc6/lib/haskelldb-0.9/HShaskelldb-0.9.o: unknown symbol `DatabaseziHSQLziODBC_connect_closure'ghc-6.4.1: unable to load package `haskelldb-0.9'

$ ghc --make DBTest.hs
Chasing modules from: DBTest.hs
Skipping Main ( DBTest.hs, DBTest.o )
Linking ...
/usr/lib/haskell-packages/ghc6/lib/haskelldb-0.9/libHShaskelldb-0.9.a(MySQL.o):(.text+0x13f): undefined reference to `DatabaseziHSQLziMySQL_connect_closure'
/usr/lib/haskell-packages/ghc6/lib/haskelldb-0.9/libHShaskelldb-0.9.a(MySQL.o): In function `__stginit_DatabaseziHaskellDBziHSQLziMySQL_': undefined reference to `__stginit_DatabaseziHSQLziMySQL_'
/usr/lib/haskell-packages/ghc6/lib/haskelldb-0.9/libHShaskelldb-0.9.a(MySQL.o):(.rodata+0x40): undefined reference to `DatabaseziHSQLziMySQL_connect_closure'
/usr/lib/haskell-packages/ghc6/lib/haskelldb-0.9/libHShaskelldb-0.9.a(MySQL.o):(.rodata+0x48): undefined reference to `DatabaseziHSQLziMySQL_connect_closure'
/usr/lib/haskell-packages/ghc6/lib/haskelldb-0.9/libHShaskelldb-0.9.a(MySQL.o):(.rodata+0x54): undefined reference to `DatabaseziHSQLziMySQL_connect_closure'
collect2: ld returned 1 exit status

Tags: dapper haskell
Revision history for this message
Chris Wagner (chris-wagner) wrote :

Hi George. Have you tried a more recent version of Ubuntu, to see if this problem still exists? Thanks.

Revision history for this message
Daniel T Chen (crimsun) wrote :

Closing due to inactivity. Please reopen if reproducible on 8.10 beta.

Changed in haskelldb:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.