unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ‘guix pack --relocatable’ and the binary installation tarball
       [not found] <20180503201531.22213-1-ludo@gnu.org>
@ 2018-05-11 16:42 ` Ludovic Courtès
  0 siblings, 0 replies; only message in thread
From: Ludovic Courtès @ 2018-05-11 16:42 UTC (permalink / raw)
  To: guix-devel

Hello Guix!

To continue the experiment with ‘guix pack --relocatable’, I made a
binary installation tarball like this:

  guix pack -S /bin=bin -S /sbin=sbin --localstatedir -R guix bash-static

The resulting tarball can be sent on a Guix-less machine, and then you
can run the daemon as non-root and build things, though you have to
define a couple of undocumented variables and disable chroot support:

--8<---------------cut here---------------start------------->8---
~/tmp$ NIX_STATE_DIR=$PWD/var/guix NIX_LOG_DIR=$PWD/var/log/guix ./bin/guix-daemon --disable-chroot &
[1] 25103
~/tmp$ NIX_STATE_DIR=$PWD/var/guix ./bin/guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
accepted connection from pid 26073, user ludo
/gnu/store/qw5n2f745cb8h71fpwrhha2d62q7x2kp-make-boot0-4.2.1-debug
/gnu/store/f7q38v9fh9zz27qinjwscqip8k7fkirs-make-boot0-4.2.1
~/tmp$ NIX_STATE_DIR=$PWD/var/guix ./bin/guix gc --list-live | wc -l
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
accepted connection from pid 27833, user ludo
finding garbage collector roots...
guile: warning: failed to install locale
determining live/dead paths...
46
--8<---------------cut here---------------end--------------->8---

Build results are not wrapped though, so you cannot execute them
directly:

--8<---------------cut here---------------start------------->8---
~/tmp$ /gnu/store/f7q38v9fh9zz27qinjwscqip8k7fkirs-make-boot0-4.2.1/bin/make
bash: /gnu/store/f7q38v9fh9zz27qinjwscqip8k7fkirs-make-boot0-4.2.1/bin/make: No such file or directory
--8<---------------cut here---------------end--------------->8---

Instead you have to enter a namespace where /gnu/store is properly
bound, and this is where the ‘bash-static’ we added to the tarball can
be useful:

--8<---------------cut here---------------start------------->8---
~/tmp$ ./bin/sh 
~/tmp$ /gnu/store/f7q38v9fh9zz27qinjwscqip8k7fkirs-make-boot0-4.2.1/bin/make --version
GNU Make 4.2.1
Built for x86_64-unknown-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
--8<---------------cut here---------------end--------------->8---

We could probably simplify this use case, though I wonder how far we
need to go here.

Thoughts?  :-)

Ludo’.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-11 16:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180503201531.22213-1-ludo@gnu.org>
2018-05-11 16:42 ` ‘guix pack --relocatable’ and the binary installation tarball Ludovic Courtès

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).