From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Leo Georg Gaskin Newsgroups: gmane.emacs.bugs Subject: bug#62734: Always fully rebuild autoloads in package-generate-autoloads Date: Sat, 08 Apr 2023 23:16:23 +0200 Message-ID: <87lej2oz14.fsf@le0.gs> 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="799"; mail-complaints-to="usenet@ciao.gmane.io" To: 62734@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 09 06:12:39 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 1plMPu-000AXq-1G for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Apr 2023 06:12:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plMPN-0004aU-1p; Sun, 09 Apr 2023 00:12:05 -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 1plMPL-0004aB-JN for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2023 00:12:03 -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 1plMPL-0004AO-8M for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2023 00:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1plMPK-0004C4-KW for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2023 00:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Georg Gaskin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Apr 2023 04:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62734 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168101349516071 (code B ref -1); Sun, 09 Apr 2023 04:12:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Apr 2023 04:11:35 +0000 Original-Received: from localhost ([127.0.0.1]:60003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plMOr-0004B7-RM for submit@debbugs.gnu.org; Sun, 09 Apr 2023 00:11:35 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:46946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plG65-0005YF-6V for submit@debbugs.gnu.org; Sat, 08 Apr 2023 17:27:46 -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 1plG65-0005GZ-03 for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2023 17:27:45 -0400 Original-Received: from 046075150076.atmpu0013.highway.a1.net ([46.75.150.76] helo=nixos-laptop.localdomain) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1plG63-0005CY-79 for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2023 17:27:44 -0400 Original-Received: by nixos-laptop.localdomain (Postfix, from userid 1000) id 2CCA6500209; Sat, 8 Apr 2023 23:16:23 +0200 (CEST) Received-SPF: none client-ip=46.75.150.76; envelope-from=leo.gaskin@le0.gs; helo=nixos-laptop.localdomain X-Spam_score_int: 15 X-Spam_score: 1.5 X-Spam_bar: + X-Spam_report: (1.5 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.033, RCVD_IN_PBL=3.335, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 09 Apr 2023 00:11:32 -0400 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:259510 Archived-At: --=-=-= Content-Type: text/plain Tags: patch Hello! I've been using the new package-vc.el functionality to great effect, but I have also come across a somewhat annoying bug. If I use any of the provided commands to rebuild my local package while a autoloads file is already present, the newly generated autoloads file is consistently either incomplete or empty. The easiest way I've found to fix this is simply changing the `package-generate-autoloads' function to always rebuild the autoloads file by passing the relevant option to `loaddefs-generate'. I think this change also makes sense on a larger scale, as package generation taking into account older build artifacts seems unintuitive. The attached patch implements this change. I've read that for small changes like this no copyright assignment is needed. If I have misunderstood, please point me to the relevant documents so I can sign them. Please also let me know if I have messed something up or you need any additional information. Best wishes Leo Gaskin In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) Repository revision: 9848ae17161828190cc0ba31e89ae54a2f08a2ef Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 System Description: NixOS 23.05 (Stoat) Configured using: 'configure --prefix=/nix/store/y9bxk3kqk4isr28jcy1bclkdr5a4zd1v-emacs-git-20230407.0 --disable-build-details --with-modules --with-x-toolkit=lucid --with-xft --with-cairo --with-native-compilation' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Always-fully-rebuild-autoloads-in-package-generate-a.patch >From dad173580c048cbe89d5287c4475e965c71a702e Mon Sep 17 00:00:00 2001 From: Leo Gaskin Date: Sat, 8 Apr 2023 23:13:59 +0200 Subject: [PATCH] Always fully rebuild autoloads in package-generate-autoloads --- lisp/emacs-lisp/package.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 685f983..09811f1 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1093,7 +1093,8 @@ untar into a directory named DIR; otherwise, signal an error." ;; the load path. We don't hard-code `pkg-dir', to avoid ;; issues if the package directory is moved around. (or (and load-file-name (file-name-directory load-file-name)) - (car load-path))))) + (car load-path)))) + nil t) (let ((buf (find-buffer-visiting output-file))) (when buf (kill-buffer buf))) auto-name)) -- 2.39.2 --=-=-=--