Re: uffi-loader

Edi Weitz <[email protected]>
Newsgroups gmane.lisp.clsql.devel
Message-ID <[email protected]>
On Wed, 9 Jun 2004 16:03:58 -0600, Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> wrote:

> I reviewed the behavior of the clsql-uffi .asd system using
> clc-register-user-package both with and without your patch. Loading
> is working fine for me in both instances.

Strange. It didn't work for me - see below.

> You stated that the patch "makes it easier" to find the C
> library. Have you noticed an error in some circumstances without the
> patch? If possible, I'd like to try to reproduce such a problem.

Yes, I should have been more specific, sorry. With unpatched CLSQL
2.11.6 I get these results:

  [email protected]:~$ clc-register-user-package /usr/local/lisp/source/clsql/clsql.asd 
  User package /usr/local/lisp/source/clsql-2.11.6/clsql.asd installed
  [email protected]:~$ clc-register-user-package /usr/local/lisp/source/clsql/clsql-uffi.asd 
  User package /usr/local/lisp/source/clsql-2.11.6/clsql-uffi.asd installed
  [email protected]:~$ clc-register-user-package /usr/local/lisp/source/clsql/clsql-postgresql.asd 
  User package /usr/local/lisp/source/clsql-2.11.6/clsql-postgresql.asd installed
  [email protected]:~$ cmucl
  ; Loading #p"/home/edi/.cmucl-init".
  CMU Common Lisp CVS release-18e-branch + minimal debian patches, running on bird.agharta.de
  With core: /usr/lib/cmucl/lisp.core
  Dumped on: Tue, 2004-05-25 12:39:53+02:00 on bird
  For support see http://www.cons.org/cmucl/support.html Send bug reports to the debian BTS.
  or to [email protected]
  type (help) for help, (quit) to exit, and (demo) to see the demos

  Loaded subsystems:
      Python 1.1, target Intel x86
      CLOS 18e (based on PCL September 16 92 PCL (f))
  * (require :clsql-postgresql)

  ; loading system definition from /home/edi/.clc/systems/uffi.asd into
  ; #<The ASDF1044 package, 0/9 internal, 0/9 external>
  ; registering #<SYSTEM UFFI {48069995}> as UFFI
  ;;; Please wait, recompiling library...
  ;;; Please wait, recompiling library...
  ; $ cd /usr/local/lisp/source/clsql-2.11.6/uffi/; make
  BASE=uffi OBJECT=uffi.o SOURCE=uffi.c SHARED_LIB=uffi.so sh make.sh
  rm uffi.o

  ; Python version 1.1, VM version Intel x86 on 10 JUN 04 12:30:09 am.
  ; Compiling: /usr/local/lisp/source/clsql-2.11.6/uffi/clsql-uffi-loader.lisp 18 MAY 04 08:35:31 pm

  ; Byte Compiling Top-Level Form: 
  ; Converted LOAD-UFFI-FOREIGN-LIBRARY.
  ; Compiling DEFUN LOAD-UFFI-FOREIGN-LIBRARY: 
  ; Byte Compiling Top-Level Form: 

  ; /home/edi/.clc/bin/cmucl/clsql-uffi/uffi/clsql-uffi-loader.x86f written.
  ; Compilation finished in 0:00:00.

  Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER:
     NIL is not of type (OR PATHNAME STREAM BASE-STRING)

  Restarts:
    0: [CONTINUE] Return NIL from load of #p"/home/edi/.clc/bin/cmucl/clsql-uffi/uffi/clsql-uffi-loader.x86f".
    1: [RETRY   ] Retry performing #<ASDF:LOAD-OP NIL {4903C9E5}> on
                  #<ASDF:CL-SOURCE-FILE "clsql-uffi-loader" {4820BD35}>.
    2: [ACCEPT  ] Continue, treating #<ASDF:LOAD-OP NIL {4903C9E5}> on
                  #<ASDF:CL-SOURCE-FILE "clsql-uffi-loader" {4820BD35}> as having
                  been successful.
    3: [ABORT   ] Return to Top-Level.

  Debug  (type H for help)

  (PROBE-FILE 1 NIL)[:EXTERNAL]
  Source: 
  ; File: target:code/filesys.lisp
  (DEFUN PROBE-FILE (PATHNAME)
    "Return a pathname which is the truename of the file if it exists, NIL
    otherwise. An error of type file-error is signaled if pathname is wild."
    (IF (WILD-PATHNAME-P PATHNAME)
        (ERROR 'SIMPLE-FILE-ERROR :PATHNAME PATHNAME :FORMAT-CONTROL ...)
        (LET #
          #)))
  0] back

  0: (PROBE-FILE 1 NIL)[:EXTERNAL]
  1: (LOAD-UFFI-FOREIGN-LIBRARY)
  2: (C::DO-CALL #<Code Object "Top-Level Form" {492589C7}> 23 24 4 ...)
  3: (COMMON-LISP::FOP-FUNCALL-FOR-EFFECT)
  4: (COMMON-LISP::LOAD-GROUP
      #<Stream for file "/home/edi/.clc/bin/cmucl/clsql-uffi/uffi/clsql-uffi-loader.x86f">)
  5: (COMMON-LISP::FASLOAD
      #<Stream for file "/home/edi/.clc/bin/cmucl/clsql-uffi/uffi/clsql-uffi-loader.x86f">)
  6: (COMMON-LISP::INTERNAL-LOAD
      #p"/home/edi/.clc/bin/cmucl/clsql-uffi/uffi/clsql-uffi-loader.x86f"
      #p"/home/edi/.clc/bin/cmucl/clsql-uffi/uffi/clsql-uffi-loader.x86f"
      :ERROR
      :BINARY)
  7: (COMMON-LISP::INTERNAL-LOAD
      #p"/home/edi/.clc/bin/cmucl/clsql-uffi/uffi/clsql-uffi-loader.x86f"
      #p"/home/edi/.clc/bin/cmucl/clsql-uffi/uffi/clsql-uffi-loader.x86f"
      :ERROR
      NIL)
  8: (LOAD #p"/home/edi/.clc/bin/cmucl/clsql-uffi/uffi/clsql-uffi-loader.x86f"
           :VERBOSE
           NIL
           :PRINT
           ...)
  9: ("DEFMETHOD PERFORM (LOAD-OP CL-SOURCE-FILE)" #<unused-arg> #<unused-arg>
      #<ASDF:LOAD-OP NIL {4903C9E5}>
      #<ASDF:CL-SOURCE-FILE "clsql-uffi-loader" {4820BD35}>)
  10: ("LAMBDA (PCL::EFFECTIVE-METHOD-GENSYM-0 PCL::EFFECTIVE-METHOD-GENSYM-1 PCL::EFFECTIVE-METHOD-GENSYM-2)"
       #<unused-arg> #<unused-arg> #<ASDF:LOAD-OP NIL {4903C9E5}>
       #<ASDF:CL-SOURCE-FILE "clsql-uffi-loader" {4820BD35}>)
  11: (#:G0)
  12: (ASDF:OPERATE ASDF:LOAD-OP CLSQL-POSTGRESQL-SYSTEM::CLSQL-UFFI)
  13: (ASDF:OPERATE 2 ASDF:LOAD-OP CLSQL-POSTGRESQL-SYSTEM::CLSQL-UFFI)[:EXTERNAL]
  14: (COMMON-LISP-CONTROLLER::REQUIRE-ASDF CLSQL-POSTGRESQL-SYSTEM::CLSQL-UFFI)
  15: (COMMON-LISP-CONTROLLER::REQUIRE-ASDF :CLSQL-POSTGRESQL)
  16: (EXTENSIONS:INTERACTIVE-EVAL (REQUIRE :CLSQL-POSTGRESQL))
  17: (COMMON-LISP::%TOP-LEVEL)
  18: (COMMON-LISP::RESTART-LISP)

With my patch everything works fine.

I notice that clsql-uffi-loader.lisp checks the following folders:

  "/usr/lib/clsql/"
  "/opt/lisp/clsql/uffi/"
  "/home/kevin/debian/src/clsql/uffi/"

Maybe the library is in one of these on your machine. They don't exist
on mine.

Let me know if you need more info.

Cheers,
Edi.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.