Re: Migrating from UFFI to CFFI

Victor <[email protected]> Wed, 09 Oct 2013 15:49:29 +0300
Newsgroups gmane.lisp.clsql.general
Message-ID <op.w4otwra14lizsz@vanyakin-nb>
On Wed, 09 Oct 2013 15:17:48 +0300, Victor <[email protected]> wrote:

> On Tue, 08 Oct 2013 23:21:08 +0300, Russ Tyndall <[email protected]> wrote:
>
>> Hello Victor,
>>
>> Actually the work is done and CLSQL supports running over UFFI or CFFI.
>> We also ran into some cases where UFFI was not as performant or had
>> errors and have been running under CFFI in production sites for quite
>> some time.  The solution outlined below requires the CFFI-UFFI-COMPAT
>> library (quicklisp).
>>
>> To enable CFFI you must require :clsql-cffi before any of the specific
>> backends.  Once that is done, you may require :clsql-odbc etc.
>> Oddly, I notice that we are not depending on CFFI-UFFI-COMPAT (which is
>> probably a bug), so you may have to depend on that separately.
>> Something like `:depend-on '(:cffi-uffi-compat :clsql-cffi :clsql-odbc)`
>> in your asd should get you going using CFFI.  Please do report any bugs
>> or troubles you experience.
>>
>> Cheers and hope this helps,
>
> Hi Russ,
>
> thanks for your advice. So far I can load UFFI-compat by manually
> loading required packages in the REPL:
>
> | (ql:quickload :cffi-uffi-compat)
> | (ql:quickload :clsql-cffi)
> | (ql:quickload :clsql-sqlite3)
>
> But I did not figure out yet how to achieve the same result with
> depends-on.
>
> However, the real problem currently is that the program gets into an
> UNDEFINED-FUNCTION error:
>
> | debugger invoked on a UNDEFINED-FUNCTION in thread
> | #<THREAD "hunchentoot-worker-127.0.0.1:38567" RUNNING {E5A0849}>:
> |   The function CFFI-UFFI-COMPAT::LOOKUP-FOREIGN-ENCODING is undefined.
>
> it looks like cffi_0.11.2 (that is currently present in my quicklisp
> dist) is not up to date with the most recent UFFI API. I will take a
> look if I can fix it myself.

Now, it appears that fixing it is not that difficult at all:

http://thread.gmane.org/gmane.lisp.cffi.devel/2544

And after looking at amount of work done by UFFI/CFFI-UFFI-COMPAT
I realize that proper migration to CFFI is not feasible in the nearest future
but getting CFFI-UFFI-COMPAT more convenient to use with the CLSQL would
be very nice.

Thanks,
Victor



>
> However, I still believe it would be preferable to avoid piling up
> redundand compatibility layers and replace UFFI with CFFI completely.
>
> Are there any such plans or ongoing projects?
>
> Thanks,
> Victor
>
>
>
>
>
>> Russ Tyndall
>> Acceleration.net
>>
>>
>>
>> On 10/8/2013 10:00 AM, Victor wrote:
>>> Hi all,
>>>
>>> CLSQL currently relies on the UFFI for the native interface. I
>>> understand that both CLSQL and UFFI were developed by Kevin. But
>>> apparently CFFI is considered to be better maintained due to larger
>>> user base. And I am afraid that I've stuck into some issues caused by
>>> UFFI.
>>>
>>> Are there any plans or ongoing projects to migrate CLSQL from UFFI to
>>> CFFI?
>>>
>>> Thanks,
>>> Victor
>>> _______________________________________________
>>> CLSQL mailing list
>>> [email protected]
>>> http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
>>
>> _______________________________________________
>> CLSQL mailing list
>> [email protected]
>> http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
>>
>
>


-- 
Tu ne cede malis, sed contra audentior ito --- LvM