[racket] policy on providing version for ffi-lib

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue May 3 15:25:01 EDT 2011

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/[email protected]/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


Posted on the users mailing list.