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#63336: [PATCH] package-vc: Process :make and :shell-command spec args Date: Sat, 13 May 2023 17:18:24 +0000 Message-ID: <87r0rk880v.fsf@posteo.net> References: <874joprxmx.fsf@breatheoutbreathe.in> <87jzxkecnk.fsf@posteo.net> <87pm7b7up0.fsf@breatheoutbreathe.in> <877ctghey0.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7481"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63336@debbugs.gnu.org To: Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 13 19:19:26 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 1pxstx-0001h8-On for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 May 2023 19:19:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxstb-0001EG-HM; Sat, 13 May 2023 13:19:03 -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 1pxsta-0001E0-IB for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 13:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pxstZ-0001kT-UN for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 13:19:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pxstZ-0002dm-Pe for bug-gnu-emacs@gnu.org; Sat, 13 May 2023 13:19:01 -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, 13 May 2023 17:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63336 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 63336-submit@debbugs.gnu.org id=B63336.168399831210102 (code B ref 63336); Sat, 13 May 2023 17:19:01 +0000 Original-Received: (at 63336) by debbugs.gnu.org; 13 May 2023 17:18:32 +0000 Original-Received: from localhost ([127.0.0.1]:39492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxst6-0002cr-5I for submit@debbugs.gnu.org; Sat, 13 May 2023 13:18:32 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:57013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxst4-0002cb-V5 for 63336@debbugs.gnu.org; Sat, 13 May 2023 13:18:31 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 6EE7524002F for <63336@debbugs.gnu.org>; Sat, 13 May 2023 19:18:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1683998305; bh=D/5pqouVJTcKYaFVF6jWQkUz4xenE0eOExfKN0mNbeA=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=BMsA7rVN9kL4sqDr5NPwUyILJp96U4152TDoXqTKAeJppyZh6RCwr6S+6uqexdVAj pj+JfSo6t054mbRa1HvCqu61q5B+M82YO3yn78nRC7jwOWCnMCflSYz2sHoGQ+01XH TeagUK/FQI9NxDDc7Axp1/IMyoDns3qcaXSfHyz10/Y7eF9hT0P9s0BWJZ2s7O508A cZ0SzGme2ZNASyrocOL8TwW+Aeh8sVg7lkQx9hd9ynoi7rr0iZ4zmKRcnTuxf65OS1 iPMN52tpnad7jfYQKl6otdgxU0LfWH/AwDkusAtvJNeSxmjxlvSI0pPI/2buNkFQIa cPr6neqjn+urQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QJXQn0kwGz9rxB; Sat, 13 May 2023 19:18:25 +0200 (CEST) In-Reply-To: <877ctghey0.fsf@posteo.net> (Philip Kaludercic's message of "Wed, 10 May 2023 06:35:03 +0000") 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:261692 Archived-At: ping? Philip Kaludercic writes: > Joseph Turner writes: > >>>> +(defun package-vc--make (pkg-spec dir) >>>> + "Process :make and :shell-command spec arguments." >>>> + (let ((target (plist-get pkg-spec :make)) >>>> + (cmd (plist-get pkg-spec :shell-command))) >>>> + (when (or cmd target) >>>> + (with-current-buffer (get-buffer-create " *package-vc make*") >>> ^ >>> should the package name >>> be mentioned here? >> >> I like this idea, but IIUC package-vc--make would then need to take an >> extra arg, since pkg-spec doesn't contain the :name of the package. We >> could also add :name to the pkg-spec plist? > > I wouldn't be in favour of that, I think that passing the name as a > separate argument would be a better solution. > >> For comparison, package-vc--build-documentation creates a buffer called >> " *package-vc doc*" without the package name. > > The difference I see here is that documentation usually builds fine, > while :make or :shell-command have a higher chance of failing because > some software is missing, especially if people don't use :make the way > it is used on the ELPA server but to build external dependencies (I'm > thinking of mail clients like notmuch) > >>>> + target (buffer-name))))))) >>>> + >>>> (declare-function org-export-to-file "ox" (backend file)) >>>> >>>> (defun package-vc--build-documentation (pkg-desc file) >>>> @@ -486,6 +515,9 @@ documentation and marking the package as installed." >>>> ;; Generate package file >>>> (package-vc--generate-description-file pkg-desc pkg-file) >>>> >>>> + ;; Process :make and :shell-command arguments before building documentation >>>> + (when package-vc-process-make (package-vc--make pkg-spec pkg-dir)) >>> >>> Wasn't the plan to allow `package-vc-process-make' to either be a >>> generic "build-anything" or a selective listing of packages where we >>> allow :make and :shell-command to be executed? >> >> Let me know if the attached commit accomplishes what you had in mind. > > Yes, that (or rather the newest version from a different message) looks good. > >>>> + >>>> ;; Detect a manual >>>> (when (executable-find "install-info") >>>> (dolist (doc-file (ensure-list (plist-get pkg-spec :doc))) >>> >>> Otherwise this looks good, but I haven't tried it out yet. >> >> I fixed up a couple other issues: >> >> - removed unnecessary dir arg to package-vc--make >> - added function arg to the docstring for package-vc--make >> >> I'm not sure if the customization type for package-vc-process-make is >> correct. Please double check that. >> >> Also, should users be able to run :make and :shell-command args defined >> in a spec passed into package-vc-install? > > Yes, is that currently not supported? > >> Best, >> >> Joseph