From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Emacs interface for Guix Date: Mon, 21 Jul 2014 10:46:08 +0400 Message-ID: <87a983qken.fsf@gmail.com> References: <87zjg9rgih.fsf@gmail.com> <871ttlgzfl.fsf@gnu.org> <87vbqxqg3n.fsf@gmail.com> <87ha2fm3gk.fsf@gnu.org> <87r41hrdks.fsf@gmail.com> <8738dxe2jq.fsf@gnu.org> <87mwc4qzd5.fsf@gmail.com> <878uno9l7b.fsf@gnu.org> <87iomsq8fe.fsf@gmail.com> <874myb95j0.fsf@gnu.org> 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]:42925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X97MW-0008Gs-J1 for guix-devel@gnu.org; Mon, 21 Jul 2014 02:46:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X97MN-0003M4-G4 for guix-devel@gnu.org; Mon, 21 Jul 2014 02:46:16 -0400 In-Reply-To: <874myb95j0.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 20 Jul 2014 21:47:15 +0200") 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Ludovic Court=C3=A8s (2014-07-20 23:47 +0400) wrote: > Alex Kost skribis: > >> Ludovic Court=C3=A8s (2014-07-20 18:08 +0400) wrote: >> >>> Alex Kost skribis: >>> >>>> Yes, that's what concerned me since the very beginning =E2=80=93 uniqu= e entities >>>> should have unique identifiers, i.e. ideally there should be an >>>> easy-to-get ID for every package. But as I'm using a non-unique >>>> =E2=80=98name-version=E2=80=99 spec to "identify" a package, informati= on about installed >>>> outputs is displayed for every matching package. >>> >>> OK. At the Scheme level, package objects are unique of course; but at >>> the UI level, we can=E2=80=99t guarantee that there=E2=80=99s a single = package for each >>> name/version pair (and this is not even desirable, I think.) >> >> I don't say that name+version should identify a package, but I think it >> would be very convenient to have an ID for a package definition. For > > [...] > >> What if to make some =E2=80=98get-package-by-id=E2=80=99 function that w= ill always >> return a single package? And there is no need to add IDs for all >> package definitions, as most of them are identified with name+version >> already. What I suggest is to add an optional =E2=80=9Cpostfix=E2=80=9D= field to >> record, so that a combination =E2=80=9Cname+version+[postfix]= =E2=80=9D will be >> unique and will be returned by =E2=80=98package-id=E2=80=99 like this: >> >> (package-id #) =3D=3D> "= guile-2.0.11" >> (package-id #) =3D=3D> "= guile-2.0.11_base" >> >> And also to add this ID to the manifest entries. >> >> I believe all this will not break current functionality but it may be >> very useful. What do you think? > > I think it would be just another hand-maintained identifier database, > thereby suffering from the very same problems as name+version. > > But there=E2=80=99s already a 100% unique identifier that can be relied o= n: the > directory name of outputs. When the directory name(s) of an installed > package match that of a package from the distro, you can tell they=E2=80= =99re > the same. When they don=E2=80=99t all you know is that it=E2=80=99s a di= fferent > package. > > Remember that packages can be generated programmatically (see > =E2=80=98static-package=E2=80=99 & co.), and they users can install packa= ges from their > own recipes. There=E2=80=99s no notion of having a central unique package > database. > > So I think the UI must be able to cope with that: it has package names > as nice human-readable identifiers, but it cannot map back from an > installed package to its recipe and... A directory name identifies the output but not a package definition. I think current situation is very confusing to users. A user can't even install any package. What if he wants to install =E2=80=9Cguile=E2=80=9D f= rom =E2=80=9Cbase.scm=E2=80=9D? It will not be possible to install the exact p= ackage with any UI, the only way is to use a guile REPL directly. And I would say the names are not really package names, they are program names, so with =E2=80=9Cguix package -i ...=E2=80=9D a user installs a prog= ram, not a particular package. If there were a =E2=80=9Cunique-name=E2=80=9D field, a= user would be able to install a real package: =E2=80=9Cguix package -i guile-base-2.0.= 11=E2=80=9D. I strongly believe this is a problem. You can see the packages that you can't install or even worse =E2=80=9Cguix package --list-installed=E2=80=9D= may tell you that you have several =E2=80=9Cfoo-1.0:out=E2=80=9D installed. Actually wh= en I saw the packages with the same name/version the first time, I thought it's a bug. Anyway, if nothing can be done here, so be it; but any UI will be confusing for these reasons. P.S. If not all packages are supposed to be installed by the end user, perhaps it would be good to mark those somehow (for example to make an optional =E2=80=9Cinternal=E2=80=9D field) and to add =E2=80=9C--hide-inter= nals=E2=80=9D or =E2=80=9C--show-internals=E2=80=9D option to =E2=80=9Cguix package=E2=80=9D= command. If a user make his own package with the name that already exists, it is his problem. How is he going to distinguish these packages when he uses =E2=80=9Cguix=E2=80=9D script (or more generally any UI except of the guile= REPL itself)?