From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Creating user profiles Date: Sun, 13 Jan 2013 23:45:34 +0100 Message-ID: <87wqvgog6p.fsf@gnu.org> References: <201301131423.36130.andreas@enge.fr> <87libwrb66.fsf@gnu.org> <201301132331.44244.andreas@enge.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuWJC-0006Ay-Lr for bug-guix@gnu.org; Sun, 13 Jan 2013 17:45:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuWJ6-0000GO-RP for bug-guix@gnu.org; Sun, 13 Jan 2013 17:45:42 -0500 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:40091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuWJ6-0000G5-K8 for bug-guix@gnu.org; Sun, 13 Jan 2013 17:45:36 -0500 In-Reply-To: <201301132331.44244.andreas@enge.fr> (Andreas Enge's message of "Sun, 13 Jan 2013 23:31:44 +0100") 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: Andreas Enge Cc: bug-guix@gnu.org Andreas Enge skribis: > 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: [...] > ?: 0 [symlink "/usr/local/guix-git/var/nix/profiles/per- > user/privat/guix-profile" ...] > > ERROR: In procedure symlink: > ERROR: In procedure symlink: File exists Aah, I see. That=E2=80=99s because it did (file-exists? ".guix-profile"), = but this uses stat(2). So here, because .guix-profile was a dangling symlink, it returned #f, even though the symlink actually existed. I fixed it using =E2=80=98lstat=E2=80=99 instead. [...] > 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). Having this empty user environment on disk should not be needed because internally, =E2=80=98profile-manifests=E2=80=99 explicitly checks whether t= he profile exists, and returns an empty manifest if it doesn=E2=80=99t. So I=E2=80=99m committing the patch, minus the above bug. Thanks for the very quick feedback! Ludo=E2=80=99.