From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thompson Subject: Re: [PATCH] build: ruby: Patch executables to set necessary gem load path. Date: Sat, 07 Mar 2015 19:45:00 -0500 Message-ID: <87vbic2u7n.fsf@fsf.org> References: <871tl04aux.fsf@fsf.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUPL4-0006kD-Hw for guix-devel@gnu.org; Sat, 07 Mar 2015 19:45:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUPL3-0001Rc-Gq for guix-devel@gnu.org; Sat, 07 Mar 2015 19:45:02 -0500 Received: from mail.fsf.org ([208.118.235.13]:58140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUPL3-0001RW-EC for guix-devel@gnu.org; Sat, 07 Mar 2015 19:45:01 -0500 Received: from 209-6-40-86.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.40.86]:49796 helo=izanagi) by mail.fsf.org with esmtpsa (TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1YUPL3-0001cz-0s for guix-devel@gnu.org; Sat, 07 Mar 2015 19:45:01 -0500 In-Reply-To: <871tl04aux.fsf@fsf.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org David Thompson 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... -- David Thompson Web Developer - Free Software Foundation - http://fsf.org GPG Key: 0FF1D807 Support the FSF: https://fsf.org/donate