From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pjotr Prins Subject: Re: Hacks to install Guix packages without root Date: Fri, 27 Oct 2017 10:17:33 +0200 Message-ID: <20171027081733.GA8646@thebird.nl> References: <874lqlmvjn.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7zrW-0003H8-KX for guix-devel@gnu.org; Fri, 27 Oct 2017 04:19:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7zrS-0004UY-KG for guix-devel@gnu.org; Fri, 27 Oct 2017 04:19:30 -0400 Content-Disposition: inline In-Reply-To: <874lqlmvjn.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" To: Ricardo Wurmus Cc: guix-devel@gnu.org On Thu, Oct 26, 2017 at 11:46:52PM +0200, Ricardo Wurmus wrote: > Hi, >=20 > this blog post contains many great examples of how to deploy Guix > applications without root access: >=20 > http://guix-hpc.bordeaux.inria.fr/blog/2017/10/using-guix-without-b= eing-root/ >=20 > I think that all of these methods should be wrapped up by Guix itself, > so that none of this has to be done manually. I=E2=80=99d also like to= include > Pjotr=E2=80=99s hack in this, which involves rewriting /gnu/store refer= ences. > It=E2=80=99s icky but effective and one of the reasons why Conda is so = popular > (they rewrite references in their binaries as well, but less principled > than, say, grafts). >=20 > How about an extension of =E2=80=9Cguix pack=E2=80=9D that will rewrite= the /gnu/store > references to a user-provided directory before bundling things up in a > tarball? I=E2=80=99d *really* like to be able to just use the tarball = bundle > =E2=80=9Cguix pack=E2=80=9D produces by default, but currently deployin= g it requires > root access or proot shenanigans at runtime. >=20 > How about making manual hacking with unshare and chroot obsolete by > including a simple executable in the pack that handles this rewriting > for the user=E2=80=A6? With that we would be one step closer to the us= er > experience of Docker =E2=80=94 without having a runtime dependency on D= ocker. I wrote a fast executable in D that does that https://gitlab.com/pjotrp/guix-relocate/blob/master/src/main.d It is part of my installer which I wrote in Ruby (sorry, I know ;) https://gitlab.com/pjotrp/gnu-install-bin/blob/master/bin/gnu-install-b= in Note it first uses Nix's patchelf and then the D program - I could have linked the two, but did not bother. The logic is here: https://gitlab.com/pjotrp/gnu-install-bin/blob/master/lib/installer.rb I remember sweating over this in a dark hotel in Zanzibar last winter. There was a heat wave and the airco was ineffective. It was a fun thing to do, even so. Pj