guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] build: ruby: Patch executables to set necessary gem load pat


From: Ludovic Courtès
Subject: Re: [PATCH] build: ruby: Patch executables to set necessary gem load path.
Date: Mon, 09 Mar 2015 23:19:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

David Thompson <address@hidden> skribis:

> David Thompson <address@hidden> writes:
>
>> This patch addresses the issue of how to ensure that Ruby executables
>> are able to load all of the additional Ruby libraries that they need in
>> order to work: with a new 'patch-executables' build phase.  Instead of
>> using wrap-program, I instead take advantage of the wrappers that the
>> 'gem' command already creates for Ruby executables.  There's guaranteed
>> to be a line in which the executable's host gem is loaded that looks
>> like `gem 'foo', version`.  I simply insert a Ruby code snippet above it
>> that adds all of the necessary gems to the 'Gem.path' array.
>>
>> Users of Ruby programs must still apply the $GEM_PATH suggested by 'guix
>> package --search-paths' in order for the gem that the executable belongs
>> to (the gem that they explicitly installed) to be found.  I think this
>> is reasonable and much like how you must set the proper load paths for
>> Guile programs to work.
>
> I can see that this won't be enough for any application whose Ruby gem
> dependency tree is deeper than 1.  I suppose I could use the transitive
> inputs of the package, which would get everything, but that feels a bit
> ugly.  More thought needed...

I guess it could recurse into the DAG, possibly with
‘bag-transitive-inputs’ or some such?

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]