From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 3/6] emacs: Find packages in system profiles. Date: Wed, 13 Jan 2016 23:42:19 +0100 Message-ID: <87y4btyud0.fsf@gnu.org> References: <1452419630-4399-1-git-send-email-alezost@gmail.com> <1452419630-4399-4-git-send-email-alezost@gmail.com> <878u3ubkzc.fsf@gnu.org> <87pox59pjj.fsf@gmail.com> 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]:42681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJU7V-0002SI-ES for guix-devel@gnu.org; Wed, 13 Jan 2016 17:42:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJU7S-0005aJ-7u for guix-devel@gnu.org; Wed, 13 Jan 2016 17:42:25 -0500 In-Reply-To: <87pox59pjj.fsf@gmail.com> (Alex Kost's message of "Wed, 13 Jan 2016 23:45:36 +0300") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Alex Kost Cc: guix-devel@gnu.org Alex Kost skribis: > Ludovic Court=C3=A8s (2016-01-12 23:28 +0300) wrote: [...] >> It seems you=E2=80=99re calling /run/current-system the system profile, = which >> leads to the =E2=80=98system?=E2=80=99 Boolean here, but the system prof= ile really is >> /run/current-system/profile. > > As we need to work with generations, I use "/var/guix/profiles/system" > instead of a "/run/current-system" link. But you are right, I called it > =E2=80=9Csystem profile=E2=80=9D. > > I think using "/var/guix/profiles/system/profile" wouldn't help to > remove =E2=80=98system?=E2=80=99 boolean. For example: > > (guix-packages-profile "/var/guix/profiles/per-user/me/guix-profile" 3) > =3D> "/var/guix/profiles/per-user/me/guix-profile-3-link" > > (guix-packages-profile "/var/guix/profiles/system/profile" 3) > =3D> "/var/guix/profiles/system/profile-3-link" > > The first one is correct, but the second should be: > =3D> "/var/guix/profiles/system-3-link/profile" > > As you can see we need to distinguish system and usual profiles because > packages are placed in different places for them > ("system-NN-link/profile" and "usual-NN-link" without "profile" subdir), > that's why I added =E2=80=98system?=E2=80=99 argument. I don't see how i= t can be > avoided. Oh you=E2=80=99re right, got it. >> I had overlooked it, but wouldn=E2=80=99t it be easier if patch #2 did: >> >> +(defvar guix-system-profile >> + (concat guix-config-state-directory "/profiles/system/profile") >> + "System profile.") >> >> ? > Not really. > > Both "/var/guix/profiles/system" (which I called =E2=80=9Csystem profile= =E2=80=9D) and > "/var/guix/profiles/system/profile" (which I called =E2=80=9Cpackages pro= file=E2=80=9D) > are needed. The former =E2=80=94 for finding generations, and the latter= =E2=80=94 for > finding packages. > > I actually need "/var/guix/profiles/system" in the first place, so if > =E2=80=98guix-system-profile=E2=80=99 is not an appropriate name for this= variable, it > should be renamed (what name do you suggest?). Indeed, it=E2=80=99s confusing. I don=E2=80=99t have a better name to sugg= est, though. > And about name confusion: now I see that =E2=80=9Cprofile=E2=80=9D should= be used only > for a directory (symlink) with packages. But I always thought that a > directory that has generations can also be named a =E2=80=9Cprofile=E2=80= =9D (apparently > cannot), especially taking into account =E2=80=98profile-generations=E2= =80=99 procedure > from (guix profiles) module: > > (profile-generations "/var/guix/profiles/system") > > That's why ^^^ I called "/var/guix/profiles/system" a system profile. Initially, I would have said that as long as FOO/manifest exists, FOO can be called a profile. That=E2=80=99s the definition of a =E2=80=9Cprofi= le=E2=80=9D in the sense of (guix profiles). Like a profile, /var/guix/profiles/system has generations, but unlike =E2=80=9Creal profiles=E2=80=9D, it is not created by =E2=80=98profile-deri= vation=E2=80=99. The solution in this patch looks good, after all! Thanks for explaining, Ludo=E2=80=99.