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: Wed, 06 Nov 2019 17:42:43 +0100 Message-ID: <87ftj1x8fw.fsf@gnu.org> References: <87mudrxvs8.fsf@ambrevar.xyz> <87mudd59ho.fsf@gnu.org> <877e4glyc3.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]:37799) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSOOQ-0008GV-Ii for guix-devel@gnu.org; Wed, 06 Nov 2019 11:42:53 -0500 In-Reply-To: <877e4glyc3.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Mon, 04 Nov 2019 11:39:40 +0100") 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 Pierre Neidhardt skribis: > Ludovic Court=C3=A8s writes: > >> Another way is: >> >> eval `guix package --search-paths=3Dprefix` >> >> or similar. > > Note that this suffers from the shell compatibility issue, e.g. it won't > work with Fish / Eshell. That can be fixed, as proposed in . >> Another one is: >> >> guix environment =E2=80=A6 > > This is a bit different since it spawns a subshell. Not if you do =E2=80=9C-- some command=E2=80=9D. >>> - 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 anyo= ne >> request it before so I=E2=80=99m curious. > > I'm actually surprised you find it surprising! :) > I can think of Simon, maybe Konrad(?) and myself who mentioned it > before. > > Examples: > > - `guix pack` can only pack ` manifest at a time. Impossible to combine > 2 manifests. > > - Same for guix weather if you want to avoid calling guix weather > multiple times in a row. > > - `guix environment` can work around this limitation by calling the > manifest from the generated subshells. It's not super convenient, and > it does not work for scripts. For instance, we can't do this at the mo= ment: > > guix environment -m manifest1 -m manifest2 -- my command line... > > I'm sure we can come up with tons of examples :) I understand what it is we cannot do; I just hadn=E2=80=99t felt the need f= or it. But yeah, let=E2=80=99s do that! :-) >> Note that =E2=80=9Cad-hoc=E2=80=9D profiles (imperatively-managed profil= es) contain >> provenance info in their =E2=80=98manifest=E2=80=99 file, so it=E2=80=99= s not black and white. > > I actually never noticed this :p It=E2=80=99s sort of a =E2=80=9Chidden=E2=80=9D feature waiting to be put t= o good use. :-) >>> 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 alrea= dy possible?) >> >> Like =E2=80=98specifications->manifest=E2=80=99? > > Can specifications->manifest do this? > > Concrete example: You want a profile to work on IceCat, so you need a > manifest that has all the necessary inputs required to work with Icecat. > How can we automate the generation of the manifest? Ah, that no. But (guix scripts environment) has =E2=80=98package-environment-inputs=E2=80=99, which does exactly that, and = I guess we could expose it and document it. More generally, =E2=80=98guix environment=E2=80=99 was initially designed i= n a quite monolithic fashion, and I think we could expose its functionality in sizable bites. For instance, Dave suggested long ago exposing an data type, and that=E2=80=99s one thing that could be very us= eful. Thanks for starting this insightful brainstorming session! :-) Ludo=E2=80=99.