From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: [PATCH] scripts: package: Add --install-from-file option. Date: Tue, 18 Aug 2015 20:17:55 -0400 Message-ID: References: <8737zs78rs.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87si7ggzsd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a1137a82865dbb2051d9ef749 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRr4q-00021L-8C for guix-devel@gnu.org; Tue, 18 Aug 2015 20:18:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRr4m-0001Gj-VK for guix-devel@gnu.org; Tue, 18 Aug 2015 20:18:00 -0400 Received: from mail-yk0-f176.google.com ([209.85.160.176]:36676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRr4m-0001GV-Q4 for guix-devel@gnu.org; Tue, 18 Aug 2015 20:17:56 -0400 Received: by ykfw73 with SMTP id w73so122351350ykf.3 for ; Tue, 18 Aug 2015 17:17:56 -0700 (PDT) In-Reply-To: <87si7ggzsd.fsf@gnu.org> 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: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: guix-devel --001a1137a82865dbb2051d9ef749 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Aug 18, 2015 at 3:30 PM, Ludovic Court=C3=A8s wrote: > David Thompson skribis: > >> In my personal projects, I keep a 'package.scm' file in the root of the >> source tree for use with 'guix environment -l'. However, it's also >> handy to install that package by using 'guix package -e': >> >> guix package -e '(primitive-load "package.scm")' >> >> This patch adds a shorthand for this: >> >> guix package -f package.scm > > Makes sense. > >> The motivation for this is to ultimately encourage other people to keep >> a 'package.scm' file in their own repos for building reproducible >> development environments and easily testing development snapshots, like >> what we do with our 'guix-devel' package. > > Nice. The bottom line though is that we don=E2=80=99t quite guarantee st= ability > of the =E2=80=9CAPI=E2=80=9D of the package modules. Understood. In practice, I haven't found this to be a big deal. I provide package.scm files in all of my projects now and it's been a huge win for making it easier to quickly get hacking on a new machine. >> I'd like to add the same option for 'guix build', if this is approved. > > Sure. Great. :) >> From 07c9b35facf810872f3bc8342e18b33033714adf Mon Sep 17 00:00:00 2001 >> From: David Thompson >> Date: Sun, 9 Aug 2015 11:35:51 -0400 >> Subject: [PATCH] scripts: package: Add --install-from-file option. >> >> * guix/scripts/package.scm (show-help): Add help text for --install-from= -file >> option. >> (%options): Add --install-from-file option. >> * doc/guix.texi ("invoking guix package"): Document it. > > [...] > >> +(use-modules (guix packages) >> + (guix download) >> + (guix build-system gnu) >> + (guix licenses)) > > Just (use-modules (guix) (guix licenses))? I needed: (use-modules (guix) (guix build-system gnu) (guix licenses)) > Can you put the example in a separate file (like > doc/environment-gdb.scm)? That will allow us to easily check that the > file is indeed valid. Done. >> + (arguments `(#:configure-flags '("--enable-silent-rules"))) >> + (inputs `(("gawk" ,gawk))) > > I think these two lines can be removed. Yeah. BTW, I copy/pasted this from the "Defining Packages" section, and that example appears to be broken because it doesn't import the (gnu packages gawk) module. >> +@end example > > Here it would be good to add a sentence or two like the paragraph you > wrote above about the motivation for all this. Added a sentence about it. > Could you send an updated patch? Attached. Thanks for the review. - Dave --001a1137a82865dbb2051d9ef749 Content-Type: text/x-patch; charset=US-ASCII; name="0001-scripts-package-Add-install-from-file-option.patch" Content-Disposition: attachment; filename="0001-scripts-package-Add-install-from-file-option.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_idi15v500 RnJvbSA0NzFmZmYxODJiNjMyZmMzYjZmOTk5MjVmZjZjN2JkMjU4NTBhODQxIE1vbiBTZXAgMT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UtZXhwcmVzc2lv biBhcmcpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQpCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAjZikpKQorICAgICAgICAgKG9wdGlvbiAnKCNcZiAi aW5zdGFsbC1mcm9tLWZpbGUiKSAjdCAjZgorICAgICAgICAgICAgICAgICAobGFtYmRhIChvcHQg bmFtZSBhcmcgcmVzdWx0IGFyZy1oYW5kbGVyKQorICAgICAgICAgICAgICAgICAgICh2YWx1ZXMg KGFsaXN0LWNvbnMgJ2luc3RhbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChsb2FkKiBhcmcgKG1ha2UtdXNlci1tb2R1bGUgJygpKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICNmKSkpCiAgICAgICAgICAob3B0aW9uICcoI1xyICJyZW1vdmUiKSAjZiAjdAogICAgICAgICAg ICAgICAgICAobGFtYmRhIChvcHQgbmFtZSBhcmcgcmVzdWx0IGFyZy1oYW5kbGVyKQogICAgICAg ICAgICAgICAgICAgIChsZXQgYXJnLWhhbmRsZXIgKChhcmcgYXJnKSAocmVzdWx0IHJlc3VsdCkp Ci0tIAoyLjQuMwoK --001a1137a82865dbb2051d9ef749--