Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 139208 - dev-lisp/cl-sql-3.5.6 - removal of find-and-load-foreign-file incomplete
Summary: dev-lisp/cl-sql-3.5.6 - removal of find-and-load-foreign-file incomplete
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Common Lisp Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-04 10:01 UTC by David Andrews
Modified: 2006-07-14 12:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Andrews 2006-07-04 10:01:00 UTC
Execution of (asdf:oos `asdf:load-op :clsql-postgresql) results in:
        The function CLSQL-UFFI:FIND-AND-LOAD-FOREIGN-LIBRARY
        is undefined. [Condition of type UNDEFINED-FUNCTION]

Apparently recent gentoo patches replace calls to clsql-uffi:find-and-load-foreign-library with calls to uffi:load-foreign-library.  See /usr/portage/dev-lisp/cl-sql/files/3.5.6-gentoo.patch where the defun for clsql-uffi:find-and-load-foreign-library is indeed removed from uffi/clsql-uffi-loader.lisp along with references to it in db-mysql/mysql-loader.lisp.

But another reference to clsql-uffi:find-and-load-foreign-library exists in db-postgresql/postgresql-loader.lisp that isn't addressed by the patch.  This results in the error message reported above at execution time.

Environment here is:

  cl-sql:  3.5.6
  sbcl:    0.9.13
  cl-uffi: 1.5.11
Comment 1 Matthew Kennedy (RETIRED) gentoo-dev 2006-07-09 09:07:07 UTC
Thanks for the note.  I tend to screw this up everytime.  I should get
to this before the weekend end.
Comment 2 Matthew Kennedy (RETIRED) gentoo-dev 2006-07-09 23:40:29 UTC
Updated the portage versions to:

   cl-sql-3.6.3
   sbcl-0.9.14
   cl-uffi-1.5.14

Adjusted the patch to include the LIBDIR adjustment for PostgreSQL:

diff -ur clsql-3.6.3.orig/db-postgresql/postgresql-loader.lisp clsql-3.6.3/db-postgresql/postgresql-loader.lisp
--- clsql-3.6.3.orig/db-postgresql/postgresql-loader.lisp	2005-06-08 14:25:33.000000000 -0500
+++ clsql-3.6.3/db-postgresql/postgresql-loader.lisp	2006-07-10 00:47:40.000000000 -0500
@@ -33,9 +33,11 @@
 				      
 (defmethod clsql-sys:database-type-load-foreign ((database-type
 						  (eql :postgresql)))
-  (clsql-uffi:find-and-load-foreign-library "libpq"
-                                            :module "postgresql"
-                                            :supporting-libraries *postgresql-supporting-libraries*)
+  (uffi:load-foreign-library (make-pathname :directory '(:absolute "usr" "@LIBDIR@")
+					    :name "libpq"
+					    :type "so")
+			     :module "postgresql"
+			     :supporting-libraries *postgresql-supporting-libraries*)
   (setq *postgresql-library-loaded* t))
 
 (clsql-sys:database-type-load-foreign :postgresql)
diff -ur clsql-3.6.3.orig/uffi/clsql-uffi-loader.lisp clsql-3.6.3/uffi/clsql-uffi-loader.lisp
Comment 3 David Andrews 2006-07-14 12:24:23 UTC
What is RESOLVED TEST-REQUEST?  The help text doesn't say.

I've verified that your patch works for me, both with my original software set:
  cl-sql:  (upgraded to 3.6.3)
  sbcl:    0.9.13
  cl-uffi: 1.5.11
and with yours:
   cl-sql-3.6.3
   sbcl-0.9.14
   cl-uffi-1.5.14

(Sorry I took some time reporting back; I had some "stale fasls" which were giving me a headache.)