From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Improving the usability of 'guix environment' Date: Tue, 10 Feb 2015 22:23:29 +0100 Message-ID: <87bnl1zcj2.fsf@gnu.org> References: <87fvadhg1d.fsf@fsf.org> <87lhk51xxa.fsf@gnu.org> <87a90lhcup.fsf@fsf.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]:44623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLIHS-0004nX-7r for guix-devel@gnu.org; Tue, 10 Feb 2015 16:23:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLIHM-0000y8-QT for guix-devel@gnu.org; Tue, 10 Feb 2015 16:23:38 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLIHM-0000y1-NS for guix-devel@gnu.org; Tue, 10 Feb 2015 16:23:32 -0500 In-Reply-To: <87a90lhcup.fsf@fsf.org> (David Thompson's message of "Tue, 10 Feb 2015 12:53:50 -0500") 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: David Thompson Cc: guix-devel@gnu.org David Thompson skribis: > Ludovic Court=C3=A8s writes: > >> David Thompson skribis: >> >>> But all of that boilerplate is unnecessary since it's not possible to >>> actually build the package successfully without a proper hash of the >>> source AFAICT. Really, I would rather just use a simple list of >>> packages: >>> >>> (list autoconf automake guile-2.0 guile-json libgcrypt) >> >> What about adding a case for the handling of =E2=80=98-l=E2=80=99 such t= hat, if the file >> evaluates to a list of packages, it does what you suggest? > > I'm hesitant to do that, because I would also like for a list of > packages to be usable for building the environment as it's done > currently. Only allowing a single package in a file is a limitation > right now. Yeah. >>> I propose adding a new flag that indicates whether we want the packages >>> themselves or their inputs in the environment. If we assume that the >>> default behavior is to include the packages themselves, a --inputs flag >>> could indicate to use the package(s) inputs instead: >>> >>> guix environment --inputs emacs >> >> That makes sense. >> >> In terms of UI, what about rather something keeping an interface close >> to that of =E2=80=98guix package=E2=80=99: >> >> guix environment -i guile guile-sdl >> # semantically equivalent to =E2=80=98guix package -i guile guile-sdl= =E2=80=99 > > So without the -i switch, it would behave as it does now? Okay, but I > guess I would prefer to optimize for the common case, which in my case > would be having -i on by default. > >> Now that I think of it, we could even move -E to =E2=80=98guix package= =E2=80=99 itself: >> that would make it easy to create a scratch environment based on an >> existing profile. > > I'm a bit confused about that. Are you suggesting we merge 'guix > environment' into 'guix package'? A possibility might be to: =E2=80=A2 keep =E2=80=98guix environment=E2=80=99 as is; after all, =E2= =80=98guix environment emacs=E2=80=99 really reads as =E2=80=9Cthe environment for [the development of] Emacs= =E2=80=9D; =E2=80=A2 add a -E option to =E2=80=98guix package=E2=80=99 (like the -E = of =E2=80=98guix environment=E2=80=99). Example: # start a shell where guile and guile-sdl are available in addition to # what=E2=80=99s in ~/.guix-profile $ guix package -i guile guile-sdl -E $SHELL # start a shell where only guile and guile-sdl are available $ guix package -i guile guile-sdl --scratch -E $SHELL # start a shell in an environment which is my profile minus emacs # plus vim and with an upgraded zile $ guix package -r emacs -i vim -u zile --pure -E $SHELL Hmm. I=E2=80=99ve not completely convinced myself. Maybe keeping it in =E2=80=98guix environment=E2=80=99 is wiser. I=E2=80= =99m not quite sure that changing the default behavior is desirable though. Thoughts? Ludo=E2=80=99.