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: Thu, 31 Aug 2023 07:18:01 +0000 Message-ID: <87pm33r87q.fsf@posteo.net> References: <87v8cvvi6r.fsf@breatheoutbreathe.in> <87r0njvhyo.fsf@breatheoutbreathe.in> <87msy7vhum.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="7315"; 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 Thu Aug 31 09:19:23 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 1qbbxa-0001h9-Ub for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Aug 2023 09:19:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbbxA-00036f-AF; Thu, 31 Aug 2023 03:18:56 -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 1qbbx8-00035x-Vg for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 03:18:54 -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 1qbbx8-0002qQ-O5 for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 03:18:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qbbxG-0007o5-CS for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 03:19: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: Thu, 31 Aug 2023 07:19: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.169346630029958 (code B ref 65649); Thu, 31 Aug 2023 07:19:02 +0000 Original-Received: (at 65649) by debbugs.gnu.org; 31 Aug 2023 07:18:20 +0000 Original-Received: from localhost ([127.0.0.1]:54756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbbwZ-0007n7-Vy for submit@debbugs.gnu.org; Thu, 31 Aug 2023 03:18:20 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:45127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbbwW-0007mt-UK for 65649@debbugs.gnu.org; Thu, 31 Aug 2023 03:18:18 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 54B55240027 for <65649@debbugs.gnu.org>; Thu, 31 Aug 2023 09:18:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1693466282; bh=DD6fHDGiDPC1U3ZBU8BTc43gR2yTXKAHa7SviVXYjkU=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=r0CpspR/VLKsIKFdaoN9O96iPP3irNxvalebyQruIN4PUJvcQmE1rneont6sR+erm Xt00Ok7sxbHYvILOzUGAXkpBCBwLOmI0Gn53XrrZ+/UQ84ak34AR/lSD46XVxj4X6R 74LnScAB8na0cFJaj/g5iVdaI8BoEZls5JzIOK8uCHMfA+YHXvNEpoBlaO0YeIDuLE vYdsHo4iCMnmlsQRKR2E3QQcbREfZp/K5aUB6BDCNib/hrN3VXkhjAEaJmRWECaC3l BnHt2iWc//odCLnJVLP9QlsU4tDH8Mlbthdu7f0q6/FMlYlyCu/An7WCHZ1Q9pbNgD K/OEM65e5AisA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RbsvF4mvWz9rxT; Thu, 31 Aug 2023 09:18:01 +0200 (CEST) In-Reply-To: <87msy7vhum.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Wed, 30 Aug 2023 23:34:29 -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:268790 Archived-At: Btw, watch out when reporting a bug, you shouldn't CC people directly, but add a X-Debbugs-CC header (https://debbugs.gnu.org/Reporting.html#xcc), as otherwise I'd be creating a new bug report when responding to your message. Joseph Turner writes: > It would be nice to report more information about the package with failed > documentation, but AFAICT with-demoted-errors does not allow its FORMAT > string to be a symbol whose value is a string. What are the main errors we are concerned with? I am a bit concerned that `with-demoted-errors' is a too coarse approach and might be applied to widely in your current patch. It might be better to use a classical condition-case and handle the right errors in the right place, or if practicable try to detect if an error would occur before doing anything. Also, the buffer *package-vc doc* should stay persistent and would include error messages, that could also be used here. > Joseph Turner writes: > >> Oops, the format string should be %S, not %s. >> >> [2. text/x-diff; 0001-Continue-installing-package-when-documentation-build.patch] >> From 83c62d80b5199cee911e30c1f3bb03c5a585b689 Mon Sep 17 00:00:00 2001 >> From: Joseph Turner >> Date: Wed, 30 Aug 2023 23:24:16 -0700 >> Subject: [PATCH] Continue installing package when documentation building fails >> >> * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation): >> Demote errors to messages. >> --- >> lisp/emacs-lisp/package-vc.el | 61 ++++++++++++++++++----------------- >> 1 file changed, 31 insertions(+), 30 deletions(-) >> >> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el >> index 747fe696204..bc1200c583f 100644 >> --- a/lisp/emacs-lisp/package-vc.el >> +++ b/lisp/emacs-lisp/package-vc.el >> @@ -409,36 +409,37 @@ prepared." >> "Build documentation for package PKG-DESC from documentation source in FILE. >> FILE can be an Org file, indicated by its \".org\" extension, >> otherwise it's assumed to be an Info file." >> - (let* ((pkg-name (package-desc-name pkg-desc)) >> - (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))) >> - 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 " *package-vc doc*") >> - (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)))) >> - (when clean-up >> - (delete-file file)))) >> + (with-demoted-errors "package-vc: Could not build documentation: %S" >> + (let* ((pkg-name (package-desc-name pkg-desc)) >> + (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))) >> + 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 " *package-vc doc*") >> + (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)))) >> + (when clean-up >> + (delete-file file))))) >> >> (defun package-vc-install-dependencies (deps) >> "Install missing dependencies according to DEPS.