Subject: Re: bug#22607: doc install from *Guix Package Info: profile* fails

From: Alex Kost <[email-masked]>
Date: Tue, 09 Feb 2016 21:47:04 +0300

myglc2 (2016-02-09 19:49 +0300) wrote:

> Running: guixSD.
>
> Scenario: Finding and installing doc for a package (ncurses) used by a
> by a global package (emacs) I hit the following error.

A-a-a! What you tried is more or less the equivalent of:

  guix package -i foo --profile=/run/current-system/profile

A system is "composed" during "guix system" command, and it is
immutable, so you can't install packages to an existing system.

The only proper way to install packages globally is by adding them to
your system config.scm and running "guix system reconfigure".

You shouldn't (!) try to install packages in a system profile in any
other way.

[...]
> user
> ====
[...]
> guix/utils.scm:607:4: In procedure switch-symlinks:
> guix/utils.scm:607:4: In procedure symlink: Read-only file system: "/var/guix/profiles/system-31-link/profile-1-link.new"

Unsurprisingly, a user don't have rights to change /var/guix/...

[...]
> root
> ====

You are brave!  I wouldn't try to run Emacs as root and do some unknown
actions.

> scheme@(guile-user)> (process-package-actions "/var/guix/profiles/system-32-link/profile" #:install '((32467968 "doc")) #:upgrade '() #:remove '() #:use-substitutes? #t #:dry-run? #f)
> The process begins ...
> The following package will be installed:
>    ncurses:doc	6.0	/gnu/store/wng6fsgiiqi0rcc4p9655ga4b2j5jk53-ncurses-6.0-doc
>
> substitute: updating list of substitutes from 'http://hydra.gnu.org'... 100.0%
> The following derivations will be built:
>    /gnu/store/kdpgj81d7fi6pxzv0c43kwr9swzimixa-profile.drv
>    /gnu/store/s0f0f0y32kjk9km8ki5i5hy6rlhwlxcx-gtk-icon-themes.drv
>    /gnu/store/himj3dxych8xw300c1dkmyn8kyczry57-ca-certificate-bundle.drv
>    /gnu/store/bdzjjck73nz1xb8m5f0cj0zzb1cplxg7-info-dir.drv
> guix/utils.scm:607:4: In procedure switch-symlinks:
> guix/utils.scm:607:4: In procedure symlink: Read-only file system: "/var/guix/profiles/system-32-link/profile-1-link.new"

Thanks God /gnu/store on GuixSD is read-only even for root!

A system is not just a set of packages.  Look at any
"/var/guix/profiles/system-XX-link" file.  It is a symlink to the store.
"profile" (which contains the installed packages) is only one of its
subdirectories.  What you tried led to an attempt of making a new
generation of this "profile" directory, and happily in failed even for
root.

Why do you install everything globally?  IMO it is much more convenient
to manage a user profile (no root involved, no "system reconfigure" all
the time).

Really, it is a big feature of Guix to be able to install packages
without using root rights.  Of course it's your choice, but I highly
recommend to install your packages in ~/.guix-profile.  The only global
packages I added to %base-packages are: 'nss-certs' and 'iproute'.

-- 
Alex