[racket] policy on providing version for ffi-lib

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Thu May 5 22:56:34 EDT 2011

I just updated the package too.

Jay

2011/5/3 Matthew Flatt <mflatt at cs.utah.edu>:
> I've pushed a rewrite for the `ffi-lib' docs. The rewrite encourages a
> list of version numbers, if only to hold a single version number
> followed by `#f' (i.e., a versionless library as a fallback).
>
> At Mon, 2 May 2011 19:20:54 -0400, Danny Yoo wrote:
>> I notice that Sqlite's library is usually installed as
>> 'libsqlite3.so.0' on a user's system, but the sqlite PLaneT package:
>>
>>
>> http://planet.racket-lang.org/display.ss?package=sqlite.plt&owner=jaymccarthy
>>
>> appears to assume that the library is named libsqlite3.so.  J G Cho
>> ran across this a week or so ago
>> (http://www.mail-archive.com/users@racket-lang.org/msg05318.html)  and
>> I ran across the same issue this afternoon.
>>
>>
>> I guess it's easy to "fix" this by creating a dynamic link, but I
>> don't think this is the right solution.  According to section 3.1.1 of
>> the Program Library HOWTO:
>>
>>     http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
>>
>> the expectation is that FFI library writers should be linking to the
>> "soname", not the "linker" name.  To fix this for the sqllite bindings
>> in particular, the call to ffi-lib in the bindings file
>> ("sqllite-ffi.rkt") needs to provide the version number, from
>>
>>     (define sqlite (ffi-lib "libsqlite3"))
>>
>> to:
>>
>>     (define sqlite (ffi-lib "libsqlite3" "0"))
>>
>>
>>
>> The default policy for ffi-lib, however, is to use the linker name
>> convention if no second argument is passed to ffi-lib:
>>
>>
>> http://docs.racket-lang.org/foreign/Loading_Foreign_Libraries.html#(def._((lib._
>> ffi/unsafe..rkt)._ffi-lib))
>>
>> which seems to encourage this confusion.  Can the documentation to
>> ffi-lib be revised to more vigorously encourage the use of the version
>> argument?
>> _________________________________________________
>>   For list-related administrative tasks:
>>   http://lists.racket-lang.org/listinfo/users
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93



Posted on the users mailing list.