From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: Re: Creating user profiles Date: Sun, 13 Jan 2013 23:31:44 +0100 Message-ID: <201301132331.44244.andreas@enge.fr> References: <201301131423.36130.andreas@enge.fr> <87libwrb66.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="Boundary-01=_QXz8QqlEK0cCgVx" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuW64-0003wN-U4 for bug-guix@gnu.org; Sun, 13 Jan 2013 17:32:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuW5v-0003Tf-9K for bug-guix@gnu.org; Sun, 13 Jan 2013 17:32:08 -0500 In-Reply-To: <87libwrb66.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: bug-guix@gnu.org --Boundary-01=_QXz8QqlEK0cCgVx Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Am Sonntag, 13. Januar 2013 schrieb Ludovic Court=C3=A8s: > Right, good point. (Apparently Nix=E2=80=99s manual doesn=E2=80=99t ment= ion it either.) > So here=E2=80=99s what I would do: I simply applied the patch, and it seems to be part of the solution. Upon a first run of "guix-package --list-available", I obtained the error=20 message inviting me to create the directory, which I did. The next call=20 succeeded. But now $HOME/.guix-profile points to the non-existing=20 /usr/local/guix-git/var/nix/profiles/per-user/privat/guix-profile, and I=20 get the error: Backtrace: In ice-9/boot-9.scm: 149: 9 [catch #t # ...] 157: 8 [#] In unknown file: ?: 7 [catch-closure] In ice-9/boot-9.scm: 63: 6 [call-with-prompt prompt0 ...] In ice-9/eval.scm: 407: 5 [eval # #] In unknown file: ?: 4 [call-with-input-string "(apply (module-ref (resolve-interface=20 '(guix-package)) 'guix-package) (cdr (command-line)))" ...] In ice-9/command-line.scm: 174: 3 [#=20 #] In unknown file: ?: 2 [eval (apply (module-ref # #) (cdr #)) #] In /usr/local/bin/guix-package: 467: 1 [guix-package "--list-available"] In unknown file: ?: 0 [symlink "/usr/local/guix-git/var/nix/profiles/per- user/privat/guix-profile" ...] ERROR: In procedure symlink: ERROR: In procedure symlink: File exists The problem is that the call to "guix-package --list-available" does not=20 actually create anything in the per-user profile directory. After deleting $HOME/.guix-profile again and running "guix-package -i=20 hello", the per-user profile directory contains a symbolic link guix- profile-1-link to a user environment in the nix store, and a symbolic link= =20 guix-profile to guix-profile-1-link, and $HOME/.guix-profile points to the= =20 right thing. Then "guix-package --list-available" succeeds. Now I can even remove the hello package, since then the per-user profile=20 directory contains a link to the empty user environment in the nix store. I would suggest the following: Before making the $HOME/.guix-profile=20 symlink, check for the guix-profile symlink in the per-user profile=20 directory. If it does not exist, create it as a link to the empty user=20 environment. So there will always be guix-profile-1-link linking to the=20 empty directory, which might also be useful for roll back (never delete=20 this first empty environment). Andreas --Boundary-01=_QXz8QqlEK0cCgVx Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

Am Sonntag,= 13. Januar 2013 schrieb Ludovic Court=C3=A8s:

> Right,= good point. (Apparently Nix=E2=80=99s manual doesn=E2=80=99t mention it e= ither.)

> So her= e=E2=80=99s what I would do:

&nb= sp;

I simply ap= plied the patch, and it seems to be part of the solution.

Upon a firs= t run of "guix-package --list-available", I obtained the error me= ssage inviting me to create the directory, which I did. The next call succe= eded. But now $HOME/.guix-profile points to the non-existing /usr/local/gui= x-git/var/nix/profiles/per-user/privat/guix-profile, and I get the error:

&nb= sp;

Backtrace:<= /p>

In ice-9/bo= ot-9.scm:

149: 9 [ca= tch #t #<catch-closure 14e29c0> ...]

157: 8 [#&= lt;procedure 147e0f0 ()>]

In unknown = file:

?: 7 [ca= tch-closure]

In ice-9/bo= ot-9.scm:

63: 6 [ca= ll-with-prompt prompt0 ...]

In ice-9/ev= al.scm:

407: 5 [ev= al # #]

In unknown = file:

?: 4 [ca= ll-with-input-string "(apply (module-ref (resolve-interface '(guix-pac= kage)) 'guix-package) (cdr (command-line)))" ...]

In ice-9/co= mmand-line.scm:

174: 3 [#&= lt;procedure 1415500 at ice-9/command-line.scm:169:3 (port)> #<input:= string 12a51a0>]

In unknown = file:

?: 2 [ev= al (apply (module-ref # #) (cdr #)) #<directory (guile-user) 14e4d80>= ]

In /usr/loc= al/bin/guix-package:

467: 1 [gu= ix-package "--list-available"]

In unknown = file:

?: 0 [sy= mlink "/usr/local/guix-git/var/nix/profiles/per-user/privat/guix-profi= le" ...]

&nb= sp;

ERROR: In p= rocedure symlink:

ERROR: In p= rocedure symlink: File exists

&nb= sp;

The problem= is that the call to "guix-package --list-available" does not act= ually create anything in the per-user profile directory.

&nb= sp;

After delet= ing $HOME/.guix-profile again and running "guix-package -i hello"= , the per-user profile directory contains a symbolic link guix-profile-1-li= nk to a user environment in the nix store, and a symbolic link guix-profile= to guix-profile-1-link, and $HOME/.guix-profile points to the right thing.= Then "guix-package --list-available" succeeds.

&nb= sp;

Now I can e= ven remove the hello package, since then the per-user profile directory con= tains a link to the empty user environment in the nix store.

&nb= sp;

I would sug= gest the following: Before making the $HOME/.guix-profile symlink, check fo= r the guix-profile symlink in the per-user profile directory. If it does no= t exist, create it as a link to the empty user environment. So there will a= lways be guix-profile-1-link linking to the empty directory, which might al= so be useful for roll back (never delete this first empty environment).

&nb= sp;

Andreas

&nb= sp;

--Boundary-01=_QXz8QqlEK0cCgVx--