Subject: cl-sql-mysql: Refuses to load necessary foreign libraries under SBCL
From: Drake Wilson <[email-masked]>
To: Debian Bug Tracking System <[email-masked]>
Date: Thu, 07 Jun 2007 01:26:26 -0500

Package: cl-sql-mysql
Version: 3.8.3-1
Severity: grave
Justification: renders package unusable

I can't get clsql-mysql from unstable to load at all under SBCL; it
fails when trying to do the UFFI foreign library load.  I'm not sure
whether this is the same as bug 365912[0] or not; I tried to manually
(uffi:load-foreign-library "/usr/lib/libmysqlclient.so.15") as
mentioned in that bug report, but it didn't change the error any.  I
see some other bugs regarding MySQL client library dependencies that
are claimed fixed in significantly earlier versions of cl-sql-mysql
(mostly 3.5.6), but none of the other reports seem to help any.

Shell transcript follows:

"""
  $ sbcl
  This is SBCL 1.0, an implementation of ANSI Common Lisp.
  More information about SBCL is available at <http://www.sbcl.org/>.
  
  SBCL is free software, provided as is, with absolutely no warranty.
  It is mostly in the public domain; some portions are provided under
  BSD-style licenses.  See the CREDITS and COPYING files in the
  distribution for more information.
  * (asdf:operate 'asdf:load-op 'clsql)
  
  ; loading system definition from /usr/share/common-lisp/systems/clsql.asd into
  ; #<PACKAGE "ASDF0">
  ; loading system definition from /usr/share/common-lisp/systems/uffi.asd into
  ; #<PACKAGE "ASDF1">
  ; registering #<SYSTEM UFFI {10029849A1}> as UFFI
  ; registering #<SYSTEM CLSQL {1002E44D61}> as CLSQL
  NIL
  * (asdf:operate 'asdf:load-op 'clsql-mysql)
  
  ; loading system definition from /usr/share/common-lisp/systems/clsql-mysql.asd
  ; into #<PACKAGE "ASDF0">
  ; registering #<SYSTEM :CLSQL-MYSQL {10035B7FC1}> as CLSQL-MYSQL
  ; loading system definition from /usr/share/common-lisp/systems/clsql-uffi.asd
  ; into #<PACKAGE "ASDF0">
  ; registering #<SYSTEM CLSQL-UFFI {1002F276A1}> as CLSQL-UFFI
  
  debugger invoked on a SIMPLE-ERROR in thread #<THREAD "initial thread" {10031F73B1}>:
    Couldn't load foreign libraries "libmysqlclient", "libmysql". (searched CLSQL-SYS:*FOREIGN-LIBRARY-SEARCH-PATHS*)
  
  Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
  
  restarts (invokable by number or by possibly-abbreviated name):
    0: [RETRY ] Retry performing #<ASDF:LOAD-OP NIL {10032D9C01}> on
                #<ASDF:CL-SOURCE-FILE "mysql-loader" {1003E8A7E1}>.
    1: [ACCEPT] Continue, treating #<ASDF:LOAD-OP NIL {10032D9C01}> on
                #<ASDF:CL-SOURCE-FILE "mysql-loader" {1003E8A7E1}> as having been
                successful.
    2: [ABORT ] Exit debugger, returning to top level.
  
  (FIND-AND-LOAD-FOREIGN-LIBRARY
   #<unavailable argument>
   :MODULE
   "mysql"
   :SUPPORTING-LIBRARIES
   ("c")
   :ERRORP
   T)
  0]
"""

If I try the same thing from SLIME, I get slightly different error
formatting (backtrace cut after SLIME level):

