[Rubygems-developers] How to deal with binary dependencies?

Luis Lavena luislavena at gmail.com
Mon Jul 21 15:15:02 EDT 2008


On Mon, Jul 21, 2008 at 8:57 PM, Charlie Savage <cfis at savagexi.com> wrote:
>> So, that means is good to put the DLLs in ruby/bin, like One-Click
>> Installer is doing.
>
> Yes, I think that is the right choice for the one click installer.
>
> For an individual GEM, I think either solution is ok - a) copying the shared
> library to ruby/bin or b) manipulating the path to add the path the shared
> library
>

Hmn, I was talking that One-Click Installer did that in the past since
it bundled a lot of extensions and gems, but we are shifting to a
gem-based design where RubyGems plan a important role.

Manipulating the path? that means change code in RubyGems to take care
of each gem that expose a "binary library"... I don't like the idea.

>> Right now RubyGems offer you a mechanism that set stubs in ruby/bin,
>> but that procedure doesn't like executables or even shared libraries
>> (dll):
>>
>>
>> http://rubyforge.org/pipermail/rubygems-developers/2007-October/003123.html
>>
>> Since we already have #executables and #bindir to define where those
>> are inside our gems.
>>
>> What about #binaries? and we thread them different that executables
>> (verbatim copy them instead of adding shebangs).
>
> I'd probably be more specific and define a new spec setting called
> "libraries" that means RubyGems will:
>

But a library is also a ruby library, which doesn't apply. Is it a
binary dependency of the extension bundled in the gem.

> a) On installation copy the files marked "libraries" to ruby/bin
> b) On loading a gem, update the path to include the location of the library
> files (if any are set).
>
> So:
>
> Directory:
>
> libxml_ruby
>  lib
>    libxml2-2.dll
>
>
> GemSpec:
>
> spec.libraries << "lib/libxml2-2.dll"
>
> How does that sound?
>

Hmn, that definetely add some platform specific code beyond what
RubyGems should be doing... and from POV I don't like it so much.

> And what should I do in the short term?
>

Indicate your users to copy the dll or provide a RubyGems binary
(minimal script) that performs the dll copy form that particular
folder into ruby/bin (Gem.bindir)

Something similar is what I do for mongrel_service.

-- 
Luis Lavena
AREA 17
-
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams


More information about the Rubygems-developers mailing list