From unknown Sun Jun 15 08:54:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#39444] [PATCH] guix build: Add '--manifest' option. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Feb 2020 20:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39444 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39444@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158093302725974 (code B ref -1); Wed, 05 Feb 2020 20:04:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Feb 2020 20:03:47 +0000 Received: from localhost ([127.0.0.1]:46757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izQti-0006kn-QB for submit@debbugs.gnu.org; Wed, 05 Feb 2020 15:03:47 -0500 Received: from lists.gnu.org ([209.51.188.17]:51838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izQth-0006kg-Vb for submit@debbugs.gnu.org; Wed, 05 Feb 2020 15:03:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46079) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izQtg-0000xl-CE for guix-patches@gnu.org; Wed, 05 Feb 2020 15:03:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,SPOOFED_FREEMAIL,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izQte-0001cz-Tr for guix-patches@gnu.org; Wed, 05 Feb 2020 15:03:40 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:58793) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izQte-0001OX-Hd for guix-patches@gnu.org; Wed, 05 Feb 2020 15:03:38 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 36600781 for ; Wed, 5 Feb 2020 15:03:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 05 Feb 2020 15:03:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=fm2; bh=/BMW6YfQmeWU4qWGWrJhvunjZW 0gD/lAds1hBLVdN6M=; b=HPxg1vaGhPS3trgtuptjTXpQesEEOzzlZhLwbPwZqF JmuGFNAGdI2JVg8RFPCK3kYOiWkrzcmjZSMtof3O6cVsWr2T8x4iYa3Z1AMvMPq0 FmNZNqGGOuE81+gC4t36B8IdmcgJy9/mAXF4ecO04P3Ps1+lI45vy5Lmdc3hC2b2 WkMQbrxGELw8aehPpAOYbUpQ8X9aN2F7i1l5/8SS7BYeljYIibqv0zQeFAJ2DseU 5XBvvcAE2hswJKzTjfS7ogpVXmI5jEjzlOC+6p+sIOeULbu1qjqAL7RHVA6xPXUI JKSlUFzcSyaG/nDvfKN+b8gIZZeJET1x5G5l2GlyqP7Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=/BMW6Y fQmeWU4qWGWrJhvunjZW0gD/lAds1hBLVdN6M=; b=Iq+bafOcw7WJusPJ0GKQNZ itk4Ak4gJMOMdFabPBpc3kNEopXF1dvMsbhOREJiP+vak40wAENw/nAF0zDx8Oai pUOF32+rplJuWxVCd3JLeoc/FMpOML2YzLIba8W4XtxjfavMuJno2ZMdrGbdHWD7 l1h+020zWYSstyAAUWR+u50gpkI1YnnK9KYirq/1QbX/6osl2vAhgIgXBfSPHuJf LE0v0aaN8OYNjCp1sz12zeAya/GqFH1pMeXl7eaA3YHxrzrMMpQ2kNU43Ff88T9o 7JEWheK2aoHgI6HHt17N+MvXe544jCsOGpGb7XPdiF1BE+8nMbTnwH5beB833HxQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrhedugdduvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpeforghrihhushcuuegrkhhkvgcuoehmsggrkhhkvgesfhgrshht mhgrihhlrdgtohhmqeenucfkphepkeegrddvtddvrdeiledrvdehfeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmsggrkhhkvgesfhgrshht mhgrihhlrdgtohhm X-ME-Proxy: Received: from localhost (ti0006q161-3035.bb.online.no [84.202.69.253]) by mail.messagingengine.com (Postfix) with ESMTPA id 62C9330606FB for ; Wed, 5 Feb 2020 15:03:35 -0500 (EST) From: Marius Bakke Date: Wed, 5 Feb 2020 21:03:33 +0100 Message-Id: <20200205200333.8309-1-mbakke@fastmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.19 X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/build.scm (show-help): Document --manifest argument. (options->things-to-build): When given a manifest, evaluate all the entries. * tests/guix-build.sh: Add test for --manifest. * doc/g [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: fastmail.com] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (mbakke[at]fastmail.com) 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 SPOOFED_FREEMAIL No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/scripts/build.scm (show-help): Document --manifest argument. (options->things-to-build): When given a manifest, evaluate all the entries. * tests/guix-build.sh: Add test for --manifest. * doc/guix.texi (Additional Build Options): Mention --manifest. * etc/completion/bash/guix: Complete file name if 'guix build' argument is -m. --- doc/guix.texi | 7 ++++++- etc/completion/bash/guix | 2 +- guix/scripts/build.scm | 19 +++++++++++++++++++ tests/guix-build.sh | 9 +++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 956c25ba9e..f25943789b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -46,7 +46,7 @@ Copyright @copyright{} 2017, 2018 Carlo Zancanaro@* Copyright @copyright{} 2017 Thomas Danckaert@* Copyright @copyright{} 2017 humanitiesNerd@* Copyright @copyright{} 2017 Christopher Allan Webber@* -Copyright @copyright{} 2017, 2018, 2019 Marius Bakke@* +Copyright @copyright{} 2017, 2018, 2019, 2020 Marius Bakke@* Copyright @copyright{} 2017, 2019 Hartmut Goebel@* Copyright @copyright{} 2017, 2019, 2020 Maxim Cournoyer@* Copyright @copyright{} 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice@* @@ -8427,6 +8427,11 @@ As an example, @var{file} might contain a package definition like this @include package-hello.scm @end lisp +@item --manifest=@var{manifest} +@itemx -m @var{manifest} +Build all packages listed in the given @var{manifest} +(@pxref{profile-manifest, @option{--manifest}}). + @item --expression=@var{expr} @itemx -e @var{expr} Build the package or derivation @var{expr} evaluates to. diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index edfb627e87..0333bfc8a2 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix @@ -178,7 +178,7 @@ _guix_complete () _guix_complete_installed_package "$word_at_point" elif _guix_is_command "build" then - if _guix_is_dash_L + if _guix_is_dash_L || _guix_is_dash_m then _guix_complete_file else diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index f054fc2bce..eedf6bf6a8 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2013 Mark H Weaver +;;; Copyright © 2020 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,7 @@ #:use-module (guix monads) #:use-module (guix gexp) + #:use-module (guix profiles) #:autoload (guix http-client) (http-fetch http-get-error?) #:use-module (ice-9 format) #:use-module (ice-9 match) @@ -680,6 +682,9 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n")) -f, --file=FILE build the package or derivation that the code within FILE evaluates to")) (display (G_ " + -m, --manifest=FILE build the packages that the manifest given in FILE + evaluates to")) + (display (G_ " -S, --source build the packages' source derivations")) (display (G_ " --sources[=TYPE] build source derivations; TYPE may optionally be one @@ -768,6 +773,9 @@ must be one of 'package', 'all', or 'transitive'~%") (option '(#\f "file") #t #f (lambda (opt name arg result) (alist-cons 'file arg result))) + (option '(#\m "manifest") #t #f + (lambda (opt name arg result) + (alist-cons 'manifest arg result))) (option '(#\n "dry-run") #f #f (lambda (opt name arg result) (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) @@ -804,6 +812,14 @@ build---packages, gexps, derivations, and so on." (for-each validate-type lst) lst)) + ;; Note: Taken from (guix scripts refresh). + (define (manifest->packages manifest) + "Return the list of packages in MANIFEST." + (filter-map (lambda (entry) + (let ((item (manifest-entry-item entry))) + (if (package? item) item #f))) + (manifest-entries manifest))) + (append-map (match-lambda (('argument . (? string? spec)) (cond ((derivation-path? spec) @@ -827,6 +843,9 @@ build---packages, gexps, derivations, and so on." (list (specification->package spec))))) (('file . file) (ensure-list (load* file (make-user-module '())))) + (('manifest . manifest) + (manifest->packages + (load* manifest (make-user-module '((guix profiles) (gnu)))))) (('expression . str) (ensure-list (read/eval str))) (('argument . (? derivation? drv)) diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 21b6af4395..c1df6db3a4 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -1,5 +1,6 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2012, 2013, 2014, 2016, 2017, 2018, 2019 Ludovic Courtès +# Copyright © 2020 Marius Bakke # # This file is part of GNU Guix. # @@ -308,6 +309,14 @@ cat > "$module_dir/gexp.scm"< "$module_dir/manifest.scm"<manifest '("hello" "guix")) +EOF +test `guix build -d --manifest="$module_dir/manifest.scm" \ + | grep -e '-hello-' -e '-guix-' \ + | wc -l` -eq 2 rm "$module_dir"/*.scm # Using 'GUIX_BUILD_OPTIONS'. -- 2.25.0 From unknown Sun Jun 15 08:54:25 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Marius Bakke Subject: bug#39444: closed (Re: [bug#39444] [PATCH] guix build: Add '--manifest' option.) Message-ID: References: <87k14p6rg2.fsf@devup.no> <20200205200333.8309-1-mbakke@fastmail.com> X-Gnu-PR-Message: they-closed 39444 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 39444@debbugs.gnu.org Date: Fri, 14 Feb 2020 16:54:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1581699241-18549-1" This is a multi-part message in MIME format... ------------=_1581699241-18549-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #39444: [PATCH] guix build: Add '--manifest' option. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 39444@debbugs.gnu.org. --=20 39444: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D39444 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1581699241-18549-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 39444-done) by debbugs.gnu.org; 14 Feb 2020 16:53:42 +0000 Received: from localhost ([127.0.0.1]:34617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2eDm-0004oe-Gr for submit@debbugs.gnu.org; Fri, 14 Feb 2020 11:53:42 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:48431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2eDl-0004oT-IY for 39444-done@debbugs.gnu.org; Fri, 14 Feb 2020 11:53:41 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 6568A21B03 for <39444-done@debbugs.gnu.org>; Fri, 14 Feb 2020 11:53:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 14 Feb 2020 11:53:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=cDsUuthRO+WlmJ8r8CffV5e4Ru tJDcHodkmuVrlBCGc=; b=pfpzMeqeJKAsciKic/b0blBbil/COddlfASZtPX48I j/rARgFbuo/x61cfT6AwheNettP1uX295oaca7In9ACWyznhreWmFItpbjctc6ET tfgrA6ZGx3tl5ZPqVipxc72eKczKm12ZpPIM7kfHZUJX+pZTPLAYC66U99zivJPc hyi5VQfJIdzrVYPa0LDHcGGNxkb5R6Seo1S7PRGVR1DwLDIOO09m1mdqTC8p58nl DtMGRgrRoautAYT4bgA1OOoQUp0lLlICjBzNKkzH04IbL3ml7+3N1CBy/bJsytQZ 5wulNz/bhSCvR///ZXbglotIbTz5zWcqK3lICcT6psow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=cDsUut hRO+WlmJ8r8CffV5e4RutJDcHodkmuVrlBCGc=; b=F0pkktQjTYcM++X3enFy6m 218+k70w5Y4jq4Lfzt74qcW3RWIECQfp1MxkeedrIfSZxLaPrN/tcl9SnOmPNyL4 CLVSs3zWicSpkgOH+ECE2dqUcwweOs0vgJ03OU6CbAtlDSBYpTm5WsU2BdpVSzK6 SUAThSi19Sjgtakw6NXm3hRgwjXScEQdx348w78mzWjfk0nr5SsLK6/E9znoZB78 7DgWPp/gnw+4ScrxnUkJYAGPFgD9w8c7VkK74rxqIURUPLrR2pZStCg2Q3a1LYKA ae+wCye3nc2YeDQaCo/Dc0/IyxDW3U2a9FfKp8o2JllBjRYW2X6VzEREbLpGhGJA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjedtgdelhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufgjfhgffffkgggtsehgtderre dtredtnecuhfhrohhmpeforghrihhushcuuegrkhhkvgcuoehmsggrkhhkvgesfhgrshht mhgrihhlrdgtohhmqeenucfkphepkeegrddvtddvrdeikedrjeehnecuvehluhhsthgvrh fuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepmhgsrghkkhgvsehfrghsthhm rghilhdrtghomh X-ME-Proxy: Received: from localhost (ti0006q161-2604.bb.online.no [84.202.68.75]) by mail.messagingengine.com (Postfix) with ESMTPA id DA76E3060BE4 for <39444-done@debbugs.gnu.org>; Fri, 14 Feb 2020 11:53:35 -0500 (EST) From: Marius Bakke To: 39444-done@debbugs.gnu.org Subject: Re: [bug#39444] [PATCH] guix build: Add '--manifest' option. In-Reply-To: <20200205200333.8309-1-mbakke@fastmail.com> References: <20200205200333.8309-1-mbakke@fastmail.com> User-Agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Fri, 14 Feb 2020 17:53:33 +0100 Message-ID: <87k14p6rg2.fsf@devup.no> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39444-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Marius Bakke writes: > * guix/scripts/build.scm (show-help): Document --manifest argument. > (options->things-to-build): When given a manifest, evaluate all the entries. > * tests/guix-build.sh: Add test for --manifest. > * doc/guix.texi (Additional Build Options): Mention --manifest. > * etc/completion/bash/guix: Complete file name if 'guix build' argument is > -m. Pushed in 11415d35064cdba5cec1139aede18099cfa14547. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl5G0I0ACgkQoqBt8qM6 VPpPYQf/fiDuCugmutg4HapXuVtR1SUuSBVWPNpi5QIDWate7eIlsNUAHkWs1XbB GLSGEzu21b/xr+tuOUcf8LzkdX6YHfLb8VQkaRplkIeNoZUN02VMVY2YkPj2ib08 jo/zonSD7cNO1gKP7HcJpldh/OCmPoTvWFngAa5nRTdE/OHZyl2ANzU2Hbap/JD3 yfOfawjVVkCJm0S/fhK3hrLiFlGmYc9prG8oGGcjKTvo79CDwDIg0Dd4nqKKp+m7 0Gevqk6uPzNxB/5iBoneEhCKmCYxW9fZq0L0VBl6aXtkWr49eAs6MnmcMXjGFQUi jrHYX22S2gPBwjogmpfxzmDZJDxzyw== =O7yT -----END PGP SIGNATURE----- --=-=-=-- ------------=_1581699241-18549-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 5 Feb 2020 20:03:47 +0000 Received: from localhost ([127.0.0.1]:46757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izQti-0006kn-QB for submit@debbugs.gnu.org; Wed, 05 Feb 2020 15:03:47 -0500 Received: from lists.gnu.org ([209.51.188.17]:51838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izQth-0006kg-Vb for submit@debbugs.gnu.org; Wed, 05 Feb 2020 15:03:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46079) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izQtg-0000xl-CE for guix-patches@gnu.org; Wed, 05 Feb 2020 15:03:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,SPOOFED_FREEMAIL,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izQte-0001cz-Tr for guix-patches@gnu.org; Wed, 05 Feb 2020 15:03:40 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:58793) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izQte-0001OX-Hd for guix-patches@gnu.org; Wed, 05 Feb 2020 15:03:38 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 36600781 for ; Wed, 5 Feb 2020 15:03:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 05 Feb 2020 15:03:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=fm2; bh=/BMW6YfQmeWU4qWGWrJhvunjZW 0gD/lAds1hBLVdN6M=; b=HPxg1vaGhPS3trgtuptjTXpQesEEOzzlZhLwbPwZqF JmuGFNAGdI2JVg8RFPCK3kYOiWkrzcmjZSMtof3O6cVsWr2T8x4iYa3Z1AMvMPq0 FmNZNqGGOuE81+gC4t36B8IdmcgJy9/mAXF4ecO04P3Ps1+lI45vy5Lmdc3hC2b2 WkMQbrxGELw8aehPpAOYbUpQ8X9aN2F7i1l5/8SS7BYeljYIibqv0zQeFAJ2DseU 5XBvvcAE2hswJKzTjfS7ogpVXmI5jEjzlOC+6p+sIOeULbu1qjqAL7RHVA6xPXUI JKSlUFzcSyaG/nDvfKN+b8gIZZeJET1x5G5l2GlyqP7Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=/BMW6Y fQmeWU4qWGWrJhvunjZW0gD/lAds1hBLVdN6M=; b=Iq+bafOcw7WJusPJ0GKQNZ itk4Ak4gJMOMdFabPBpc3kNEopXF1dvMsbhOREJiP+vak40wAENw/nAF0zDx8Oai pUOF32+rplJuWxVCd3JLeoc/FMpOML2YzLIba8W4XtxjfavMuJno2ZMdrGbdHWD7 l1h+020zWYSstyAAUWR+u50gpkI1YnnK9KYirq/1QbX/6osl2vAhgIgXBfSPHuJf LE0v0aaN8OYNjCp1sz12zeAya/GqFH1pMeXl7eaA3YHxrzrMMpQ2kNU43Ff88T9o 7JEWheK2aoHgI6HHt17N+MvXe544jCsOGpGb7XPdiF1BE+8nMbTnwH5beB833HxQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrhedugdduvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpeforghrihhushcuuegrkhhkvgcuoehmsggrkhhkvgesfhgrshht mhgrihhlrdgtohhmqeenucfkphepkeegrddvtddvrdeiledrvdehfeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmsggrkhhkvgesfhgrshht mhgrihhlrdgtohhm X-ME-Proxy: Received: from localhost (ti0006q161-3035.bb.online.no [84.202.69.253]) by mail.messagingengine.com (Postfix) with ESMTPA id 62C9330606FB for ; Wed, 5 Feb 2020 15:03:35 -0500 (EST) From: Marius Bakke To: guix-patches@gnu.org Subject: [PATCH] guix build: Add '--manifest' option. Date: Wed, 5 Feb 2020 21:03:33 +0100 Message-Id: <20200205200333.8309-1-mbakke@fastmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.19 X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/build.scm (show-help): Document --manifest argument. (options->things-to-build): When given a manifest, evaluate all the entries. * tests/guix-build.sh: Add test for --manifest. * doc/g [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: fastmail.com] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (mbakke[at]fastmail.com) 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/scripts/build.scm (show-help): Document --manifest argument. (options->things-to-build): When given a manifest, evaluate all the entries. * tests/guix-build.sh: Add test for --manifest. * doc/guix.texi (Additional Build Options): Mention --manifest. * etc/completion/bash/guix: Complete file name if 'guix build' argument is -m. --- doc/guix.texi | 7 ++++++- etc/completion/bash/guix | 2 +- guix/scripts/build.scm | 19 +++++++++++++++++++ tests/guix-build.sh | 9 +++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 956c25ba9e..f25943789b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -46,7 +46,7 @@ Copyright @copyright{} 2017, 2018 Carlo Zancanaro@* Copyright @copyright{} 2017 Thomas Danckaert@* Copyright @copyright{} 2017 humanitiesNerd@* Copyright @copyright{} 2017 Christopher Allan Webber@* -Copyright @copyright{} 2017, 2018, 2019 Marius Bakke@* +Copyright @copyright{} 2017, 2018, 2019, 2020 Marius Bakke@* Copyright @copyright{} 2017, 2019 Hartmut Goebel@* Copyright @copyright{} 2017, 2019, 2020 Maxim Cournoyer@* Copyright @copyright{} 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice@* @@ -8427,6 +8427,11 @@ As an example, @var{file} might contain a package definition like this @include package-hello.scm @end lisp +@item --manifest=@var{manifest} +@itemx -m @var{manifest} +Build all packages listed in the given @var{manifest} +(@pxref{profile-manifest, @option{--manifest}}). + @item --expression=@var{expr} @itemx -e @var{expr} Build the package or derivation @var{expr} evaluates to. diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index edfb627e87..0333bfc8a2 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix @@ -178,7 +178,7 @@ _guix_complete () _guix_complete_installed_package "$word_at_point" elif _guix_is_command "build" then - if _guix_is_dash_L + if _guix_is_dash_L || _guix_is_dash_m then _guix_complete_file else diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index f054fc2bce..eedf6bf6a8 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2013 Mark H Weaver +;;; Copyright © 2020 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,7 @@ #:use-module (guix monads) #:use-module (guix gexp) + #:use-module (guix profiles) #:autoload (guix http-client) (http-fetch http-get-error?) #:use-module (ice-9 format) #:use-module (ice-9 match) @@ -680,6 +682,9 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n")) -f, --file=FILE build the package or derivation that the code within FILE evaluates to")) (display (G_ " + -m, --manifest=FILE build the packages that the manifest given in FILE + evaluates to")) + (display (G_ " -S, --source build the packages' source derivations")) (display (G_ " --sources[=TYPE] build source derivations; TYPE may optionally be one @@ -768,6 +773,9 @@ must be one of 'package', 'all', or 'transitive'~%") (option '(#\f "file") #t #f (lambda (opt name arg result) (alist-cons 'file arg result))) + (option '(#\m "manifest") #t #f + (lambda (opt name arg result) + (alist-cons 'manifest arg result))) (option '(#\n "dry-run") #f #f (lambda (opt name arg result) (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) @@ -804,6 +812,14 @@ build---packages, gexps, derivations, and so on." (for-each validate-type lst) lst)) + ;; Note: Taken from (guix scripts refresh). + (define (manifest->packages manifest) + "Return the list of packages in MANIFEST." + (filter-map (lambda (entry) + (let ((item (manifest-entry-item entry))) + (if (package? item) item #f))) + (manifest-entries manifest))) + (append-map (match-lambda (('argument . (? string? spec)) (cond ((derivation-path? spec) @@ -827,6 +843,9 @@ build---packages, gexps, derivations, and so on." (list (specification->package spec))))) (('file . file) (ensure-list (load* file (make-user-module '())))) + (('manifest . manifest) + (manifest->packages + (load* manifest (make-user-module '((guix profiles) (gnu)))))) (('expression . str) (ensure-list (read/eval str))) (('argument . (? derivation? drv)) diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 21b6af4395..c1df6db3a4 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -1,5 +1,6 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2012, 2013, 2014, 2016, 2017, 2018, 2019 Ludovic Courtès +# Copyright © 2020 Marius Bakke # # This file is part of GNU Guix. # @@ -308,6 +309,14 @@ cat > "$module_dir/gexp.scm"< "$module_dir/manifest.scm"<manifest '("hello" "guix")) +EOF +test `guix build -d --manifest="$module_dir/manifest.scm" \ + | grep -e '-hello-' -e '-guix-' \ + | wc -l` -eq 2 rm "$module_dir"/*.scm # Using 'GUIX_BUILD_OPTIONS'. -- 2.25.0 ------------=_1581699241-18549-1-- From unknown Sun Jun 15 08:54:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#39444] [PATCH] guix build: Add '--manifest' option. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 14 Feb 2020 21:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39444 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Marius Bakke Cc: 39444@debbugs.gnu.org Received: via spool by 39444-submit@debbugs.gnu.org id=B39444.158171644828701 (code B ref 39444); Fri, 14 Feb 2020 21:41:01 +0000 Received: (at 39444) by debbugs.gnu.org; 14 Feb 2020 21:40:48 +0000 Received: from localhost ([127.0.0.1]:34809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2ihc-0007Sr-5X for submit@debbugs.gnu.org; Fri, 14 Feb 2020 16:40:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2iha-0007Sd-61 for 39444@debbugs.gnu.org; Fri, 14 Feb 2020 16:40:46 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j2ihV-0003VD-0I; Fri, 14 Feb 2020 16:40:41 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44124 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j2ihU-0000mN-Al; Fri, 14 Feb 2020 16:40:40 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200205200333.8309-1-mbakke@fastmail.com> Date: Fri, 14 Feb 2020 22:40:38 +0100 In-Reply-To: <20200205200333.8309-1-mbakke@fastmail.com> (Marius Bakke's message of "Wed, 5 Feb 2020 21:03:33 +0100") Message-ID: <874kvs7sq1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Marius, Marius Bakke skribis: > * guix/scripts/build.scm (show-help): Document --manifest argument. > (options->things-to-build): When given a manifest, evaluate all the entri= es. > * tests/guix-build.sh: Add test for --manifest. > * doc/guix.texi (Additional Build Options): Mention --manifest. > * etc/completion/bash/guix: Complete file name if 'guix build' argument is > -m. I=E2=80=99m late to the party but all I have to say is that it looks nice. Good idea! Thank you, Ludo=E2=80=99.