From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails Date: Sat, 02 Sep 2023 12:03:57 +0000 Message-ID: <877cp8g4sy.fsf@posteo.net> References: <87v8cvvi6r.fsf@breatheoutbreathe.in> <87r0njvhyo.fsf@breatheoutbreathe.in> <87msy7vhum.fsf@breatheoutbreathe.in> <87pm33r87q.fsf@posteo.net> <87sf7yoq9p.fsf@breatheoutbreathe.in> <87fs3yvxve.fsf@posteo.net> <87ttsdmpwm.fsf@breatheoutbreathe.in> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16057"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65649@debbugs.gnu.org To: Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 02 14:05:04 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qcPN9-0003wY-SO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Sep 2023 14:05:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcPN3-0001v9-Ec; Sat, 02 Sep 2023 08:04:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qcPMz-0001ro-6b for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 08:04:53 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qcPMy-0004xA-UZ for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 08:04:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcPN8-0005G3-KL for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 08:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Sep 2023 12:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65649 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65649-submit@debbugs.gnu.org id=B65649.169365625820154 (code B ref 65649); Sat, 02 Sep 2023 12:05:02 +0000 Original-Received: (at 65649) by debbugs.gnu.org; 2 Sep 2023 12:04:18 +0000 Original-Received: from localhost ([127.0.0.1]:35368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcPMP-0005Ey-DJ for submit@debbugs.gnu.org; Sat, 02 Sep 2023 08:04:17 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:46093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcPMN-0005Ef-6B for 65649@debbugs.gnu.org; Sat, 02 Sep 2023 08:04:16 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 297A9240029 for <65649@debbugs.gnu.org>; Sat, 2 Sep 2023 14:03:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1693656239; bh=5QX4fZ+scqSqLc68eVum5zdm6g2GugoOSTRXzcK+dyo=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=jDumfN49U2xp9aOQwvw0UV+/U0BJfhpKtbF9AKfDumjhmsTadVlF8M2jBxEPfx9hc rXEdQeJkF/NfWUiC7AECJaZItIPZscpC5NePRUZ4Mfuv5+IFrBKe46C5Vcn5xralbS hr7iIY4GV5qWMnh7A6Tp4ehKqD33wcqkbN3mGVXZlzJwaF7s19TlDHq9z8NcPYtsk8 iCPIg9efw0EGhHv+m0Tw37mPb5KRHEFbbnR/bB9HLLGzqsKkvkjX1z/ljJrJTTf2OQ qKoNlq7ru4T++9WfWcz8Owm+Dw1ePKmJvK6+hveIgpmwprkPblZ21Gt91w6DV0JXS+ QkaIZNcYARv8A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RdD8G2RYgz9rxD; Sat, 2 Sep 2023 14:03:58 +0200 (CEST) In-Reply-To: <87ttsdmpwm.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Fri, 01 Sep 2023 16:28:59 -0700") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268986 Archived-At: Joseph Turner writes: > Philip Kaludercic writes: > >> Yes, as soon as one is sending a message to [bugnumber]@debbugs.gnu.org, >> everything is fine. The issue if you Cc me directly, is that if I don't >> watch out, I'll send my response to bug-gnu-emacs@gnu.org, and thus >> create a new bug. > > Thanks, that's clear now. > >> I am not sure we want that behaviour at all actually. Just because >> there is a typo in the documentation, doesn't mean the package is >> unusable. The user should be able to install the package, be notified >> about the error -- if the have the time, they can fix it and send the >> maintainer a patch resolving the issue for everyone. Likewise, if the >> user updates a package, it wouldn't make sense to ignore everything or >> worse still revert the update due to a small mistake in the >> documentation file. >> >> ... >> >> There is no reason why we cannot already create and use the buffer >> earlier, to log org-related bugs. One has to be careful when emptying >> the buffer, but it might make sense to have a separate buffer for each >> package, especially when updating multiple packages at once... > > Please see attached patches. > >>>From aa356f561ab7861f463d3024f574fc71d45cb00b Mon Sep 17 00:00:00 2001 > From: Joseph Turner > Date: Wed, 30 Aug 2023 23:24:16 -0700 > Subject: [PATCH 1/2] Include package name in package-vc documentation log > buffer name > > * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation): > --- > lisp/emacs-lisp/package-vc.el | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el > index 747fe696204..ea8d9ecf488 100644 > --- a/lisp/emacs-lisp/package-vc.el > +++ b/lisp/emacs-lisp/package-vc.el > @@ -423,7 +423,7 @@ otherwise it's assumed to be an Info file." > (let ((default-directory docs-directory)) > (org-export-to-file 'texinfo file)) > (setq clean-up t))) > - (with-current-buffer (get-buffer-create " *package-vc doc*") > + (with-current-buffer (get-buffer-create (format " *package-vc doc: %s*" pkg-name)) > (erase-buffer) > (cond > ((/= 0 (call-process "makeinfo" nil t nil > -- > 2.41.0 This looks good, thanks! > >>>From 010dabfbba8ebeb7f7193482ae2ffc7ec5b694e3 Mon Sep 17 00:00:00 2001 > From: Joseph Turner > Date: Fri, 1 Sep 2023 16:22:45 -0700 > Subject: [PATCH 2/2] Log org export errors to package-vc doc buffer > > * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation): > Wrap the org-export logic in condition-case, allowing package > installation to continue while preserving error messages. > --- > lisp/emacs-lisp/package-vc.el | 52 +++++++++++++++++++---------------- > 1 file changed, 29 insertions(+), 23 deletions(-) > > diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el > index ea8d9ecf488..a8393cb7e75 100644 > --- a/lisp/emacs-lisp/package-vc.el > +++ b/lisp/emacs-lisp/package-vc.el > @@ -413,30 +413,36 @@ otherwise it's assumed to be an Info file." > (default-directory (package-desc-dir pkg-desc)) > (docs-directory (file-name-directory (expand-file-name file))) > (output (expand-file-name (format "%s.info" pkg-name))) > + (log-buffer (get-buffer-create (format " *package-vc doc: %s*" pkg-name))) > clean-up) > - (when (string-match-p "\\.org\\'" file) > - (require 'ox) > - (require 'ox-texinfo) > - (with-temp-buffer > - (insert-file-contents file) > - (setq file (make-temp-file "ox-texinfo-")) > - (let ((default-directory docs-directory)) > - (org-export-to-file 'texinfo file)) > - (setq clean-up t))) > - (with-current-buffer (get-buffer-create (format " *package-vc doc: %s*" pkg-name)) > - (erase-buffer) > - (cond > - ((/= 0 (call-process "makeinfo" nil t nil > - "-I" docs-directory > - "--no-split" file > - "-o" output)) > - (message "Failed to build manual %s, see buffer %S" > - file (buffer-name))) > - ((/= 0 (call-process "install-info" nil t nil > - output (expand-file-name "dir"))) > - (message "Failed to install manual %s, see buffer %S" > - output (buffer-name))) > - ((kill-buffer)))) > + (with-current-buffer log-buffer > + (erase-buffer)) > + (condition-case err > + (progn > + (when (string-match-p "\\.org\\'" file) > + (require 'ox) > + (require 'ox-texinfo) > + (with-temp-buffer > + (insert-file-contents file) > + (setq file (make-temp-file "ox-texinfo-")) > + (let ((default-directory docs-directory)) > + (org-export-to-file 'texinfo file)) > + (setq clean-up t))) > + (cond > + ((/= 0 (call-process "makeinfo" nil log-buffer nil > + "-I" docs-directory > + "--no-split" file > + "-o" output)) > + (message "Failed to build manual %s, see buffer %S" > + file (buffer-name))) > + ((/= 0 (call-process "install-info" nil log-buffer nil > + output (expand-file-name "dir"))) > + (message "Failed to install manual %s, see buffer %S" > + output (buffer-name))) > + ((kill-buffer log-buffer)))) > + (error (with-current-buffer log-buffer > + (insert (error-message-string err))) > + (message "Failed to export org manual for %s, see buffer %S" pkg-name log-buffer))) I think it would be better to wrap only the org code in the `condition-case' body, ideally with a more specific error type (if that doesn't exist, that is something we could mention to the Org maintainers). > (when clean-up > (delete-file file))))