unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: David Thompson <dthompson2@worcester.edu>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] build: ruby: Patch executables to set necessary gem load path.
Date: Mon, 09 Mar 2015 23:19:36 +0100	[thread overview]
Message-ID: <87bnk1q0ef.fsf@gnu.org> (raw)
In-Reply-To: <87vbic2u7n.fsf@fsf.org> (David Thompson's message of "Sat, 07 Mar 2015 19:45:00 -0500")

David Thompson <dthompson2@worcester.edu> skribis:

> David Thompson <dthompson2@worcester.edu> 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	other threads:[~2015-03-09 22:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-08  0:00 [PATCH] build: ruby: Patch executables to set necessary gem load path David Thompson
2015-03-08  0:45 ` David Thompson
2015-03-09 22:19   ` Ludovic Courtès [this message]
2015-03-09 22:18 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bnk1q0ef.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=dthompson2@worcester.edu \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).