From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails Date: Fri, 01 Sep 2023 16:28:59 -0700 Message-ID: <87ttsdmpwm.fsf@breatheoutbreathe.in> 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> Reply-To: Joseph Turner Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36749"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65649@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 02 01:32:10 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 1qcDcX-0009MK-PX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Sep 2023 01:32:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcDcJ-0006zO-0V; Fri, 01 Sep 2023 19:31:55 -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 1qcDcH-0006z6-CQ for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 19:31: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 1qcDcH-0008HV-4o for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 19:31:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcDcQ-0006i7-Hf for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 19:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Sep 2023 23:32: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.169361111725784 (code B ref 65649); Fri, 01 Sep 2023 23:32:02 +0000 Original-Received: (at 65649) by debbugs.gnu.org; 1 Sep 2023 23:31:57 +0000 Original-Received: from localhost ([127.0.0.1]:34467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcDcL-0006ho-8z for submit@debbugs.gnu.org; Fri, 01 Sep 2023 19:31:57 -0400 Original-Received: from out-239.mta0.migadu.com ([91.218.175.239]:60787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcDcI-0006hc-7R for 65649@debbugs.gnu.org; Fri, 01 Sep 2023 19:31:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1693611103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=q/ZhmdLHHbUQw2AE+nXCRNIJSRCuuEN8O7Bd8q6+CyY=; b=fQH9Hcx8aGr4j5W3d1O0JwJ8oMhk4l6dmXM59Ka6yroT3LH5LikKau+tKbyqlgb9GlRCjh m0kcRUfEHpKY7EpOOa2sCoHRnCOfRDo73pAvNZMuxvntuZISitV19EpdRdkMkTHIX0fS3f NTUDCBt4bsylNbPjTW1/NmbSs+SGJkc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <87fs3yvxve.fsf@posteo.net> X-Migadu-Flow: FLOW_OUT 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:268942 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Include-package-name-in-package-vc-documentation-log.patch >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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Log-org-export-errors-to-package-vc-doc-buffer.patch >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))) (when clean-up (delete-file file)))) -- 2.41.0 --=-=-=--