From: Till Kranz
Subject: lambda-gtk or rather sb-alien hassels
Date: 
Message-ID: <opsqvix1xp6j4zkn@darkstar>
Hi,

I tried to get lambda-gtk up and running on sbcl 0.9 emerged on a Gentoo  
box.
Somewhere in the READMEs it said that I need sbcl-af and gentoo claims  
that I get that if I emerge with 'callbacks'. So I did that and then  
installed lambda-gtk through
(asdf:oos 'asdf:load-op :lambda-gtk)
Seemed to work fine: Lots of compiler messages zipping by.
Then I tried to get the examples by
(asdf:oos 'asdf:load-op :lambda-gtk-examples)
which landed on the debug prompt after a few seconds, telling me that
BYTE-VECTOR-TO-STATIC-VECTOR is undefined
When I choose to continue it finishes with no further complaints but  
aftwerwards non of the examples is defined.

I found out that said function belongs to the sb-alien namespace and that  
the exception occurs right in the first first signal handler (bye1) in  
examples.lisp

As I'm pretty new to lisp, I'm not sure how to check what goes wrong.  
Maybe I should check if the ffi is properly loaded, but how?

Any help will be appreciated

	Till

From: R. Mattes
Subject: Re: lambda-gtk or rather sb-alien hassels
Date: 
Message-ID: <pan.2005.05.17.00.17.22.275608@mh-freiburg.de>
On Mon, 16 May 2005 15:07:03 +0000, Till Kranz wrote:

> Hi,
> 
> I tried to get lambda-gtk up and running on sbcl 0.9 emerged on a Gentoo  
> box.
> Somewhere in the READMEs it said that I need sbcl-af and gentoo claims  
> that I get that if I emerge with 'callbacks'. So I did that and then  
> installed lambda-gtk through
> (asdf:oos 'asdf:load-op :lambda-gtk)
> Seemed to work fine: Lots of compiler messages zipping by.
> Then I tried to get the examples by
> (asdf:oos 'asdf:load-op :lambda-gtk-examples)
> which landed on the debug prompt after a few seconds, telling me that
> BYTE-VECTOR-TO-STATIC-VECTOR is undefined
> When I choose to continue it finishes with no further complaints but  
> aftwerwards non of the examples is defined.
> 
> I found out that said function belongs to the sb-alien namespace and that  
> the exception occurs right in the first first signal handler (bye1) in  
> examples.lisp

This is a result of recent changes in the SBCL core. You _might_ be lucky
and get along by checking out the 'sbcl-callable' module from the SBCL
CVS repository. But that's not really maintained since callback support
is still in the make. Check some of the recent discussion on sbcl-devel 
and sbcl-general as well.

> As I'm pretty new to lisp, I'm not sure how to check what goes wrong.
> Maybe I should check if the ffi is properly loaded, but how?
> 
> Any help will be appreciated

HTH Ralf Mattes
 
> 	Till
From: Petr Machata
Subject: Re: lambda-gtk or rather sb-alien hassels
Date: 
Message-ID: <d72umt$qv6$1@boco.fee.vutbr.cz>
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigBFE22A63FF8A0953F54A44F2
Content-Type: multipart/mixed;
 boundary="------------010309030404000704090009"

This is a multi-part message in MIME format.
--------------010309030404000704090009
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Till Kranz wrote:
> Hi,
>
> I tried to get lambda-gtk up and running on sbcl 0.9 emerged on a
> Gentoo  box.
> Somewhere in the READMEs it said that I need sbcl-af and gentoo claims
> that I get that if I emerge with 'callbacks'. So I did that and then
> installed lambda-gtk through
> (asdf:oos 'asdf:load-op :lambda-gtk)
> Seemed to work fine: Lots of compiler messages zipping by.
> Then I tried to get the examples by
> (asdf:oos 'asdf:load-op :lambda-gtk-examples)
> which landed on the debug prompt after a few seconds, telling me that
> BYTE-VECTOR-TO-STATIC-VECTOR is undefined
> When I choose to continue it finishes with no further complaints but
> aftwerwards non of the examples is defined.

I've been playing with lambda-gtk just yesterday, and went into the same
problems as you. It turned out that byte-vector-to-static-vector from
sbcl-af package uses sbcl's kernel function system-area-copy. In 0.9
that was replaced by a family of functions like system-area-ub1-copy,
and system-area-ub8-copy, whose nature is completely obscure to me, as
I'm fresh in Common Lisp.

Well, the solution is to patch a source of sbcl-af. Actually the change
is trivial: just find the only use of system-area-copy in the source,
and change it to system-area-ub1-copy; but I'm attaching the patch
anyway. Semantics of these two functions should be exactly the same, so
I hope this won't break anything.

After patching af package, and rebuilding sbcl-af and lambda-gtk,
lambda-gtk works just fine for me.

>
> I found out that said function belongs to the sb-alien namespace and
> that  the exception occurs right in the first first signal handler
> (bye1) in  examples.lisp
>
> As I'm pretty new to lisp, I'm not sure how to check what goes wrong.
> Maybe I should check if the ffi is properly loaded, but how?
>
> Any help will be appreciated
>
>     Till

Petr Machata

--------------010309030404000704090009
Content-Type: text/plain;
 name="sbcl-af.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sbcl-af.patch"

--- sbcl-af/static-vector.lisp	2004-10-22 08:56:38.000000000 +0200
+++ sbcl-af-for-sbcl-0.9/static-vector.lisp	2005-05-25 14:11:23.000000000 +0200
@@ -54,7 +54,7 @@
   (labels ((save-static-vector (sv)
 	     (let* ((length (static-vector-length sv))
 		    (bv (make-array length :element-type '(unsigned-byte 32))))
-	     (sb-kernel:system-area-copy
+	     (sb-kernel:system-area-ub1-copy
 	      (static-vector-foreign-pointer sv) 0
 	      (vector-sap bv) 0
 	      (* length sb-vm:n-byte-bits))

--------------010309030404000704090009--

--------------enigBFE22A63FF8A0953F54A44F2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with MultiZilla - http://enigmail.mozdev.org

iD8DBQFClP5fP96qek/rA6ERAnLjAKCQnrGHEkhz5QWQc9x6zanYul7WZwCgrOOU
KQTyPM4YjNbVQwTVIaVm/ag=
=NmHU
-----END PGP SIGNATURE-----

--------------enigBFE22A63FF8A0953F54A44F2--