"""
  Couldn't load foreign libraries "libmysqlclient", "libmysql". (searched CLSQL-SYS:*FOREIGN-LIBRARY-SEARCH-PATHS*)
     [Condition of type SIMPLE-ERROR]

  Restarts:
    0: [RETRY] Retry performing #<ASDF:LOAD-OP NIL {10028666F1}> on #<ASDF:CL-SOURCE-FILE "mysql-loader" {10038B0101}>.
    1: [ACCEPT] Continue, treating #<ASDF:LOAD-OP NIL {10028666F1}> on #<ASDF:CL-SOURCE-FILE "mysql-loader" {10038B0101}> as having been successful.
    2: [ABORT-REQUEST] Abort handling SLIME request.
    3: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {1002EE1941}>)

  Backtrace:
    0: (CLSQL-UFFI:FIND-AND-LOAD-FOREIGN-LIBRARY #<unavailable argument> :MODULE "mysql" :SUPPORTING-LIBRARIES ("c") :ERRORP T)
    1: ((SB-PCL::FAST-METHOD CLSQL-SYS:DATABASE-TYPE-LOAD-FOREIGN ((EQL :MYSQL))) #<unavailable argument> #<unavailable argument> #<unavailable argument>)
    2: ((LAMBDA (SB-PCL::.PV-CELL. SB-PCL::.NEXT-METHOD-CALL. SB-PCL::.ARG0.)) #<unavailable argument> #<unavailable argument> :MYSQL)
    3: (SB-FASL::LOAD-FASL-GROUP #<SB-SYS:FD-STREAM for "file /var/cache/common-lisp-controller/1000/sbcl/clsql-mysql/db-mysql/mysql-loader.fasl" {1003AC30D1}>)
    4: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /var/cache/common-lisp-controller/1000/sbcl/clsql-mysql/db-mysql/mysql-loader.fasl" {1003AC30D1}> NIL #<unavailable argument>)
    5: (SB-FASL::INTERNAL-LOAD #P"/var/cache/common-lisp-controller/1000/sbcl/clsql-mysql/db-mysql/mysql-loader.fasl" #P"/var/cache/common-lisp-controller/1000/sbcl/clsql-mysql/db-mysql/mysql-loader.fasl" :ERROR NIL NIL :BINARY NIL)
    6: (SB-FASL::INTERNAL-LOAD #P"/var/cache/common-lisp-controller/1000/sbcl/clsql-mysql/db-mysql/mysql-loader.fasl" #P"/var/cache/common-lisp-controller/1000/sbcl/clsql-mysql/db-mysql/mysql-loader.fasl" :ERROR NIL NIL NIL :DEFAULT)
    7: (LOAD #P"/var/cache/common-lisp-controller/1000/sbcl/clsql-mysql/db-mysql/mysql-loader.fasl")
    8: ((SB-PCL::FAST-METHOD ASDF:PERFORM (ASDF:LOAD-OP ASDF:CL-SOURCE-FILE)) #<unavailable argument> #<unavailable argument> #<ASDF:LOAD-OP NIL {10028666F1}> #<ASDF:CL-SOURCE-FILE "mysql-loader" {10038B0101}>)
    9: ((LAMBDA (SB-PCL::.PV-CELL. SB-PCL::.NEXT-METHOD-CALL. SB-PCL::.ARG0. SB-PCL::.ARG1.)) #<unavailable argument> #<unavailable argument> #<ASDF:LOAD-OP NIL {10028666F1}> #<ASDF:CL-SOURCE-FILE "mysql-loader" {10038B0101}>)
   10: ((LAMBDA NIL))
   11: (SB-C::%WITH-COMPILATION-UNIT #<CLOSURE (LAMBDA NIL) {1003A14429}>)
   12: (ASDF:OPERATE ASDF:LOAD-OP CLSQL-MYSQL)
   13: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ASDF:OPERATE (QUOTE ASDF:LOAD-OP) (QUOTE CLSQL-MYSQL)) #<NULL-LEXENV>)
"""

   ---> Drake Wilson

[0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=365912

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.20.1 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages cl-sql-mysql depends on:
ii  cl-sql                        3.8.3-1    SQL Interface for Common Lisp
ii  cl-sql-uffi                   3.8.3-1    Common UFFI functions for CLSQL da
ii  libc6                         2.5-5      GNU C Library: Shared libraries
ii  libmysqlclient15off           5.0.41-2   MySQL database client library
ii  zlib1g                        1:1.2.3-13 compression library - runtime

cl-sql-mysql recommends no packages.

-- no debconf information