From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Reorganizing guix package commands Date: Tue, 19 Apr 2016 15:43:08 +0200 Message-ID: References: <874mazi99k.fsf@gmail.com> <877ffual6i.fsf@gnu.org> <877ffujasf.fsf@gmail.com> <86vb3dycr2.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]:58132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asVw3-0002RY-2g for guix-devel@gnu.org; Tue, 19 Apr 2016 09:43:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asVvw-0001KD-Np for guix-devel@gnu.org; Tue, 19 Apr 2016 09:43:23 -0400 Received: from sinope.bbbm.mdc-berlin.de ([141.80.25.23]:32838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asVvw-0001K6-Bi for guix-devel@gnu.org; Tue, 19 Apr 2016 09:43:16 -0400 In-Reply-To: <86vb3dycr2.fsf@gmail.com> 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: myglc2 Cc: guix-devel@gnu.org myglc2 writes: > Alex Kost writes: > >> Ludovic Court=C3=A8s (2016-04-18 20:20 +0300) wrote: >> >>> Alex Kost skribis: >>> >>>> I've just sent a message to bug#22587=C2=B9, but I realized it is be= tter to >>>> discuss it here in a separate thread. >>>> >>>> So, I think there are inconsistencies in guix commands. For example= , we >>>> have "guix system build" to build a system, but "guix build" to buil= d a >>>> package. IMO "guix package build" would be a better choice. >>>> >>>> In general, I think it would be good to move package commands inside >>>> "guix package", e.g, to make "guix package lint", "guix package size= ", >>>> etc. >>> >>> Why not consider =E2=80=9Cpackage=E2=80=9D to be the default word? := -) >> >> Interesting, but why do we need to have "guix package" at all? Let's >> just use "guix --install", etc. (This is not what I suggest :-)) >> >>> I can see how adding =E2=80=9Cpackage=E2=80=9D everywhere helps categ= orize 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 opi= nion) >> >>> Also, it=E2=80=99s not that simple: =E2=80=9Cguix size=E2=80=9D can t= ake a store item instead of >>> a package name, =E2=80=9Cguix graph=E2=80=9D cannot do it yet but it = would be useful if >>> it could (=E2=80=9Cguix graph -t references $(readlink -f /run/curren= t-system)=E2=80=9D), >>> etc. >> >> Hm, OK, I'm not sure, but let's leave "graph" and "size" alone for now= . >> >>> I still think that having aliases like =E2=80=9Cguix install=E2=80=9D= as 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 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 ... >> >>> There are probably other improvements to do around =E2=80=9Cguix pack= age=E2=80=9D (maybe >>> turning some of its options into separate sub-commands as was suggest= ed >>> before.) All we need is a clear view of where we=E2=80=99re going an= d 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 = | >> | guix edit | guix package definition=C2=B9 = | >> | guix import | guix package import = | >> | guix lint | guix package lint = | >> | guix refresh | guix package refresh = | >> | guix package --show | guix package show = | >> | guix package --search | guix package search = | >> | guix package --list-available | guix package list = | >> |-----------------------------------+---------------------------------= --| >> | guix package --list-generations | guix profile --list-generations = | >> | guix package --list-installed | guix profile --list-installed = | >> | guix package --delete-generations | guix profile --delete-generation= s | >> | guix package --switch-generations | guix profile --switch-generation= s | >> | 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". > > The term 'profile' is used at user- and system- levels: > > 3.1 Features > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > [...] > Instead of referring to these directories, users have their own > =E2=80=9Cprofile=E2=80=9D, which points to the packages that they actua= lly want to use. > These profiles are stored within each user=E2=80=99s home directory, at > =E2=80=98$HOME/.guix-profile=E2=80=99. > > 7.2.2 =E2=80=98operating-system=E2=80=99 Reference > ---------------------------------- > =E2=80=98packages=E2=80=99 (default: %BASE-PACKAGES) > The set of packages installed in the global profile, which is > accessible at =E2=80=98/run/current-system/profile=E2=80=99. > > ... and in home directories: > > /home/user1/.guix-profile -> /var/guix/profiles/per-user/user1/guix-pro= file > /home/user1/.profile > > Making the use of 'profile' here ambiguous. So I suggest that you chang= e > 'guix profile ...' to 'guix user ...' like so: I don=E2=80=99t think it=E2=80=99s ambiguous at all. The system profile = is a profile like any other, so you can, for example, list installed packages like this: guix package -p /run/booted-system/profile \ --list-installed What doesn=E2=80=99t work is to operate on generations because the booted= -system profile is a direct link to a store item; there is no indirection. You also cannot use =E2=80=9C--manifest=E2=80=9D on it because the profile co= ntents are controlled via =E2=80=9Cguix system reconfigure /path/to/config.scm=E2=80= =9D. Rather than making the differences bigger, I think we should unify profile management, i.e. make more of the commands for regular profiles work with the system profile (provided a user has root privileges). > |-----------------------------------+--------------------------------| > | guix package --list-generations | guix user --list-generations | > | guix package --list-installed | guix user --list-installed | > | guix package --delete-generations | guix user --delete-generations | > | guix package --switch-generations | guix user --switch-generations | > | guix package --roll-back | guix user --roll-back | > | guix package --manifest | guix user --manifest | > > and similarly, the above ... > >> guix package install ... >> guix package remove ... > > ... would become ... > > guix user install ... > guix user remove ... I don=E2=80=99t think this is a good idea. In addition to the reasons I = stated above =E2=80=9Cuser=E2=80=9D is even more vague than =E2=80=9Cpackage=E2=80= =9D is. The proposal to use =E2=80=9Cprofile=E2=80=9D for profile-related operations is a very natura= l one. Here at the MDC we are using many different profiles on a regular basis. Multiple profiles is a common use-case. Operating on profiles with =E2=80=9Cguix profile=E2=80=9D seems really appropriate; doing this = via =E2=80=9Cguix user=E2=80=9D is confusing to me. I don=E2=80=99t know what =E2=80=9Cuser=E2=80=9D sta= nds for. ~~ Ricardo