From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: Profiles/manifests-related command line interface enhancements Date: Sun, 03 Nov 2019 15:18:27 +0100 Message-ID: <87mudd59ho.fsf@gnu.org> References: <87mudrxvs8.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35584) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRGi5-0004WS-R0 for guix-devel@gnu.org; Sun, 03 Nov 2019 09:18:31 -0500 In-Reply-To: <87mudrxvs8.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Wed, 23 Oct 2019 18:37:43 +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: Pierre Neidhardt Cc: guix-devel@gnu.org Hi Pierre! Thanks for looking into this! (And sorry for being late to the party. :-)) Pierre Neidhardt skribis: > - Activate a profile with =3Dguix activate /path/to/profile=3D. > Right now, the most appropriate way to activate a profile is > > GUIX_PROFILE=3D"$profile" ; . "$profile"/etc/profile > Another way is: eval `guix package --search-paths=3Dprefix` or similar. Another one is: guix environment =E2=80=A6 > But this is flawed: it exposes implementation details plus it fails to > set important variables like MANPATH or INFOPATH if man-db / > info-reader or not installed in the said profile. See /etc/profile > for the full list of what =3Dguix activate=3D should do. The MANPATH issue is orthogonal so I don=E2=80=99t think we should bring it= up in this context. See for context. > - The inverse command, =3Dguix deactivate /path/to/profile=3D. > This can be useful to deactivate a profile that was activated during lo= gin. The activate/deactivate is similar to what CONDA does (from what I understand; I=E2=80=99ve never used it) and similar to =E2=80=9Cmodule load= =E2=80=9D with . It=E2=80=99s a nice pattern, though I t= hink it=E2=80=99s easy to lose track of what=E2=80=99s activated and what not, a= nd it=E2=80=99s tricky to define =E2=80=98deactivate=E2=80=99 correctly. Regarding environment variables, =E2=80=9Cmodule=E2=80=9D uses a trick wher= e (roughly) =E2=80=9Cmodule=E2=80=9D itself is a shell function, such that it can adjus= t the environment variables of the shell that invokes it. We could do something similar, though that would be limited to POSIX shells I guess. > - All commands that accept manifests should be able to compose manifests > by passing multiple =3D--manifest FILE=3D options. Do you have a use case? :-) Sounds like something quite easy to do but I=E2=80=99ve never heard anyone request it before so I=E2=80=99m curious. > - Auto-update manifests when calling =3Dguix package -m manifest.scm -i > foo -r bar=3D. This would make users more inclined to user manifests > even for "quick and dirty" installs. See next point. > > This means we need to edit the code, but that's doable since the last > form of manifest.scm must evaluate to a manifest. So we could proceed > as follows: > > + If the last form is a spec, edit the list directly. > + If not, then wrap the last form in the appropriate `manifest-add' / > `manifest-remove' calls, e.g. > > (manifest-add "foo" > (manifest-delete "bar" > my-manifest)) Could be fun, but=E2=80=A6 needs more thought. > - Use a default manifest by default with =3Dguix install=3D and =3Dguix > remove=3D. This way would basically get rid of "ad-hoc" profiles which > has so many flaws (non-reproducible, non-trackable, etc.). Ambitious! Note that =E2=80=9Cad-hoc=E2=80=9D profiles (imperatively-managed profiles)= contain provenance info in their =E2=80=98manifest=E2=80=99 file, so it=E2=80=99s n= ot black and white. > Last, one that's at the Scheme level: > > - A Scheme function to create a manifest for the necessary inputs of a > package, like =3Dguix environment PACKAGE=3D does. (Maybe it's already= possible?) Like =E2=80=98specifications->manifest=E2=80=99? I think we should isolate different actionable items from this list and work on them independently, to the extent possible. Note that another option is to overhaul =E2=80=98guix environment=E2=80=99 = like David proposed a while back: https://lists.gnu.org/archive/html/guix-devel/2017-08/msg00300.html I very much like those ideas, and I like the idea of making =E2=80=98guix environment=E2=80=99 central (as opposed to offering more ways to manage environments.) It=E2=80=99s not completely the same goals as what you=E2= =80=99re looking for, but there=E2=80=99s some overlap. Food for thought! Thanks, Ludo=E2=80=99.