From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 22 Aug 2017 17:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 28185@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.150342200010255 (code B ref -1); Tue, 22 Aug 2017 17:14:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Aug 2017 17:13:20 +0000 Received: from localhost ([127.0.0.1]:49803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkCjv-0002fL-UI for submit@debbugs.gnu.org; Tue, 22 Aug 2017 13:13:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkCjt-0002f7-RR for submit@debbugs.gnu.org; Tue, 22 Aug 2017 13:13:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkCjn-0002Zt-KC for submit@debbugs.gnu.org; Tue, 22 Aug 2017 13:13:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52070) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkCjn-0002ZT-Ho for submit@debbugs.gnu.org; Tue, 22 Aug 2017 13:13:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkCjm-00042l-7r for guix-patches@gnu.org; Tue, 22 Aug 2017 13:13:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkCji-0002W1-5M for guix-patches@gnu.org; Tue, 22 Aug 2017 13:13:10 -0400 Received: from mira.cbaines.net ([2a01:7e00::f03c:91ff:fe69:8da9]:48046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkCjh-0002VS-S3 for guix-patches@gnu.org; Tue, 22 Aug 2017 13:13:06 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id A0B7513D23E; Tue, 22 Aug 2017 18:13:03 +0100 (BST) Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 72AC113D23A for ; Tue, 22 Aug 2017 18:13:03 +0100 (BST) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id f075fbfd for ; Tue, 22 Aug 2017 17:13:03 +0000 (UTC) From: Christopher Baines Date: Tue, 22 Aug 2017 18:13:03 +0100 Message-Id: <20170822171303.21754-1-mail@cbaines.net> X-Mailer: git-send-email 2.13.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) 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: -4.0 (----) Modify the install phase to detect when nothing has been installed, and error if this happens. This is preferable to continuing, and allowing the next phase to fail. Also, when nothing can be found to be installed, print out each file that was considered, along with the regular expressions that were used to include and exclude it. * gnu/build/emacs-build-system.scm (install-file?): Add additional error checking and logging. --- guix/build/emacs-build-system.scm | 45 ++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index bda699ddf..d67d7b49c 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -110,22 +110,41 @@ store in '.el' files." (define source (getcwd)) - (define (install-file? file stat) - (let ((stripped-file (string-trim (string-drop file (string-length source)) #\/))) - (and (any (cut string-match <> stripped-file) include) - (not (any (cut string-match <> stripped-file) exclude))))) + (define* (install-file? file stat #:key verbose?) + (let* ((stripped-file (string-trim + (string-drop file (string-length source)) #\/))) + (define (match-stripped-file action regex) + (let ((result (string-match regex stripped-file))) + (if (and result verbose?) + (format #t "info: ~A ~A as it matches \"~A\"\n" + stripped-file action regex)) + result)) + + (if verbose? + (format #t "info: considering installing ~A\n" stripped-file)) + + (and (any (cut match-stripped-file "included" <>) include) + (not (any (cut match-stripped-file "excluded" <>) exclude))))) (let* ((out (assoc-ref outputs "out")) (elpa-name-ver (store-directory->elpa-name-version out)) - (target-directory (string-append out %install-suffix "/" elpa-name-ver))) - (for-each - (lambda (file) - (let* ((stripped-file (string-drop file (string-length source))) - (target-file (string-append target-directory stripped-file))) - (format #t "`~a' -> `~a'~%" file target-file) - (install-file file (dirname target-file)))) - (find-files source install-file?))) - #t) + (target-directory (string-append out %install-suffix "/" elpa-name-ver)) + (files-to-install (find-files source install-file?))) + (if (null? files-to-install) + (begin + (format #t "error: No files found to install.\n") + (find-files source (lambda (file stat) + (install-file? file stat #:verbose? #t))) + #f) + (begin + (for-each + (lambda (file) + (let* ((stripped-file (string-drop file (string-length source))) + (target-file (string-append target-directory stripped-file))) + (format #t "`~a' -> `~a'~%" file target-file) + (install-file file (dirname target-file)))) + files-to-install) + #t)))) (define* (move-doc #:key outputs #:allow-other-keys) "Move info files from the ELPA package directory to the info directory." -- 2.13.1 From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 29 Aug 2017 06:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 28185@debbugs.gnu.org Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.15039879648648 (code B ref 28185); Tue, 29 Aug 2017 06:27:01 +0000 Received: (at 28185) by debbugs.gnu.org; 29 Aug 2017 06:26:04 +0000 Received: from localhost ([127.0.0.1]:60035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmZyO-0002FQ-Ip for submit@debbugs.gnu.org; Tue, 29 Aug 2017 02:26:04 -0400 Received: from o131.p8.mailjet.com ([87.253.233.131]:33288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmZyM-0002FF-N1 for 28185@debbugs.gnu.org; Tue, 29 Aug 2017 02:26:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; q=dns/txt; d=bnc3.mailjet.com; i=arunisaac=3Dsystemreboot.net@bnc3.mailjet.com; s=mailjet; h=message-id:mime-version:from:to:subject:date:list-unsubscribe:cc:in-reply-to: references:x-csa-complaints:x-mj-mid:content-type:content-transfer-encoding; bh=T9shCT/W+TF9sp0MkKkV2rP9RCQ/k8Ar7CZzuR08LgQ=; b=ZuEB1Y4vuIl2PHlSx2lXmwulfN27pmXezTefyZ0VkP9UKYjhNyNalnVte GRW7jrdzjBfAoQRwh2KYpcjh0UP854Quj2VcWF8D3V2l62OMeV4VA6wH2ohh xQeiKU3bSHnO+rbwDukVU5nMQM0k4olxbu7dcF1H7tU4VissKYIfOs= Message-Id: MIME-Version: 1.0 From: Arun Isaac Date: Tue, 29 Aug 2017 11:55:08 +0530 In-reply-to: <20170822171303.21754-1-mail@cbaines.net> References: <20170822171303.21754-1-mail@cbaines.net> X-CSA-Complaints: whitelist-complaints@eco.de X-MJ-Mid: ADkAAC0m-p0AAAAAAAAAAAPmDT8AAAACwQwAAAAAAAW9WABZpQjV8kuWGqeURtqmotqM82S0XAAFgUc Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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: -0.0 (/) Christopher Baines writes: > Modify the install phase to detect when nothing has been installed, and e= rror > if this happens. This is preferable to continuing, and allowing the next = phase > to fail. > > Also, when nothing can be found to be installed, print out each file that= was > considered, along with the regular expressions that were used to include = and > exclude it. > > * gnu/build/emacs-build-system.scm (install-file?): Add additional error > checking and logging. > --- > guix/build/emacs-build-system.scm | 45 ++++++++++++++++++++++++++++-----= ------ > 1 file changed, 32 insertions(+), 13 deletions(-) I feel that this adds a lot of complexity (lines of code) to the emacs-build-system checking for an error that can be quite easily identified and fixed otherwise. WDYT? Maybe, others can comment on this as well. = From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: Jelle Licht Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 29 Aug 2017 06:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Arun Isaac Cc: 28185@debbugs.gnu.org, Christopher Baines Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.15039882959197 (code B ref 28185); Tue, 29 Aug 2017 06:32:01 +0000 Received: (at 28185) by debbugs.gnu.org; 29 Aug 2017 06:31:35 +0000 Received: from localhost ([127.0.0.1]:60039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dma3j-0002OH-6d for submit@debbugs.gnu.org; Tue, 29 Aug 2017 02:31:35 -0400 Received: from mail.fsfe.org ([217.69.89.162]:50436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dma3g-0002O0-Ll for 28185@debbugs.gnu.org; Tue, 29 Aug 2017 02:31:33 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.fsfe.org (Postfix) with ESMTP id 575BD6392B2 for <28185@debbugs.gnu.org>; Tue, 29 Aug 2017 08:31:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.fsfe.org Received: from mail.fsfe.org ([127.0.0.1]) by localhost (cavendish.fsfeurope.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kIsWFsiygicC for <28185@debbugs.gnu.org>; Tue, 29 Aug 2017 08:31:26 +0200 (CEST) Received: by mail-ua0-f181.google.com with SMTP id 37so7667482ual.0 for <28185@debbugs.gnu.org>; Mon, 28 Aug 2017 23:31:25 -0700 (PDT) X-Gm-Message-State: AHYfb5iVLaUSND7A8oTW+NqApJtngC2nSAg0djZszEcUzQaz3cKGn9I2 4uveVu8LtPW5IvoqqOwQt7mV4EhVVw== X-Received: by 10.176.89.140 with SMTP id g12mr1706208uad.45.1503988282699; Mon, 28 Aug 2017 23:31:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.72.194 with HTTP; Mon, 28 Aug 2017 23:31:22 -0700 (PDT) In-Reply-To: References: <20170822171303.21754-1-mail@cbaines.net> From: Jelle Licht Date: Tue, 29 Aug 2017 08:31:22 +0200 X-Gmail-Original-Message-ID: Message-ID: Content-Type: multipart/alternative; boundary="001a11465dd656369d0557de8f1b" X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) --001a11465dd656369d0557de8f1b Content-Type: text/plain; charset="UTF-8" 2017-08-29 8:25 GMT+02:00 Arun Isaac : > > Christopher Baines writes: > > > Modify the install phase to detect when nothing has been installed, and > error > > if this happens. This is preferable to continuing, and allowing the next > phase > > to fail. > > > > Also, when nothing can be found to be installed, print out each file > that was > > considered, along with the regular expressions that were used to include > and > > exclude it. > > > > * gnu/build/emacs-build-system.scm (install-file?): Add additional error > > checking and logging. > > --- > > guix/build/emacs-build-system.scm | 45 ++++++++++++++++++++++++++++-- > --------- > > 1 file changed, 32 insertions(+), 13 deletions(-) > > I feel that this adds a lot of complexity (lines of code) to the > emacs-build-system checking for an error that can be quite easily > identified and fixed otherwise. > > WDYT? Maybe, others can comment on this as well. > > > One the one hand, I agree with Arun, though errors in Guix can be a bit intimidating for newcomers. Do we want to focus on clear and correct error messages over concise code? --001a11465dd656369d0557de8f1b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


2017-08-29 8:25 GMT+02:00 Arun Isaac <arunisaac@systemreboot.= net>:

Christopher Baines writes:

> Modify the install phase to detect when nothing has been installed, an= d error
> if this happens. This is preferable to continuing, and allowing the ne= xt phase
> to fail.
>
> Also, when nothing can be found to be installed, print out each file t= hat was
> considered, along with the regular expressions that were used to inclu= de and
> exclude it.
>
> * gnu/build/emacs-build-system.scm (install-file?): Add additiona= l error
>=C2=A0 =C2=A0checking and logging.
> ---
>=C2=A0 guix/build/emacs-build-system.scm | 45 ++++++++++++++++++++= ++++++++-----------
>=C2=A0 1 file changed, 32 insertions(+), 13 deletions(-)

I feel that this adds a lot of complexity (lines of code) to the
emacs-build-system checking for an error that can be quite easily
identified and fixed otherwise.

WDYT? Maybe, others can comment on this as well.



One the one hand, I agree with Arun, t= hough errors in Guix can be a bit intimidating for newcomers.
Do we want to focus on clear and correct error messages over concise code?=

--001a11465dd656369d0557de8f1b-- From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 29 Aug 2017 06:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Arun Isaac Cc: 28185@debbugs.gnu.org Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.150398991411783 (code B ref 28185); Tue, 29 Aug 2017 06:59:01 +0000 Received: (at 28185) by debbugs.gnu.org; 29 Aug 2017 06:58:34 +0000 Received: from localhost ([127.0.0.1]:60060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmaTq-00033z-33 for submit@debbugs.gnu.org; Tue, 29 Aug 2017 02:58:34 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:39809 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmaTo-00033r-50 for 28185@debbugs.gnu.org; Tue, 29 Aug 2017 02:58:32 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 7801F13D263; Tue, 29 Aug 2017 07:58:31 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 285AF13D261; Tue, 29 Aug 2017 07:58:31 +0100 (BST) Date: Tue, 29 Aug 2017 07:58:27 +0100 From: Christopher Baines Message-ID: <20170829075827.72c9a858@cbaines.net> In-Reply-To: <3c5556d2.ADkAAC0m-p4AAAAAAAAAAAPmDT4AAAACwQwAAAAAAAW9WABZpQjV@mailjet.com> References: <20170822171303.21754-1-mail@cbaines.net> <3c5556d2.ADkAAC0m-p4AAAAAAAAAAAPmDT4AAAACwQwAAAAAAAW9WABZpQjV@mailjet.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/dkYn/AGyRwTLbrtAryKhqUS"; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) 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: -0.0 (/) --Sig_/dkYn/AGyRwTLbrtAryKhqUS Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 29 Aug 2017 11:55:08 +0530 Arun Isaac wrote: > Christopher Baines writes: >=20 > > Modify the install phase to detect when nothing has been installed, > > and error if this happens. This is preferable to continuing, and > > allowing the next phase to fail. > > > > Also, when nothing can be found to be installed, print out each > > file that was considered, along with the regular expressions that > > were used to include and exclude it. > > > > * gnu/build/emacs-build-system.scm (install-file?): Add additional > > error checking and logging. > > --- > > guix/build/emacs-build-system.scm | 45 > > ++++++++++++++++++++++++++++----------- 1 file changed, 32 > > insertions(+), 13 deletions(-) =20 >=20 > I feel that this adds a lot of complexity (lines of code) to the > emacs-build-system checking for an error that can be quite easily > identified and fixed otherwise. >=20 > WDYT? Maybe, others can comment on this as well. In my personal experience, I didn't find this easy to identify and fix. For packaging emacs-minitest, I ended up writing this to pin down why the emacs-build-system wasn't installing the key file. I think validating that something has been installed is really important, as otherwise the later phases fail in a very unclear way. The extra functionality about explaining why each file hasn't been installed is useful for debugging, and I agree that it adds significant complexity. But, I'd like for packaging emacs things to be really easy in the general case, and I think making the build system more helpful when it fails is one way to improve this. I wouldn't like to expect that you'd need to read the implementation of the build system, or add in your own debugging code just to package a emacs module. --Sig_/dkYn/AGyRwTLbrtAryKhqUS Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmlEJNfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XfexQ//RZ19v3TdkRiz9mqNBrxLK8gZbbQ//TBFMjcN+co0a8VcfHrCT1yIJDeP H2005N2aLrOPLuMbN75asLZIVRA6uWQvJqqBErt5smYVUnSpggHJo/yXPUx+xvYJ iVYwU1mmCiFMjp1W4CT7KOA5lfCWefiuXFYjusZtaeMe6Gm5kZB+/oquJVwm70Ye kDDegmgN/HVgwjnJWeyGboNO98dcbF6wLFQD5oGvHsX52uEzUFtiaHgCOfW2PIq6 4V9QGR5Sn1NaFSJuE4OO3kOxnWc8VbHiangOO8mYQOlUf6u10DOkzUvAouQM4gKV wPxi6g1YP+pwKeSf6jl51SpR/EKQlnlstM0RvLBjcCAbU7LRZXl3gSiBBBDSzGvI P0ulRYmPmQpc/52ZcOQMS7Fa5mnJhwoLjdLmN5Zyg1QnYc9hURgAb+QL44pQT9kd m9DvybhIS3lYHfQDORSFSkHmWxqBpuJA76DqBDMVkV8zbssUqcEib8/RKszJX1Co NuT1qRMIdUjPicayvepP425GUzXYadD2Mcwn/AD10fl9iaQdWZo/NaYeZ6kQelJx vmZFENOcUaRirHnGuQxqcaX3hmns/PTiEbpOoZai0RPM3GGB9aLNUD/fOZcfqtDK qHodYT+VPb2YR2eGgV4q2ZNUI/j5RgIcD3mhxb7FSrG5o5+4+Pc= =O9ot -----END PGP SIGNATURE----- --Sig_/dkYn/AGyRwTLbrtAryKhqUS-- From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 29 Aug 2017 07:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jelle Licht Cc: 28185@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.150399280016253 (code B ref 28185); Tue, 29 Aug 2017 07:47:02 +0000 Received: (at 28185) by debbugs.gnu.org; 29 Aug 2017 07:46:40 +0000 Received: from localhost ([127.0.0.1]:60089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmbEO-0004E4-In for submit@debbugs.gnu.org; Tue, 29 Aug 2017 03:46:40 -0400 Received: from o173.p8.mailjet.com ([87.253.233.173]:50809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <35f7643a.AEQAPOKjjUYAAAAAAAAAAAPmDT8AAAACwQwAAAAAAAW9WABZpRvb@bnc3.mailjet.com>) id 1dmbEM-0004Dw-EK for 28185@debbugs.gnu.org; Tue, 29 Aug 2017 03:46:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; q=dns/txt; d=bnc3.mailjet.com; i=arunisaac=3Dsystemreboot.net@bnc3.mailjet.com; s=mailjet; h=message-id:mime-version:from:to:subject:date:list-unsubscribe:cc:in-reply-to: references:x-csa-complaints:x-mj-mid:content-type:content-transfer-encoding; bh=TEqZU6H6bXiuqgkINKmUN/8xZI8SZ65tND9UeBAavK4=; b=C0x30/JpyXscKdSI03ZyT1Zfv3k5BFbueqKnjI1+lltPFdKHrYDrFQ2jt qgJDO2hFVWVIaz5j6tF2Cd77BUUq8+gxhPkY1gh6yoOum9vskw7wfe17VdM3 6ysGAQeTZflG54a3ghnpO5oqY1/6RL06WTnf/nyP5Ng5dkm0dndU8M= Message-Id: <35f7643a.AEQAPOKjjUYAAAAAAAAAAAPmDT8AAAACwQwAAAAAAAW9WABZpRvb@mailjet.com> MIME-Version: 1.0 From: Arun Isaac Date: Tue, 29 Aug 2017 13:16:27 +0530 In-reply-to: References: <20170822171303.21754-1-mail@cbaines.net> X-CSA-Complaints: whitelist-complaints@eco.de X-MJ-Mid: AEQAPOKjjUYAAAAAAAAAAAPmDT8AAAACwQwAAAAAAAW9WABZpRvb5ZVqZmF2R-6vBTKrDLr4wwAFgUc Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.8 (--) 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: -2.8 (--) Jelle Licht writes: > 2017-08-29 8:25 GMT+02:00 Arun Isaac : > >> >> Christopher Baines writes: >> >> Modify the install phase to detect when nothing has been installed, >> and error if this happens. This is preferable to continuing, and >> allowing the next phase to fail. >> >> Also, when nothing can be found to be installed, print out each >> file that was considered, along with the regular expressions that >> were used to include and exclude it. >> > >> > * gnu/build/emacs-build-system.scm (install-file?): Add additional err= or >> > checking and logging. >> > --- >> > guix/build/emacs-build-system.scm | 45 ++++++++++++++++++++++++++++-- >> --------- >> > 1 file changed, 32 insertions(+), 13 deletions(-) >> >> I feel that this adds a lot of complexity (lines of code) to the >> emacs-build-system checking for an error that can be quite easily >> identified and fixed otherwise. >> >> WDYT? Maybe, others can comment on this as well. >> > One the one hand, I agree with Arun, though errors in Guix can be a bit > intimidating for newcomers. > Do we want to focus on clear and correct error messages over concise code= ? It's a design choice, and I am unable to make up my mind. I think somebody with more experience than me should take a call. Let's ask Ludo. CCing him... = From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 29 Aug 2017 21:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 28185@debbugs.gnu.org, Arun Isaac Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.150404317122126 (code B ref 28185); Tue, 29 Aug 2017 21:47:02 +0000 Received: (at 28185) by debbugs.gnu.org; 29 Aug 2017 21:46:11 +0000 Received: from localhost ([127.0.0.1]:32969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmoKp-0005kn-L0 for submit@debbugs.gnu.org; Tue, 29 Aug 2017 17:46:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmoKn-0005kK-Se for 28185@debbugs.gnu.org; Tue, 29 Aug 2017 17:46:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmoKh-0000KJ-Hq for 28185@debbugs.gnu.org; Tue, 29 Aug 2017 17:46:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmoKh-0000KE-ET; Tue, 29 Aug 2017 17:46:03 -0400 Received: from [2a01:e0a:1d:7270:6a6c:dc17:fc02:cfda] (port=43136 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dmoKg-0004wX-Vn; Tue, 29 Aug 2017 17:46:03 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170822171303.21754-1-mail@cbaines.net> <3c5556d2.ADkAAC0m-p4AAAAAAAAAAAPmDT4AAAACwQwAAAAAAAW9WABZpQjV@mailjet.com> <20170829075827.72c9a858@cbaines.net> Date: Tue, 29 Aug 2017 23:46:00 +0200 In-Reply-To: <20170829075827.72c9a858@cbaines.net> (Christopher Baines's message of "Tue, 29 Aug 2017 07:58:27 +0100") Message-ID: <87d17eqc87.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (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-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) Hello! Christopher Baines skribis: > On Tue, 29 Aug 2017 11:55:08 +0530 > Arun Isaac wrote: > >> Christopher Baines writes: >>=20 >> > Modify the install phase to detect when nothing has been installed, >> > and error if this happens. This is preferable to continuing, and >> > allowing the next phase to fail. >> > >> > Also, when nothing can be found to be installed, print out each >> > file that was considered, along with the regular expressions that >> > were used to include and exclude it. >> > >> > * gnu/build/emacs-build-system.scm (install-file?): Add additional >> > error checking and logging. >> > --- >> > guix/build/emacs-build-system.scm | 45 >> > ++++++++++++++++++++++++++++----------- 1 file changed, 32 >> > insertions(+), 13 deletions(-)=20=20 >>=20 >> I feel that this adds a lot of complexity (lines of code) to the >> emacs-build-system checking for an error that can be quite easily >> identified and fixed otherwise. >>=20 >> WDYT? Maybe, others can comment on this as well. > > In my personal experience, I didn't find this easy to identify and fix. > For packaging emacs-minitest, I ended up writing this to pin down why > the emacs-build-system wasn't installing the key file. > > I think validating that something has been installed is really > important, as otherwise the later phases fail in a very unclear way. > > The extra functionality about explaining why each file hasn't been > installed is useful for debugging, and I agree that it adds significant > complexity. I agree. I=E2=80=99m guessing you wrote this after spending a while debugg= ing a build, despite being experienced with Guix, which to me suggests that this is a welcome improvement, in spite of the extra complexity. > But, I'd like for packaging emacs things to be really easy in the > general case, and I think making the build system more helpful when it > fails is one way to improve this. I wouldn't like to expect that you'd > need to read the implementation of the build system, or add in your own > debugging code just to package a emacs module. Sounds reasonable. To me this looks like a step in the right direction. Thanks, Ludo=E2=80=99. PS: Thanks Arun for pinging me. :-) From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 29 Aug 2017 21:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 28185@debbugs.gnu.org Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.150404342122478 (code B ref 28185); Tue, 29 Aug 2017 21:51:01 +0000 Received: (at 28185) by debbugs.gnu.org; 29 Aug 2017 21:50:21 +0000 Received: from localhost ([127.0.0.1]:32973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmoOr-0005qU-7O for submit@debbugs.gnu.org; Tue, 29 Aug 2017 17:50:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44751) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmoOo-0005qH-Eg for 28185@debbugs.gnu.org; Tue, 29 Aug 2017 17:50:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmoOi-0002X3-Mc for 28185@debbugs.gnu.org; Tue, 29 Aug 2017 17:50:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmoOi-0002Wx-Is; Tue, 29 Aug 2017 17:50:12 -0400 Received: from [2a01:e0a:1d:7270:6a6c:dc17:fc02:cfda] (port=43138 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dmoOh-00057d-9k; Tue, 29 Aug 2017 17:50:12 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170822171303.21754-1-mail@cbaines.net> Date: Tue, 29 Aug 2017 23:50:07 +0200 In-Reply-To: <20170822171303.21754-1-mail@cbaines.net> (Christopher Baines's message of "Tue, 22 Aug 2017 18:13:03 +0100") Message-ID: <878ti2qc1c.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (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-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) Christopher Baines skribis: > Modify the install phase to detect when nothing has been installed, and e= rror > if this happens. This is preferable to continuing, and allowing the next = phase > to fail. > > Also, when nothing can be found to be installed, print out each file that= was > considered, along with the regular expressions that were used to include = and > exclude it. > > * gnu/build/emacs-build-system.scm (install-file?): Add additional error > checking and logging. Nitpicking: > + (define* (install-file? file stat #:key verbose?) > + (let* ((stripped-file (string-trim > + (string-drop file (string-length source)) #\/= ))) > + (define (match-stripped-file action regex) > + (let ((result (string-match regex stripped-file))) > + (if (and result verbose?) > + (format #t "info: ~A ~A as it matches \"~A\"\n" > + stripped-file action regex)) > + result)) > + > + (if verbose? > + (format #t "info: considering installing ~A\n" stripped-file)) Use =E2=80=98when=E2=80=99 here, to clarify that this is for-effect. Ludo=E2=80=99. From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. References: <20170822171303.21754-1-mail@cbaines.net> In-Reply-To: <20170822171303.21754-1-mail@cbaines.net> Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 30 Aug 2017 06:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 28185@debbugs.gnu.org Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.15040756856243 (code B ref 28185); Wed, 30 Aug 2017 06:49:02 +0000 Received: (at 28185) by debbugs.gnu.org; 30 Aug 2017 06:48:05 +0000 Received: from localhost ([127.0.0.1]:33163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmwnE-0001cd-UN for submit@debbugs.gnu.org; Wed, 30 Aug 2017 02:48:05 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:40718 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmwnD-0001cW-Qw for 28185@debbugs.gnu.org; Wed, 30 Aug 2017 02:48:04 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 8044213D273; Wed, 30 Aug 2017 07:48:02 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 4F93F13D272 for <28185@debbugs.gnu.org>; Wed, 30 Aug 2017 07:48:02 +0100 (BST) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 91f10df8 for <28185@debbugs.gnu.org>; Wed, 30 Aug 2017 06:48:02 +0000 (UTC) From: Christopher Baines Date: Wed, 30 Aug 2017 07:48:01 +0100 Message-Id: <20170830064801.14912-1-mail@cbaines.net> X-Mailer: git-send-email 2.14.1 X-Spam-Score: -0.0 (/) 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: -0.0 (/) Modify the install phase to detect when nothing has been installed, and error if this happens. This is preferable to continuing, and allowing the next phase to fail. Also, when nothing can be found to be installed, print out each file that was considered, along with the regular expressions that were used to include and exclude it. * gnu/build/emacs-build-system.scm (install-file?): Add additional error checking and logging. --- guix/build/emacs-build-system.scm | 45 ++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index bda699ddf..ceaa085ce 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -110,22 +110,41 @@ store in '.el' files." (define source (getcwd)) - (define (install-file? file stat) - (let ((stripped-file (string-trim (string-drop file (string-length source)) #\/))) - (and (any (cut string-match <> stripped-file) include) - (not (any (cut string-match <> stripped-file) exclude))))) + (define* (install-file? file stat #:key verbose?) + (let* ((stripped-file (string-trim + (string-drop file (string-length source)) #\/))) + (define (match-stripped-file action regex) + (let ((result (string-match regex stripped-file))) + (when (and result verbose?) + (format #t "info: ~A ~A as it matches \"~A\"\n" + stripped-file action regex)) + result)) + + (when verbose? + (format #t "info: considering installing ~A\n" stripped-file)) + + (and (any (cut match-stripped-file "included" <>) include) + (not (any (cut match-stripped-file "excluded" <>) exclude))))) (let* ((out (assoc-ref outputs "out")) (elpa-name-ver (store-directory->elpa-name-version out)) - (target-directory (string-append out %install-suffix "/" elpa-name-ver))) - (for-each - (lambda (file) - (let* ((stripped-file (string-drop file (string-length source))) - (target-file (string-append target-directory stripped-file))) - (format #t "`~a' -> `~a'~%" file target-file) - (install-file file (dirname target-file)))) - (find-files source install-file?))) - #t) + (target-directory (string-append out %install-suffix "/" elpa-name-ver)) + (files-to-install (find-files source install-file?))) + (if (null? files-to-install) + (begin + (format #t "error: No files found to install.\n") + (find-files source (lambda (file stat) + (install-file? file stat #:verbose? #t))) + #f) + (begin + (for-each + (lambda (file) + (let* ((stripped-file (string-drop file (string-length source))) + (target-file (string-append target-directory stripped-file))) + (format #t "`~a' -> `~a'~%" file target-file) + (install-file file (dirname target-file)))) + files-to-install) + #t)))) (define* (move-doc #:key outputs #:allow-other-keys) "Move info files from the ELPA package directory to the info directory." -- 2.14.1 From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 30 Aug 2017 06:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Cc: 28185@debbugs.gnu.org, Arun Isaac Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.15040757386317 (code B ref 28185); Wed, 30 Aug 2017 06:49:02 +0000 Received: (at 28185) by debbugs.gnu.org; 30 Aug 2017 06:48:58 +0000 Received: from localhost ([127.0.0.1]:33166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmwo6-0001dp-Ba for submit@debbugs.gnu.org; Wed, 30 Aug 2017 02:48:58 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:40724 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmwo4-0001dg-JN for 28185@debbugs.gnu.org; Wed, 30 Aug 2017 02:48:57 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 23DB713D274; Wed, 30 Aug 2017 07:48:56 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 1E5D413D272; Wed, 30 Aug 2017 07:48:55 +0100 (BST) Date: Wed, 30 Aug 2017 07:48:51 +0100 From: Christopher Baines Message-ID: <20170830074851.3f2f20cf@cbaines.net> In-Reply-To: <87d17eqc87.fsf@gnu.org> References: <20170822171303.21754-1-mail@cbaines.net> <3c5556d2.ADkAAC0m-p4AAAAAAAAAAAPmDT4AAAACwQwAAAAAAAW9WABZpQjV@mailjet.com> <20170829075827.72c9a858@cbaines.net> <87d17eqc87.fsf@gnu.org> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/5y_iU3mxIT5EI0j2_a4Cs+D"; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) 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: -0.0 (/) --Sig_/5y_iU3mxIT5EI0j2_a4Cs+D Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 29 Aug 2017 23:46:00 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Hello! >=20 > Christopher Baines skribis: >=20 > > On Tue, 29 Aug 2017 11:55:08 +0530 > > Arun Isaac wrote: > > =20 > >> Christopher Baines writes: > >> =20 > >> > Modify the install phase to detect when nothing has been > >> > installed, and error if this happens. This is preferable to > >> > continuing, and allowing the next phase to fail. > >> > > >> > Also, when nothing can be found to be installed, print out each > >> > file that was considered, along with the regular expressions that > >> > were used to include and exclude it. > >> > > >> > * gnu/build/emacs-build-system.scm (install-file?): Add > >> > additional error checking and logging. > >> > --- > >> > guix/build/emacs-build-system.scm | 45 > >> > ++++++++++++++++++++++++++++----------- 1 file changed, 32 > >> > insertions(+), 13 deletions(-) =20 > >>=20 > >> I feel that this adds a lot of complexity (lines of code) to the > >> emacs-build-system checking for an error that can be quite easily > >> identified and fixed otherwise. > >>=20 > >> WDYT? Maybe, others can comment on this as well. =20 > > > > In my personal experience, I didn't find this easy to identify and > > fix. For packaging emacs-minitest, I ended up writing this to pin > > down why the emacs-build-system wasn't installing the key file. > > > > I think validating that something has been installed is really > > important, as otherwise the later phases fail in a very unclear way. > > > > The extra functionality about explaining why each file hasn't been > > installed is useful for debugging, and I agree that it adds > > significant complexity. =20 >=20 > I agree. I=E2=80=99m guessing you wrote this after spending a while > debugging a build, despite being experienced with Guix, which to me > suggests that this is a welcome improvement, in spite of the extra > complexity. >=20 > > But, I'd like for packaging emacs things to be really easy in the > > general case, and I think making the build system more helpful when > > it fails is one way to improve this. I wouldn't like to expect that > > you'd need to read the implementation of the build system, or add > > in your own debugging code just to package a emacs module. =20 >=20 > Sounds reasonable. >=20 > To me this looks like a step in the right direction. Ok, thanks for your review Ludo :) --Sig_/5y_iU3mxIT5EI0j2_a4Cs+D Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmmX9NfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xfi/w//RrtK2RSQJ04vjN1ZOmJ+im9+822bKGMEVEZXOsF/ssPnGoMb71YJotTG h38c05BbYgH4npKuB6CnuWZ4QNV/ty3SgV/SEG/cr4JlQn9Au8xPuLbJ2Rb9w+xX Pongm/rRI9RgmcygJsfczIlSP+bdRc2Hwx+SrZqVt/w1y9er+KxpT7s5VyvwCKP5 bm/tPbIRC+4Enx+Q/mVkXp2G1E86H4O2N9rehyfA/bpjLb73zhqPgDXKJSlf0x0P lu8w9Djm2TS70HGnjQLLWB0HwBHp6ezxn4Lv7LYPZRrbXMODGNSNlo+ja+hIkiz0 d00X0d5eNic6fvcRxsXR3LaFC3xEqNa9rSfr6DWh1NYWKkqfwp2r5uM+cZOmzUBH gYbY8KldaMlC/SIELyaDWA4P78FLdxppOMh2SE77RYyk4sKiRWSTv+nlN/awMwaR 0M9jtonxA7FZ1Ghahi0efe2wnkkZd3WUoG815hX/z9q6XEnD4uavrymDvBqcqZDD ajJEZ44aKtN0WNNvZv3Jq/jVmppYIW2AJN5YsNl3lDAA9KBXGZiT27ZaA8/u+TdJ RuNR8fVLOoBDI16QrrN7UZNmWUnNPZxG40g2yfBYBqLWiPezStzoNvf4LbHucjM4 5FnB7ggdEqRlg+ykXtbDkklfSLdAG//5nJ/6xcuWmNSZUxzpwXU= =fXzu -----END PGP SIGNATURE----- --Sig_/5y_iU3mxIT5EI0j2_a4Cs+D-- From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 30 Aug 2017 07:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Cc: 28185@debbugs.gnu.org Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.150407811310022 (code B ref 28185); Wed, 30 Aug 2017 07:29:02 +0000 Received: (at 28185) by debbugs.gnu.org; 30 Aug 2017 07:28:33 +0000 Received: from localhost ([127.0.0.1]:33221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmxQP-0002bZ-5e for submit@debbugs.gnu.org; Wed, 30 Aug 2017 03:28:33 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:40766 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmxQN-0002bR-2Y for 28185@debbugs.gnu.org; Wed, 30 Aug 2017 03:28:31 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 3DA6813D274; Wed, 30 Aug 2017 08:28:30 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 852DC13D272; Wed, 30 Aug 2017 08:28:28 +0100 (BST) Date: Wed, 30 Aug 2017 08:28:22 +0100 From: Christopher Baines Message-ID: <20170830082822.129f9361@cbaines.net> In-Reply-To: <878ti2qc1c.fsf@gnu.org> References: <20170822171303.21754-1-mail@cbaines.net> <878ti2qc1c.fsf@gnu.org> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Gi0nOD0kdoaoz/jO0L9CH7_"; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) 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: -0.0 (/) --Sig_/Gi0nOD0kdoaoz/jO0L9CH7_ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 29 Aug 2017 23:50:07 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Christopher Baines skribis: >=20 > > Modify the install phase to detect when nothing has been installed, > > and error if this happens. This is preferable to continuing, and > > allowing the next phase to fail. > > > > Also, when nothing can be found to be installed, print out each > > file that was considered, along with the regular expressions that > > were used to include and exclude it. > > > > * gnu/build/emacs-build-system.scm (install-file?): Add additional > > error checking and logging. =20 >=20 > Nitpicking: >=20 > > + (define* (install-file? file stat #:key verbose?) > > + (let* ((stripped-file (string-trim > > + (string-drop file (string-length > > source)) #\/))) > > + (define (match-stripped-file action regex) > > + (let ((result (string-match regex stripped-file))) > > + (if (and result verbose?) > > + (format #t "info: ~A ~A as it matches \"~A\"\n" > > + stripped-file action regex)) > > + result)) > > + > > + (if verbose? > > + (format #t "info: considering installing ~A\n" > > stripped-file)) =20 >=20 > Use =E2=80=98when=E2=80=99 here, to clarify that this is for-effect. I've sent an updated patch which uses when. One final issue, as this changes the build system, every package that uses it will need to be rebuilt. My count puts this at 162, which suggests that this is fine to go straight on the master branch. --Sig_/Gi0nOD0kdoaoz/jO0L9CH7_ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmmaRZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xe+hRAAuEt2ExEP0S40VnlmhUfDSJXSQQwRADA0J2duwtFTNWXHGOzkS6+7CS/j vssE+TOhV4ZemM95Ygm+Jadm2KebQulsqzphVORhwz45r9v0KI4X8+qBE7+FSD/k /bmSstdSZMgV5csPF7LKDIHgBNr9PW1LqVciHWQ9NiFldtGfMQJ1g8YRBUtStSpC VLXHHnqmvygYoynEOplPDwoyqMHtuAoUR2SpdSvegups+O1Vt/FGZtPF60tUm/Wp mmDIyVLDMYJj1xayYI9CuYxB9tMeV9/2Xl65kyaJANXoY14s2P6T+usgMkq0dHCw 1nP/6z2f+C/NSIYHZEv2rwls1oKgKFnmGH0xKdJs4siggLbBF/JtLVatR1QJAo27 rngTZc7f/WA72CK031mYwX6yUDfHkwLKyAQ6w2TrRGFJ+FtR4+QzQY3c4GTPUkiP 4hiwRR/pOBKCKaY19dHXXJEs0GfGLWm+BHVR3YpXOJYOeoCCR+PWT8lmrh99rcUk edcqXb9wEURg3L2ifLc1b1ubhczNdxWimhN/JLE8rzys2jj93iyZVJCWa+c9UsDS 7oNqa7CSkpWgqJqPrM4ck993H27k1PpA8adlbkKK+3ZEvteBPO99uryizQDeIMGr IKBcXBGPqElAz5K3EJfN8JJqpkqyg8cnwHh7ndemIDnnRvs/tRg= =A1ZP -----END PGP SIGNATURE----- --Sig_/Gi0nOD0kdoaoz/jO0L9CH7_-- From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 30 Aug 2017 08:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 28185@debbugs.gnu.org Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.150408050413645 (code B ref 28185); Wed, 30 Aug 2017 08:09:02 +0000 Received: (at 28185) by debbugs.gnu.org; 30 Aug 2017 08:08:24 +0000 Received: from localhost ([127.0.0.1]:33242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmy2x-0003Y0-MN for submit@debbugs.gnu.org; Wed, 30 Aug 2017 04:08:23 -0400 Received: from o125.p8.mailjet.com ([87.253.233.125]:37977) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmy2w-0003Xt-QT for 28185@debbugs.gnu.org; Wed, 30 Aug 2017 04:08:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; q=dns/txt; d=bnc3.mailjet.com; i=arunisaac=3Dsystemreboot.net@bnc3.mailjet.com; s=mailjet; h=message-id:mime-version:from:to:subject:date:list-unsubscribe:cc:in-reply-to: references:x-csa-complaints:x-mj-mid:content-type:content-transfer-encoding; bh=84XLte50NmrN4lvrJKpIg6ly9IrmU+tkYY0LCbOwmzg=; b=cmsqapmKEq3hOqgKidxLZEOuJi9nbAKczMvCKrVJiKATZjPLl/VTVRuPc uhl1P5eK2v3Lkg81vQMPPZe34xf0xo6X/TfQB48qFTioZsB2bMzDUzNFCi6H j/MtGsGeyAeBKMKyARXEBfbNQSQC/zQJ+NTyJn1Kv/ZGOPSXbJnqew= Message-Id: MIME-Version: 1.0 From: Arun Isaac Date: Wed, 30 Aug 2017 13:37:49 +0530 In-reply-to: <20170822171303.21754-1-mail@cbaines.net> References: <20170822171303.21754-1-mail@cbaines.net> X-CSA-Complaints: whitelist-complaints@eco.de X-MJ-Mid: AEMAPOK4d0QAAAAAAAAAAAPmDT8AAAACwQwAAAAAAAW9WABZpnJ16Vd_upfPRwW8zWRvv6wQ7wAFgUc Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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: -0.0 (/) Ok. Ludo has spoken. :-) Let us proceed with the patch review. > - (define (install-file? file stat) > - (let ((stripped-file (string-trim (string-drop file (string-length s= ource)) #\/))) > - (and (any (cut string-match <> stripped-file) include) > - (not (any (cut string-match <> stripped-file) exclude))))) > + (define* (install-file? file stat #:key verbose?) > + (let* ((stripped-file (string-trim > + (string-drop file (string-length source)) #\/= ))) > + (define (match-stripped-file action regex) > + (let ((result (string-match regex stripped-file))) > + (if (and result verbose?) > + (format #t "info: ~A ~A as it matches \"~A\"\n" > + stripped-file action regex)) > + result)) > + > + (if verbose? > + (format #t "info: considering installing ~A\n" stripped-file)) > + > + (and (any (cut match-stripped-file "included" <>) include) > + (not (any (cut match-stripped-file "excluded" <>) exclude))))= ) If I understand this correctly, `install-file?' will be called with `#:verbose #t' only when no files were installed. In that case, we would simply get a long list of "excluded" statements. This seems a bit redundant. Do we really need this? ... continued below > + (if (null? files-to-install) > + (begin > + (format #t "error: No files found to install.\n") > + (find-files source (lambda (file stat) > + (install-file? file stat #:verbose? #t))) I understand that the verbose output also shows the regexp due to which the file was excluded, and that has debugging value. But, perhaps, it'll be better to just print that here instead of a call back to `install-file?'. WDYT? > + #f) > + (begin > + (for-each > + (lambda (file) > + (let* ((stripped-file (string-drop file (string-length sour= ce))) > + (target-file (string-append target-directory strippe= d-file))) > + (format #t "`~a' -> `~a'~%" file target-file) > + (install-file file (dirname target-file)))) > + files-to-install) > + #t)))) Could you please rewrite this section using `cond' instead of `if'? That way, we can get rid of the `begin'. Also, it might be better if we used "positive logic" -- meaning, we first check for truthiness of `files-to-install' instead of checking for (null? files-to-install). Then, the else statement would take care of the empty files-to-install case, and we would never have to call `null?' explicitly. = From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 30 Aug 2017 08:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 28185@debbugs.gnu.org Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.150408236516728 (code B ref 28185); Wed, 30 Aug 2017 08:40:02 +0000 Received: (at 28185) by debbugs.gnu.org; 30 Aug 2017 08:39:25 +0000 Received: from localhost ([127.0.0.1]:33269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmyWy-0004Lj-CN for submit@debbugs.gnu.org; Wed, 30 Aug 2017 04:39:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmyWw-0004LW-Jx for 28185@debbugs.gnu.org; Wed, 30 Aug 2017 04:39:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmyWn-00066G-Ky for 28185@debbugs.gnu.org; Wed, 30 Aug 2017 04:39:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmyWn-000669-IQ; Wed, 30 Aug 2017 04:39:13 -0400 Received: from [193.50.110.251] (port=48186 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dmyWk-0002oM-Ry; Wed, 30 Aug 2017 04:39:12 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170822171303.21754-1-mail@cbaines.net> <878ti2qc1c.fsf@gnu.org> <20170830082822.129f9361@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 Fructidor an 225 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Wed, 30 Aug 2017 10:39:09 +0200 In-Reply-To: <20170830082822.129f9361@cbaines.net> (Christopher Baines's message of "Wed, 30 Aug 2017 08:28:22 +0100") Message-ID: <878ti18n6a.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (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-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) Christopher Baines skribis: > On Tue, 29 Aug 2017 23:50:07 +0200 > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > >> Christopher Baines skribis: >>=20 >> > Modify the install phase to detect when nothing has been installed, >> > and error if this happens. This is preferable to continuing, and >> > allowing the next phase to fail. >> > >> > Also, when nothing can be found to be installed, print out each >> > file that was considered, along with the regular expressions that >> > were used to include and exclude it. >> > >> > * gnu/build/emacs-build-system.scm (install-file?): Add additional >> > error checking and logging.=20=20 >>=20 >> Nitpicking: >>=20 >> > + (define* (install-file? file stat #:key verbose?) >> > + (let* ((stripped-file (string-trim >> > + (string-drop file (string-length >> > source)) #\/))) >> > + (define (match-stripped-file action regex) >> > + (let ((result (string-match regex stripped-file))) >> > + (if (and result verbose?) >> > + (format #t "info: ~A ~A as it matches \"~A\"\n" >> > + stripped-file action regex)) >> > + result)) >> > + >> > + (if verbose? >> > + (format #t "info: considering installing ~A\n" >> > stripped-file))=20=20 >>=20 >> Use =E2=80=98when=E2=80=99 here, to clarify that this is for-effect. > > I've sent an updated patch which uses when. LGTM! > One final issue, as this changes the build system, every package that > uses it will need to be rebuilt. My count puts this at 162, which > suggests that this is fine to go straight on the master branch. Definitely, and these are very small packages anyway. Ludo=E2=80=99. From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 31 Aug 2017 21:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Arun Isaac Cc: 28185@debbugs.gnu.org Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.150421570713357 (code B ref 28185); Thu, 31 Aug 2017 21:42:02 +0000 Received: (at 28185) by debbugs.gnu.org; 31 Aug 2017 21:41:47 +0000 Received: from localhost ([127.0.0.1]:38223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnXDf-0003TN-5E for submit@debbugs.gnu.org; Thu, 31 Aug 2017 17:41:47 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:42389 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnXDb-0003TD-Nh for 28185@debbugs.gnu.org; Thu, 31 Aug 2017 17:41:44 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 690FE13D287; Thu, 31 Aug 2017 22:41:41 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id A4A3B13D286; Thu, 31 Aug 2017 22:41:40 +0100 (BST) Date: Thu, 31 Aug 2017 22:41:36 +0100 From: Christopher Baines Message-ID: <20170831224136.7499acc1@cbaines.net> In-Reply-To: <6f595802.AEMAPOK4d0UAAAAAAAAAAAPmDT4AAAACwQwAAAAAAAW9WABZpnJ1@mailjet.com> References: <20170822171303.21754-1-mail@cbaines.net> <6f595802.AEMAPOK4d0UAAAAAAAAAAAPmDT4AAAACwQwAAAAAAAW9WABZpnJ1@mailjet.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/v=kqHcmqDwP8nAmHjJ95Coq"; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) 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: -0.0 (/) --Sig_/v=kqHcmqDwP8nAmHjJ95Coq Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 30 Aug 2017 13:37:49 +0530 Arun Isaac wrote: > Ok. Ludo has spoken. :-) Let us proceed with the patch review. >=20 > > - (define (install-file? file stat) > > - (let ((stripped-file (string-trim (string-drop file > > (string-length source)) #\/))) > > - (and (any (cut string-match <> stripped-file) include) > > - (not (any (cut string-match <> stripped-file) > > exclude))))) > > + (define* (install-file? file stat #:key verbose?) > > + (let* ((stripped-file (string-trim > > + (string-drop file (string-length > > source)) #\/))) > > + (define (match-stripped-file action regex) > > + (let ((result (string-match regex stripped-file))) > > + (if (and result verbose?) > > + (format #t "info: ~A ~A as it matches \"~A\"\n" > > + stripped-file action regex)) > > + result)) > > + > > + (if verbose? > > + (format #t "info: considering installing ~A\n" > > stripped-file)) + > > + (and (any (cut match-stripped-file "included" <>) include) > > + (not (any (cut match-stripped-file "excluded" <>) > > exclude))))) =20 >=20 > If I understand this correctly, `install-file?' will be called with > `#:verbose #t' only when no files were installed. In that case, we > would simply get a long list of "excluded" statements. This seems a > bit redundant. Do we really need this? Here is a real example of what the output can look like: error: No files found to install. info: considering installing .gitignore info: considering installing .travis.yml info: considering installing Cask info: considering installing README.md info: considering installing Rakefile info: considering installing minitest.el info: minitest.el included as it matches "^[^/]*\.el$" info: minitest.el excluded as it matches "^[^/]*tests?\.el$" info: considering installing tools/snippet_extractor.rb info: considering installing test/minitest-unit-test.el info: considering installing test/test-helper.el info: considering installing snippets/minitest-mode/assert info: considering installing snippets/minitest-mode/assert_empty info: considering installing snippets/minitest-mode/assert_equal info: considering installing snippets/minitest-mode/assert_in_delta info: considering installing snippets/minitest-mode/assert_in_epsilon info: considering installing snippets/minitest-mode/assert_includes info: considering installing snippets/minitest-mode/assert_instance_of info: considering installing snippets/minitest-mode/assert_kind_of info: considering installing snippets/minitest-mode/assert_match info: considering installing snippets/minitest-mode/assert_nil info: considering installing snippets/minitest-mode/assert_operator info: considering installing snippets/minitest-mode/assert_output info: considering installing snippets/minitest-mode/assert_predicate info: considering installing snippets/minitest-mode/assert_raises info: considering installing snippets/minitest-mode/assert_respond_to info: considering installing snippets/minitest-mode/assert_same info: considering installing snippets/minitest-mode/assert_send info: considering installing snippets/minitest-mode/assert_silent info: considering installing snippets/minitest-mode/assert_throws info: considering installing snippets/minitest-mode/flunk info: considering installing snippets/minitest-mode/pass info: considering installing snippets/minitest-mode/refute info: considering installing snippets/minitest-mode/refute_empty info: considering installing snippets/minitest-mode/refute_equal info: considering installing snippets/minitest-mode/refute_in_delta info: considering installing snippets/minitest-mode/refute_in_epsilon info: considering installing snippets/minitest-mode/refute_includes info: considering installing snippets/minitest-mode/refute_instance_of info: considering installing snippets/minitest-mode/refute_kind_of info: considering installing snippets/minitest-mode/refute_match info: considering installing snippets/minitest-mode/refute_nil info: considering installing snippets/minitest-mode/refute_operator info: considering installing snippets/minitest-mode/refute_predicate info: considering installing snippets/minitest-mode/refute_respond_to info: considering installing snippets/minitest-mode/refute_same info: considering installing snippets/minitest-mode/skip > ... continued below >=20 > > + (if (null? files-to-install) > > + (begin > > + (format #t "error: No files found to install.\n") > > + (find-files source (lambda (file stat) > > + (install-file? file stat #:verbose? > > #t))) =20 >=20 > I understand that the verbose output also shows the regexp due to > which the file was excluded, and that has debugging value. But, > perhaps, it'll be better to just print that here instead of a call > back to `install-file?'. >=20 > WDYT? I put this in install-file? as I didn't want to duplicate the behaviour inside the function, firstly to avoid duplication, but also to avoid the possiblily that if they were duplicated, they would diverge in behaviour. I'm happy to experiment with splitting the "verbose" output out of install-file though? > > + #f) > > + (begin > > + (for-each > > + (lambda (file) > > + (let* ((stripped-file (string-drop file > > (string-length source))) > > + (target-file (string-append target-directory > > stripped-file))) > > + (format #t "`~a' -> `~a'~%" file target-file) > > + (install-file file (dirname target-file)))) > > + files-to-install) > > + #t)))) =20 >=20 > Could you please rewrite this section using `cond' instead of `if'? > That way, we can get rid of the `begin'. Also, it might be better if > we used "positive logic" -- meaning, we first check for truthiness of > `files-to-install' instead of checking for (null? > files-to-install). Then, the else statement would take care of the > empty files-to-install case, and we would never have to call `null?' > explicitly. I tried this, but it seems that cond will treat '() as if it evaluates to true: scheme@(guile-user)> (cond ('() #t) (else #f)) $1 =3D #t So this might need to still use null?, or even (not (null? files-to-install))? --Sig_/v=kqHcmqDwP8nAmHjJ95Coq Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmogpBfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XcSchAAqqIrppCNK4BO6rQZ7tltlr0WyHZJyOs0eHlhP/y3Bw0WLWJovOpCWHOb bG961ZClu8L1kbRUSqFwUY1xRCU9/LExo50ScT1MEdrB1xzjOVJrrKlJwyDKqvfu ltnUbGTB93CcNS+6Q3I41W2NotkFfi/7tIYmMYBXTELjcAlRmU9lZvwftpPbcKcI uyIVJicOFd1Oj2yBXdLxjLn9YDl79USs4N70IHZht7YvXsMD5kGdJxrxtVrsSkwq LpyzRxWvc98DBcz91Jc8oz3ZKrN3vYYqd7s7aBgiTO06hxKPwHj7aa12/tUUff+2 lo+KAEXWyMXOEsH3gFlhJ94LjYNUcwU4p+ztD8Wy1djYanR5rN3OW8HAqWcZ+3+M ikfV22FgKSrWvC6B56fhC6uiIS26ncJ3W1FEgPlM2M0fa9wBfZ9Q+CEFrB9oJJ/B LxtH7EcluHxsBe9e1WKZ9ofEWCLl2ozKZgQdQSmTqwMvrDK6SkG7Mx6OerSn0VXe gMH8Fd8UNUCD9CUy019gDPy5PTfIY3w1jmwwpvigW9eNt/D76AeI6FPA39Vb4zDV VkAyW0kbUpTHOjOQnWzCLUQpqw14/7JFFvy15csVruyMDFKNQle1HjCsyWW5KLu8 RFNsRXoEMnr9abAIcLCFlOhjqIuFSCJK4AHh2WsWCGhyOGM+8m0= =FaQU -----END PGP SIGNATURE----- --Sig_/v=kqHcmqDwP8nAmHjJ95Coq-- From unknown Sat Aug 16 18:44:29 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Sep 2017 05:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 28185@debbugs.gnu.org Received: via spool by 28185-submit@debbugs.gnu.org id=B28185.150424215727905 (code B ref 28185); Fri, 01 Sep 2017 05:03:02 +0000 Received: (at 28185) by debbugs.gnu.org; 1 Sep 2017 05:02:37 +0000 Received: from localhost ([127.0.0.1]:38733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dne6H-0007G0-FB for submit@debbugs.gnu.org; Fri, 01 Sep 2017 01:02:37 -0400 Received: from o175.p8.mailjet.com ([87.253.233.175]:58276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <47bc196c.AEAAPQNLdNsAAAAAAAAAAAPmDT8AAAACwQwAAAAAAAW9WABZqOnq@bnc3.mailjet.com>) id 1dne6G-0007Fq-88 for 28185@debbugs.gnu.org; Fri, 01 Sep 2017 01:02:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; q=dns/txt; d=bnc3.mailjet.com; i=arunisaac=3Dsystemreboot.net@bnc3.mailjet.com; s=mailjet; h=message-id:mime-version:from:to:subject:date:list-unsubscribe:cc:in-reply-to: references:x-csa-complaints:x-mj-mid:content-type:content-transfer-encoding; bh=G1Z68kuMJeVHHAmnIh18kA3HqxZH/0Rsyfbvosba6lA=; b=pc+3w8mPm3WA7/1lSdv0W/HfTEOzuwoKGFyFQ0U0rkuX/s0nso1eVERw5 EY/tn15ctSZIoyGeWSmAWjSi5HKpsLJkBC0h55JQL4caj2W57XuXabSq8wSI +dYxu+VRuwlfc1sgxXcmDVLufs/RdsMXdEBk5Z5q0L7fTMNb3Q2zYE= Message-Id: <47bc196c.AEAAPQNLdNsAAAAAAAAAAAPmDT8AAAACwQwAAAAAAAW9WABZqOnq@mailjet.com> MIME-Version: 1.0 From: Arun Isaac Date: Fri, 01 Sep 2017 10:32:18 +0530 In-reply-to: <20170831224136.7499acc1@cbaines.net> References: <20170822171303.21754-1-mail@cbaines.net> <6f595802.AEMAPOK4d0UAAAAAAAAAAAPmDT4AAAACwQwAAAAAAAW9WABZpnJ1@mailjet.com> <20170831224136.7499acc1@cbaines.net> X-CSA-Complaints: whitelist-complaints@eco.de X-MJ-Mid: AEAAPQNLdNsAAAAAAAAAAAPmDT8AAAACwQwAAAAAAAW9WABZqOnquIJIOOuFQAKQwzYjadS3SwAFgUc Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.0 (-) 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 (-) >> > + (if (null? files-to-install) >> > + (begin >> > + (format #t "error: No files found to install.\n") >> > + (find-files source (lambda (file stat) >> > + (install-file? file stat #:verbose? >> > #t))) >> >> I understand that the verbose output also shows the regexp due to >> which the file was excluded, and that has debugging value. But, >> perhaps, it'll be better to just print that here instead of a call >> back to `install-file?'. >> >> WDYT? > > I put this in install-file? as I didn't want to duplicate the behaviour > inside the function, firstly to avoid duplication, but also to avoid > the possiblily that if they were duplicated, they would diverge in > behaviour. I'm happy to experiment with splitting the "verbose" output > out of install-file though? Yes, I meant that you should split the verbose output out of `install-file?'. But, it's not a big deal. I'm only nitpicking. Do go ahead with your original code if you think it's alright. >> > + #f) >> > + (begin >> > + (for-each >> > + (lambda (file) >> > + (let* ((stripped-file (string-drop file >> > (string-length source))) >> > + (target-file (string-append target-directory >> > stripped-file))) >> > + (format #t "`~a' -> `~a'~%" file target-file) >> > + (install-file file (dirname target-file)))) >> > + files-to-install) >> > + #t)))) >> >> Could you please rewrite this section using `cond' instead of `if'? >> That way, we can get rid of the `begin'. Also, it might be better if >> we used "positive logic" -- meaning, we first check for truthiness of >> `files-to-install' instead of checking for (null? >> files-to-install). Then, the else statement would take care of the >> empty files-to-install case, and we would never have to call `null?' >> explicitly. > > I tried this, but it seems that cond will treat '() as if it evaluates > to true: > > scheme@(guile-user)> (cond ('() #t) (else #f)) > $1 =3D #t > > So this might need to still use null?, or even (not (null? > files-to-install))? Ah, yes. Sorry, I'm confusing scheme's behaviour with that of other lisps. We still need `null?'. The patch LGTM. = From unknown Sat Aug 16 18:44:29 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: Christopher Baines Subject: bug#28185: closed (Re: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful.) Message-ID: References: <20170901220855.65406f21@cbaines.net> <20170822171303.21754-1-mail@cbaines.net> X-Gnu-PR-Message: they-closed 28185 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 28185@debbugs.gnu.org Date: Fri, 01 Sep 2017 21:10:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1504300202-2063-1" This is a multi-part message in MIME format... ------------=_1504300202-2063-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #28185: [PATCH] build: emacs-build-system: Make the install phase more help= ful. 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 28185@debbugs.gnu.org. --=20 28185: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28185 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1504300202-2063-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 28185-done) by debbugs.gnu.org; 1 Sep 2017 21:09:06 +0000 Received: from localhost ([127.0.0.1]:40663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dntBX-0000Vz-SA for submit@debbugs.gnu.org; Fri, 01 Sep 2017 17:09:04 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:43297 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dntBV-0000Vf-TA for 28185-done@debbugs.gnu.org; Fri, 01 Sep 2017 17:09:02 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 8742313D298; Fri, 1 Sep 2017 22:08:59 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 3D53B13D297; Fri, 1 Sep 2017 22:08:59 +0100 (BST) Date: Fri, 1 Sep 2017 22:08:55 +0100 From: Christopher Baines To: Arun Isaac Subject: Re: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Message-ID: <20170901220855.65406f21@cbaines.net> In-Reply-To: References: <20170822171303.21754-1-mail@cbaines.net> <6f595802.AEMAPOK4d0UAAAAAAAAAAAPmDT4AAAACwQwAAAAAAAW9WABZpnJ1@mailjet.com> <20170831224136.7499acc1@cbaines.net> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Vpql4FI9ec0l/KMPR3ZOE5f"; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 28185-done Cc: 28185-done@debbugs.gnu.org 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: -0.0 (/) --Sig_/Vpql4FI9ec0l/KMPR3ZOE5f Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 01 Sep 2017 10:32:18 +0530 Arun Isaac wrote: > >> > + (if (null? files-to-install) > >> > + (begin > >> > + (format #t "error: No files found to install.\n") > >> > + (find-files source (lambda (file stat) > >> > + (install-file? file stat > >> > #:verbose? #t))) =20 > >> > >> I understand that the verbose output also shows the regexp due to > >> which the file was excluded, and that has debugging value. But, > >> perhaps, it'll be better to just print that here instead of a call > >> back to `install-file?'. > >> > >> WDYT? =20 > > > > I put this in install-file? as I didn't want to duplicate the > > behaviour inside the function, firstly to avoid duplication, but > > also to avoid the possiblily that if they were duplicated, they > > would diverge in behaviour. I'm happy to experiment with splitting > > the "verbose" output out of install-file though? =20 >=20 > Yes, I meant that you should split the verbose output out of > `install-file?'. But, it's not a big deal. I'm only nitpicking. Do go > ahead with your original code if you think it's alright. >=20 > >> > + #f) > >> > + (begin > >> > + (for-each > >> > + (lambda (file) > >> > + (let* ((stripped-file (string-drop file > >> > (string-length source))) > >> > + (target-file (string-append target-directory > >> > stripped-file))) > >> > + (format #t "`~a' -> `~a'~%" file target-file) > >> > + (install-file file (dirname target-file)))) > >> > + files-to-install) > >> > + #t)))) =20 > >> > >> Could you please rewrite this section using `cond' instead of `if'? > >> That way, we can get rid of the `begin'. Also, it might be better > >> if we used "positive logic" -- meaning, we first check for > >> truthiness of `files-to-install' instead of checking for (null? > >> files-to-install). Then, the else statement would take care of the > >> empty files-to-install case, and we would never have to call > >> `null?' explicitly. =20 > > > > I tried this, but it seems that cond will treat '() as if it > > evaluates to true: > > > > scheme@(guile-user)> (cond ('() #t) (else #f)) > > $1 =3D #t > > > > So this might need to still use null?, or even (not (null? > > files-to-install))? =20 >=20 > Ah, yes. Sorry, I'm confusing scheme's behaviour with that of other > lisps. We still need `null?'. >=20 > The patch LGTM. Great, I've pushed this now :) --Sig_/Vpql4FI9ec0l/KMPR3ZOE5f Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmpzGdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xc1HRAAgajG18yg5LDVdQqaFRuoT/ZfrcCSdo5Af8+3MHWFfvhVbGyxzAJJbpyg CMDThMCw/C42T4OfDQy4XNvHl2ZvD14W54mxqQDKFb+hC4TOXfkNtw/XqczI1HOK Q7+nE+St7E2vuOhDNHPTPnSQX0UNiGfHYhmxbhXwyk3SYSnPCe5ehFYuvS0+ugZr aadVhl2xUQk15Bcg59TgRVKgitQwiYE4DnSaiUmua1eL6eQMGEiCrMvlAI5T5Pr5 qNfZQgL2lVXqtyzPU4eiIhG0jycAHxVd3YaOO/dB3h7lfQHKh4WmXOdl9/vwyOcy QswbyDJMNcXjNZrvGbuix5Fx5w5n0gxz0wCqiz02TBvAakmEGqSU2MvHOFqNl1kI Z8TDS2O6zqi9kiOsmkrCBNQ61nAKXvwR12QIcusupGwtvpEFcUPQ+0bbDskNIBph 6JOrrr8WDPM5B2uT5YePKu7cnH0QZmKzR5RB9cmMwMudhD0TQmW1t4NWCsDMOOsW CbzYoOsa3QbnR6119xAVAyxhx1Cr0cHtQh5AmkR+b/PBUizCHDTBGx12yiXVjfTm N496N5D8blh6ceroJV1BSYJJ9NcgGPyRZkiuhMq7sKPloYHQy3ZSzZy4tIMuzhXe E1PIwT3c++rROH6WTCGgptjqV4Fyv1top4LIagaAdQDlcFHj91s= =grNb -----END PGP SIGNATURE----- --Sig_/Vpql4FI9ec0l/KMPR3ZOE5f-- ------------=_1504300202-2063-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 22 Aug 2017 17:13:20 +0000 Received: from localhost ([127.0.0.1]:49803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkCjv-0002fL-UI for submit@debbugs.gnu.org; Tue, 22 Aug 2017 13:13:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkCjt-0002f7-RR for submit@debbugs.gnu.org; Tue, 22 Aug 2017 13:13:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkCjn-0002Zt-KC for submit@debbugs.gnu.org; Tue, 22 Aug 2017 13:13:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52070) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkCjn-0002ZT-Ho for submit@debbugs.gnu.org; Tue, 22 Aug 2017 13:13:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkCjm-00042l-7r for guix-patches@gnu.org; Tue, 22 Aug 2017 13:13:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkCji-0002W1-5M for guix-patches@gnu.org; Tue, 22 Aug 2017 13:13:10 -0400 Received: from mira.cbaines.net ([2a01:7e00::f03c:91ff:fe69:8da9]:48046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkCjh-0002VS-S3 for guix-patches@gnu.org; Tue, 22 Aug 2017 13:13:06 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id A0B7513D23E; Tue, 22 Aug 2017 18:13:03 +0100 (BST) Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 72AC113D23A for ; Tue, 22 Aug 2017 18:13:03 +0100 (BST) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id f075fbfd for ; Tue, 22 Aug 2017 17:13:03 +0000 (UTC) From: Christopher Baines To: guix-patches@gnu.org Subject: [PATCH] build: emacs-build-system: Make the install phase more helpful. Date: Tue, 22 Aug 2017 18:13:03 +0100 Message-Id: <20170822171303.21754-1-mail@cbaines.net> X-Mailer: git-send-email 2.13.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) 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: -4.0 (----) Modify the install phase to detect when nothing has been installed, and error if this happens. This is preferable to continuing, and allowing the next phase to fail. Also, when nothing can be found to be installed, print out each file that was considered, along with the regular expressions that were used to include and exclude it. * gnu/build/emacs-build-system.scm (install-file?): Add additional error checking and logging. --- guix/build/emacs-build-system.scm | 45 ++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index bda699ddf..d67d7b49c 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -110,22 +110,41 @@ store in '.el' files." (define source (getcwd)) - (define (install-file? file stat) - (let ((stripped-file (string-trim (string-drop file (string-length source)) #\/))) - (and (any (cut string-match <> stripped-file) include) - (not (any (cut string-match <> stripped-file) exclude))))) + (define* (install-file? file stat #:key verbose?) + (let* ((stripped-file (string-trim + (string-drop file (string-length source)) #\/))) + (define (match-stripped-file action regex) + (let ((result (string-match regex stripped-file))) + (if (and result verbose?) + (format #t "info: ~A ~A as it matches \"~A\"\n" + stripped-file action regex)) + result)) + + (if verbose? + (format #t "info: considering installing ~A\n" stripped-file)) + + (and (any (cut match-stripped-file "included" <>) include) + (not (any (cut match-stripped-file "excluded" <>) exclude))))) (let* ((out (assoc-ref outputs "out")) (elpa-name-ver (store-directory->elpa-name-version out)) - (target-directory (string-append out %install-suffix "/" elpa-name-ver))) - (for-each - (lambda (file) - (let* ((stripped-file (string-drop file (string-length source))) - (target-file (string-append target-directory stripped-file))) - (format #t "`~a' -> `~a'~%" file target-file) - (install-file file (dirname target-file)))) - (find-files source install-file?))) - #t) + (target-directory (string-append out %install-suffix "/" elpa-name-ver)) + (files-to-install (find-files source install-file?))) + (if (null? files-to-install) + (begin + (format #t "error: No files found to install.\n") + (find-files source (lambda (file stat) + (install-file? file stat #:verbose? #t))) + #f) + (begin + (for-each + (lambda (file) + (let* ((stripped-file (string-drop file (string-length source))) + (target-file (string-append target-directory stripped-file))) + (format #t "`~a' -> `~a'~%" file target-file) + (install-file file (dirname target-file)))) + files-to-install) + #t)))) (define* (move-doc #:key outputs #:allow-other-keys) "Move info files from the ELPA package directory to the info directory." -- 2.13.1 ------------=_1504300202-2063-1--