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#69410: 30.0.50; [WISHLIST] Use-package: allow :ensure to accept package spec instead of separate :vc keyword Date: Mon, 08 Jul 2024 15:52:17 +0000 Message-ID: <87plrnhoem.fsf@posteo.net> References: <87wmqryzv2.fsf@gmail.com> <87jzi6lnjp.fsf@posteo.net> <87wmm55j42.fsf@hyperspace> <87zfr15hqj.fsf@gmail.com> <87v81p5gpp.fsf@gmail.com> <87wmm21afn.fsf@posteo.net> <87h6d0xeu5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15957"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tony Zorman , 69410@debbugs.gnu.org To: No Wayman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 08 17:53:19 2024 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 1sQqg3-0003pM-7n for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Jul 2024 17:53:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQqfj-0000s0-Hm; Mon, 08 Jul 2024 11:52:59 -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 1sQqfh-0000rX-AW for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2024 11:52:57 -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 1sQqfh-0004x9-21 for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2024 11:52:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sQqfl-0000Bj-Ni for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2024 11:53: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: Mon, 08 Jul 2024 15:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69410 X-GNU-PR-Package: emacs Original-Received: via spool by 69410-submit@debbugs.gnu.org id=B69410.1720453956692 (code B ref 69410); Mon, 08 Jul 2024 15:53:01 +0000 Original-Received: (at 69410) by debbugs.gnu.org; 8 Jul 2024 15:52:36 +0000 Original-Received: from localhost ([127.0.0.1]:51306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQqfL-0000B5-K3 for submit@debbugs.gnu.org; Mon, 08 Jul 2024 11:52:36 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:51257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQqfH-0000Ao-Ld for 69410@debbugs.gnu.org; Mon, 08 Jul 2024 11:52:33 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id AC534240027 for <69410@debbugs.gnu.org>; Mon, 8 Jul 2024 17:52:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1720453939; bh=z8gEV1J4WP/slzCYy3t2dDY0XAbnDd+Od4HiLA9vS70=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=SIV02vjViaYBvwPAT1+0Lycwl3i0qSPNTdSDMbqv9XK3XeqGCyUVfwKdPcHODClSm YZTfDFUGigZzLIqh2EqPX6sXY5KJD/7iYo+3anMODa3TCRHFvDraZPzsgGlYEkjxbn F9rQKFHMgetMwqUp/JZtGi5AIREIxFmU7rvlA/qN/6XPsFoMx1nBMRDj6MK4EiaV/R PvE3opu7rLD99c6K4SgNeBZL4Tj4WoDohKHGAJNJ/zmEn5tZ84ARqEVT+WX5G+DetY d3QafYpB6QCFK4QZxSVjquSjQixSFuk8griKiI/WLbHzUjYhGFy3WmuLJa6W75tzJZ SpaL1MIVpUj6A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WHpXf3FNJz6tvm; Mon, 8 Jul 2024 17:52:18 +0200 (CEST) In-Reply-To: <87h6d0xeu5.fsf@gmail.com> (No Wayman's message of "Mon, 08 Jul 2024 08:12:18 -0400") OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt 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:288599 Archived-At: No Wayman writes: > Philip Kaludercic writes: > >> The issue was that I didn't see the bug report, due to the >> "wishlist" >> status (I believe you should have seen my other message). The best >> practice on mailing lists is to include people you think can provide >> input, as I did with Tony. If you have any further questions >> regarding >> package-vc, feel free to add a >> >> X-Debbugs-CC: Philip Kaludercic >> >> header, to make sure that I get notified. I believe this kind of a >> convention is something that GitHub-Style issue trackers also have >> when >> adding a @... to a message. > > Clunky. A point in favor of moving to some sort of forge which can > improve upon that process. We can't change that here; I just want you to know what you can do within the existing structures to improve communication. > Odd to me that whatever you're viewing the list with would exclude > feature requests by default, too. I use the "debbugs" package, and was surprised as well. >>>> :ensure could accept: >>>> >>>> - nil: do not attempt to install anything >>>> - t: attempt to install via the user's chosen default package >>>> manager - a symbol name: install package matching that symbol name >>>> with default package manager >>>> - a recipe spec: install via a forge capable package manager using >>>> that package recipe.=20 >> >> But that would be incompatible with package-vc, as the default >> installation remains (and should remain) tarballs. Most of the >> time, >> you don't need to give any package specification when installing a >> package, as they are provided by ELPA servers. > > Okay, then allow :ensure to take `t` meaning, "install the tarball" > and `:vc` as a special case to use package-vc.el. e.g. > > (use-package example :ensure :vc) ;;install via package-vc. Doesn't this go against your suggestion to have a uniform interface? As we mentioned previously, :vc t can do this as well, without the need to handle special values. >> But generally speaking, the potential for confusion between >> ELPA-style >> package specifications and MELPA-style package recipes just sounds >> like >> something that has a lot of potential for confusion. > > Using the same interface would encourage compatibility in the recipe > format > Each package manager needn't support everything the others do, but it > would make sense for them to support the most commonly used > keywords. Also, most package authors do not include complex package > recipes in their README's for installation instructions. FWIW I am not a fan of having package authors recommending the usage of package-vc, unless the user is interested in contributing patches. The ideal usage is just to re-use the package specifications provided by the ELPA server, without having to make up something yourself. >>>> It's not that complicated. >>>> If anything, it would encourage package-manager authors to support >>>> a basic subset of keywords for the package recipe spec, increasing >>>> cross-compatibility for package recipes. >>> >>> Ah, I think I have a better idea of what you're trying to do now. >>> Essentially, provide a totally generic interface for :ensure and >>> then >>> let people decide via use-package-ensure-function which package >>> manager >>> they actually want to use? Honestly, that sounds quite reasonable >>> to me. >>> One would have to make sure that certain edge cases are handled >>> (like >>> somehow preserving a version of :vc t and keeping the current >>> functionality of :ensure in tact) but other than that I see no >>> reason >>> why something like this shouldn't be done. > > Yes, that's the general idea. > >> Wouldn't it make sense to extend the :vc keyword to support >> alternative >> package managers, instead of overloading :ensure? > > Makes less sense to do it that way. > :ensure is/was already the interface by which people ensure a package > is installed. > Let's say someone implements another tarball based elisp package > manager. > Does it make more sense to specify they'd like to use that via a :vc > (version control) keyword or :ensure? For me, the latter is clearly > the correct choice. > > As Tony mentioned use-package already has > `use-package-ensure-function' which was intended to facilitate > something like this. It's documentation also mentions: > >> It is up to the function to decide on the semantics of the various >> values for =E2=80=98:ensure=E2=80=99. > > The only potential for confusion is if a user decides they'd like to > use multiple package managers at once, but that's a use-case which can > cause confusion sans use-package, too. Hmm, I get this point, but I don't see a neat and safe way to extend :ensure. And we have to keep in mind, that use-package was originally made for package.el, and it was retrofitted to support other package managers later on. When considering this context, I think that privileging built-in functionality like package-vc is acceptable. >>> Just to make sure: in practice, the only package managers >>> that=E2=80=94right >>> now=E2=80=94support this schema are package.el (by means of :vc) and >>> elpaca, >>> right? >> >> To my knowledge, the only three package managers that have >> use-package >> integration are package.el, straight and elpaca (though I don't know >> how >> it looks like in the latter two cases). > > It looks like there is a package for Quelpa use-package integration > which went the route of adding > yet-another-keyword-that-is-basically-ensure: > > https://github.com/quelpa/quelpa-use-package > > They only advertise MELPA recipe compatibility. (Considering the > number of MELPA recipes VS NON/GNU ELPA recipes, it would probably be > less of a chore if GNU strove for compatibility with that format, too, > but that's a separate issue). FWIW package-vc uses the same package specification format as elpa-admin, with the explicit intention of making it easier to contribute these specifications to elpa.git/nongnu.git. > I didn't find anything similar for borg or el-get. > >> My understanding is that "No Wayman" is Nicholas Vollmer >> (https://github.com/progfolio), the >> maintainer of the latter two? > > Correct. I'm the sole author of Elpaca and co-maintain straight.el > with its original author. > >> If so, then I think we are in a wonderful position to propose that >> Straight should add :url as an alias for :repo, which could make >> this >> more uniform -- that is if we actually want to take this path. > > My opinion on a standard elisp package recipe format is to keep > keywords as general and few as possible. I'd like to eventually remove > some keywords in Elpaca which were only added for straight.el > compatibility. For example, :pre-build, :post-build, which are just > special cases of :build. > > We have thousands of recipes "in the wild", mostly in MELPA's flavor, > which should have been studied prior to adding more > keywords. Specifically, Emacs should reconsider the :make and > :shell-command keywords, which are too specific. :build is more > generic and the semantics can be determined by the package manager. Again, here we just re-use what ELPA-admin provides. Both keywords are used by ELPA packages, so we need to support them as well. Overall I am not that convinced that there is a worthwhile advantage in trying to unify these keywords. I don't understand why package authors feel the need to specify separate installation instructions for different packages to begin with, so I am lacking the motivation behind the problem to begin with. --=20 Philip Kaludercic on peregrine