From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Woodcroft Subject: Re: Foreign packages (formerly Re: [PATCH] gnu: Add ruby-nokogiri) Date: Sun, 21 Feb 2016 21:50:59 +1000 Message-ID: <56C9A4A3.9070602@uq.edu.au> References: <20150713130956.GC28969@thebird.nl> <877fq4i41n.fsf@elephly.net> <20150714090613.GA1523@thebird.nl> <20160217223708.GA7805@thebird.nl> <56C4FCB6.2080108@uq.edu.au> <20160218062534.GA9060@thebird.nl> <87io1i48k5.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXSXe-0007lR-Ar for guix-devel@gnu.org; Sun, 21 Feb 2016 06:51:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXSXa-00005Z-9p for guix-devel@gnu.org; Sun, 21 Feb 2016 06:51:10 -0500 Received: from mailhub2.soe.uq.edu.au ([130.102.132.209]:58104 helo=newmailhub.uq.edu.au) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXSXZ-00005E-N0 for guix-devel@gnu.org; Sun, 21 Feb 2016 06:51:06 -0500 In-Reply-To: <87io1i48k5.fsf@elephly.net> 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: Ricardo Wurmus , Pjotr Prins Cc: "guix-devel@gnu.org" On 21/02/16 21:16, Ricardo Wurmus wrote: > Pjotr Prins writes: > >> Another issue: for me the main problem with foreign modules in Guix is >> that they are not completely isolated in the profile. No one caught me >> out on that yet >> >> ~/.guix-profile/lib/ruby/2.2.0/ >> >> (in my talk I showed the path). But we symlink against major version >> numbers. >> >> So any Ruby interpreter 2.2.x version will share the same gems. It is = not >> necessarily a problem because the Ruby world is built around this >> assumption. But when I look at developer support and reproducibility I >> don't like it much. You can have software running with different Ruby >> interpreters under the hood - and you won't know it. > Do they really reference different variants of Ruby in the background? > The ruby-build-system adds the =E2=80=9Cruby=E2=80=9D package only to t= he build inputs. > I don=E2=80=99t have different =E2=80=9Cruby-*=E2=80=9D packages in my = store right now (after > =E2=80=9Cguix gc=E2=80=9D), so I cannot verify this myself. I would be= interested to > know if references to the =E2=80=9Cruby=E2=80=9D package are actually r= etained when > building, say, =E2=80=9Cruby-nokogiri=E2=80=9D. And either way, I'd argue that just being present in the store doesn't=20 qualify as "installed" for its usual definition. >> I realise this is different from what you are saying Ben, but both >> these problems exist in my mind. >> >> I would prefer to isolate the against the full hash in the profile - o= r at least >> Ruby version - that way there can be no mixing. E.g. >> >> ~/.guix-profile/lib/ruby/pgks1l9cl696j34v9mb35lk8x6lac3b0-ruby-2.2.= 4/ >> >> It does not look as nice in the profile - but who cares. I'm not sure I follow Pjotr. There is only one GEM_PATH environment=20 variable used by all rubies, no? > I haven=E2=80=99t thought enough about this to have an opinion about th= is. > Generally, though, I dislike to use environment variables to point the > interpreter to a prefix where all libraries can be found. I think that > it=E2=80=99s up to the libraries themselves to find their dependencies = (like > it=E2=80=99s done with RUNPATH). Indeed, please do make progress in the parallel thread about Python... Maybe Ruby is easier though. Simply replace the foo in require 'foo'=20 with the first input where=20 /gnu/store/.../lib/ruby/gems/2.2.0/gems/.../lib/foo.rb is a file, I=20 think. Presumably the reality will be more complex, but does this sound=20 bad Pjotr? Thanks, ben > > Can we avoid all of this by replacing =E2=80=9Crequire "library"=E2=80=9D= in Ruby source > files with =E2=80=9Crequire "/gnu/store/.../path/to/library"=E2=80=9D? = Would we still > need to have a single in-profile prefix for Ruby libs? > > ~~ Ricardo