From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Reorganizing guix package commands Date: Wed, 20 Apr 2016 11:29:43 +0300 Message-ID: <87a8ko7keg.fsf@gmail.com> References: <874mazi99k.fsf@gmail.com> <877ffual6i.fsf@gnu.org> <877ffujasf.fsf@gmail.com> <8737qh1tqm.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]:37002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asnW7-0006EA-4S for guix-devel@gnu.org; Wed, 20 Apr 2016 04:29:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asnW3-0006be-Sr for guix-devel@gnu.org; Wed, 20 Apr 2016 04:29:47 -0400 In-Reply-To: <8737qh1tqm.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 19 Apr 2016 17:52:17 +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" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Ludovic Court=C3=A8s (2016-04-19 18:52 +0300) wrote: > Alex Kost skribis: > >> Ludovic Court=C3=A8s (2016-04-18 20:20 +0300) wrote: > > [...] > >>> I can see how adding =E2=80=9Cpackage=E2=80=9D everywhere helps categor= ize things >>> mentally, but as a user interface, I think it would be rather bad. >> >> As a user, I think it would be rather good. (This is just my user opini= on) > > To clarify, what I meant is that forcing users to type an additional > word for common operations just for the beauty of categorization sounds > unwise to me. OK, I don't see it as "additional words", rather as "required words". Typing "guix lint" for me is the same as "ip add". It doesn't make sense: "add" what? It should be "ip address add"! (and "guix package lint"). > For instance, I=E2=80=99m happy I can type =E2=80=98ls=E2=80=99 rather th= an =E2=80=98gnu core file list=E2=80=99. > :-) But we have a single "guix" command, while coreutils has many of them. It is probably a matter of taste: I prefer to use a single and complex "ip" command instead of route/ifconfig/netstat/... > Similarly, it=E2=80=99s not immediately obvious to me that something like= =E2=80=9Cguix > package edit=E2=80=9D and =E2=80=9Cguix package install=E2=80=9D would he= lp newcomers. > > On the contrary, they would likely violate the rule of least surprise: > most other tools provide sub-commands like =E2=80=9Cinstall=E2=80=9D, som= e provide > =E2=80=9Cedit=E2=80=9D and =E2=80=9Cbuild=E2=80=9D as well, without furth= er categorization. It's because the other tools are poor, unfeatureful and unorganized :-) I see "guix" as a more general tool than most others: it does not operates only on packages, it does many other things, so it should have reasonable subgroups, and (IMO) there shouldn't be such things as "guix install" or "guix edit". >>> Also, it=E2=80=99s not that simple: =E2=80=9Cguix size=E2=80=9D can tak= e a store item instead of >>> a package name, =E2=80=9Cguix graph=E2=80=9D cannot do it yet but it wo= uld be useful if >>> it could (=E2=80=9Cguix graph -t references $(readlink -f /run/current-= system)=E2=80=9D), >>> etc. >> >> Hm, OK, I'm not sure, but let's leave "graph" and "size" alone for now. > > But there are many other similar cases. For instance, =E2=80=98guix buil= d=E2=80=99 can > be passed a .drv; =E2=80=98guix archive=E2=80=99 can be passed a package = name or a store > file name, etc. > > Passing package names is a mere convenience for many of these commands; > fundamentally, many operate on store items, derivations, etc. > > This requires careful consideration. Definitely, I just raised some concerns and inconveniences I have using "guix" command in a hope that it will lead to something productive. OK, (although I still think that "guix package build" is better than "guix build"), what about moving to "guix package" only those actions that operate only on packages ("edit", "lint" and "refresh") or relate only to packages ("import")? >>> I still think that having aliases like =E2=80=9Cguix install=E2=80=9D a= s Andy proposed >>> long ago would be useful, though I never started working on it. >> >> I agree! Except I think they should be inside "guix package": >> >> guix package install ... >> guix package remove ... > > As I view it, the sole purpose of =E2=80=9Cguix install=E2=80=9D and simi= lar is to make > it easier for newcomers to get started (see ), > and to allow users in general to type less. > > Adding =E2=80=9Cpackage=E2=80=9D in the middle would probably defeat that= goal. OK, I see; then I don't like it. Actually I don't really like to duplicate (make aliases for) commands. So if there will be "guix profile remove", then I wouldn't like to have "guix package remove" or "guix remove". >> As for the transactional operations (I mean remove/install in one >> command), I think we can do it in a separate "guix profile" command: >> >> guix profile --install ... --remove ... > > This sounds good to me. > >>> There are probably other improvements to do around =E2=80=9Cguix packag= e=E2=80=9D (maybe >>> turning some of its options into separate sub-commands as was suggested >>> before.) All we need is a clear view of where we=E2=80=99re going and = patches. :-) >> >> Here is the summary of the changes I think it would be good to have: >> >> | Replace this: | With this: | >> |-----------------------------------+-----------------------------------| >> | guix build | guix package build | > > I don=E2=80=99t like this one, for the reasons given above. OK. >> | guix edit | guix package definition=C2=B9 = | >> | guix import | guix package import | >> | guix lint | guix package lint | >> | guix refresh | guix package refresh | > > I suppose the benefit would be that users can type =E2=80=98guix package = help=E2=80=99 > and see all the sub-commands that relate to packages, right? I didn't have this in mind, but it would be a good thing indeed. As I wrote above, these commands relate only to packages, you lint/edit a *package*, and you import a *package* definition. >> | guix package --show | guix package show | >> | guix package --search | guix package search | >> | guix package --list-available | guix package list | > > Or just =E2=80=98guix show=E2=80=99, =E2=80=98guix search=E2=80=99, etc.? As for me, this would be worse than it is now. You show/search packages, not systems or licenses or whatever, so I think such things should be subcommands for "guix package". >> |-----------------------------------+-----------------------------------| >> | guix package --list-generations | guix profile --list-generations | >> | guix package --list-installed | guix profile --list-installed | >> | guix package --delete-generations | guix profile --delete-generations | >> | guix package --switch-generations | guix profile --switch-generations | >> | guix package --roll-back | guix profile --roll-back | >> | guix package --manifest | guix profile --manifest | > >> =C2=B9 "edit" name is confusing: >> >> Maybe instead of --list-generations and others, these options should >> transform into subcommands (list-generations) of "guix profile". > > I agree. But what should we do of transactions? Yes, that's a problem. I don't have a clean picture of this. Maybe this: guix profile list-packages guix profile list-generations guix profile delete-generations guix profile switch-generation guix profile roll-back guix profile upgrade For simple installing/removing: guix profile {add/install} PACKAGES... guix profile remove PACKAGES... Complex transactions may be put in another subcommand, e.g.: guix profile manifest --install=3DPACKAGES,... --remove=3DPACKAGES,... For manifest from file: guix profile manifest --file=3D... Actually I don't really like all this, but I don't have better ideas, so a simple decision for now (if it's reasonable) would be just separating profile-related commands. I mean moving the mentioned options from "guix package" to "guix profile". --=20 Alex