From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] guix: build: Add transitive source building. Date: Sun, 01 Feb 2015 22:02:42 +0100 Message-ID: <87fvapfiq5.fsf@gnu.org> References: <87r3uesmgq.fsf@member.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]:57573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI3zB-0006WB-OX for guix-devel@gnu.org; Sun, 01 Feb 2015 18:31:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YI3z2-0005zO-Gl for guix-devel@gnu.org; Sun, 01 Feb 2015 18:31:25 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI3z2-0005zK-ED for guix-devel@gnu.org; Sun, 01 Feb 2015 18:31:16 -0500 In-Reply-To: <87r3uesmgq.fsf@member.fsf.org> (Eric Bavier's message of "Wed, 28 Jan 2015 14:02:13 -0600") 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: Eric Bavier Cc: guix-devel@gnu.org Eric Bavier skribis: > This patch is intended mostly for discussion. It was brought up again > on IRC yesterday the idea of prefetching package source into the store > in order to be able to hack on guix offline. Excellent! > +(define (package-source* package) > + "List package-source but returns its results as a list" > + (list (package-source package))) What about using the plural, =E2=80=98package-sources=E2=80=99, which makes= it clear that it returns a list? > +(define (package-direct-source package) > + "Return all source origins associated with PACKAGE; including origins = in Likewise, plural. > +(define (package-transitive-source package) > + "Return PACKAGE's direct sources, and its input sources, recursively." Ditto. > I've tested this patch by building e.g. gmsh (which I did not already > have in the store):: > > $ guix build --source=3Dtransitive gmsh > [...] > > $ guix build gmsh Neat! This is indeed the use case that had been discussed with Nikita a while back. > The build succeeded after building the glu, glproto, fltk, and > xf86vidmodeproto inputs from source. I haven't yet tried making a > change that would require rebootstrapping while offline. I think the > idea is that this should work. Yes. > What I'd like to get some feedback on: > > 1. Adding an optional argument to `guix build --source` currently breaks > `guix build -S foo`, since the option parsing thinks "foo" is the > argument for -S. I'm not sure how this could be reconciled. I think this is a problem, perhaps because I=E2=80=99m used to =E2=80=98gui= x build -S foo=E2=80=99 and I wouldn=E2=80=99t want to do more typing for something li= ke this. ;-) I can think of two options to work around it: 1. Add a separate option, say, --sources=3D{transitive,all,package}. 2. Make it a separate command, say =E2=80=98guix prefetch=E2=80=99 with j= ust the option =E2=80=98--sources=3D{transitive,all}=E2=80=99. WDYT? > 2. There might be clearer user/developer-facing names for the arguments. I think that=E2=80=99s fine. > 3. Am I understanding the use-case? I think so. Andreas notes that when one just plans to modify a leaf package while on the train, running something like =E2=80=98guix environment the-leaf -E true=E2=80=99 is enough to fetch the dependencies of that packa= ge. But I think that=E2=80=99s a slightly different use case anyway. Thanks, Ludo=E2=80=99.