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#63260: 29.0.90; Regression installing/activating packages without autoloads Date: Sun, 07 May 2023 13:12:47 +0000 Message-ID: <87jzxkcmk0.fsf@posteo.net> References: <87ild8tnbg.fsf@tcd.ie> <87ttwsnn59.fsf@gmail.com> <87zg6kysao.fsf@tcd.ie> <87lei3nv24.fsf@gmail.com> <87a5yhtxkw.fsf@tcd.ie> <83sfc9fva8.fsf@gnu.org> <87mt2go4ne.fsf@tcd.ie> <83pm7ce7p2.fsf@gnu.org> <87y1m0co2z.fsf@posteo.net> <83fs88e1yz.fsf@gnu.org> 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="30217"; mail-complaints-to="usenet@ciao.gmane.io" Cc: contovob@tcd.ie, 63260@debbugs.gnu.org, rpluim@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 07 15:14:38 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 1pveDl-0007eE-Gr for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 May 2023 15:14:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pveDK-0007hW-2q; Sun, 07 May 2023 09:14:10 -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 1pveDC-0007gq-JE for bug-gnu-emacs@gnu.org; Sun, 07 May 2023 09:14:08 -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 1pveDC-0005qk-9s for bug-gnu-emacs@gnu.org; Sun, 07 May 2023 09:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pveDC-0004i5-4R for bug-gnu-emacs@gnu.org; Sun, 07 May 2023 09:14: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: Sun, 07 May 2023 13:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63260 X-GNU-PR-Package: emacs Original-Received: via spool by 63260-submit@debbugs.gnu.org id=B63260.168346518318004 (code B ref 63260); Sun, 07 May 2023 13:14:02 +0000 Original-Received: (at 63260) by debbugs.gnu.org; 7 May 2023 13:13:03 +0000 Original-Received: from localhost ([127.0.0.1]:36675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pveCF-0004gK-4V for submit@debbugs.gnu.org; Sun, 07 May 2023 09:13:03 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:41879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pveC6-0004ff-H3 for 63260@debbugs.gnu.org; Sun, 07 May 2023 09:13:02 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 526272401DF for <63260@debbugs.gnu.org>; Sun, 7 May 2023 15:12:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1683465168; bh=4xnZfOtBS7kIG9VonHInSXTqWLZq3/jqkw9If1PuOPg=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=OsxIo59Gj9wPF/ug1OkTD2TyeHRTTtJKOS26wig5Pbi7G7PkuntXORl+HS57U9NMK 0zc0lTsD3SLzJsjCSuD1D0fmo4zGYgXnfxzlCBP54F/4XIPbHW0ANqsVSJ+dfwMXpk pUz+VUKpJU2abk2IVrYyVExJmdvPb3u+1/h9JQlFPzUnjhYas9XMcq9FFDPgLg1xNN iF5aREP8gFCyfi5wYFziaQxlDK6lNTLe78pCx//O9QXskhdOURYfjw4JfikpDOFAn+ DsKOuOGdKWf7H0cIvVcb59NdGi7dD3ue13p+Jx603W/j8x409bqH3z5ysrdPwDRjJ3 1lh4iv1f7ERAQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QDlG73xPpz6tmv; Sun, 7 May 2023 15:12:47 +0200 (CEST) In-Reply-To: <83fs88e1yz.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 07 May 2023 15:54:28 +0300") 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:261258 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Basil Contovounesios , 63260@debbugs.gnu.org, >> rpluim@gmail.com >> Date: Sun, 07 May 2023 12:39:48 +0000 >> >> Eli Zaretskii writes: >> >> > AFAIU, in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62734 I asked >> > Philip what would happen in this case, and he replied that the changes >> > he proposed did TRT in that case? So what is different here? Philip? >> >> No, that appears to have been my mistake. The issue is that >> `loaddefs-generate' generates the autoload file while looping over all >> definitions to autoload, but if there are no files, Basil is right that >> nothing happens. This is fine in general, but `loaddefs-generate' has >> the extra task of modifying load-path (which has been the root of the >> issue in bug#62734). Perhaps it is best to revert the commit, and come >> up with a alternative solution. I have an idea, but I'll have to test >> it again before I forget something like this. > > If we revert that commit, we will bring back bug#62734, which to me > sounds like a similarly serious, perhaps even more serious, issue, > don't you agree? My idea was that we could revert the commit, and then install a smaller change, basically just replacing the condition (and (not defs) extra-data) with (not defs) but thinking about it for a bit, I noticed that you are right that this would just re-introduce the same issue. > So I think maybe we need to amend that commit with > something that takes care of the particular situation reported here. > Specifically, it seems we need to detect the situation where a package > has no autoloads at all, and then produce the minimal autoloads file > that such packages expect. One hack might just be to check if `loaddefs-generate' has generated anything at all or not, and if that is not the case to do so manually in package.el. The reason this doesn't seem nice, is that we'd have to make the fact that `loaddefs-generate' does not generate a OUTPUT-FILE if there is no file with autoloads explicit, and finding a justification for that is difficult. Alternatively, this could be done inside of `loaddefs-generate'? Something like --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 2a46fb7a022..c23f21553d5 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -656,7 +656,17 @@ loaddefs-generate (write-region (point-min) (point-max) loaddefs-file nil 'silent) (byte-compile-info (file-relative-name loaddefs-file (car (ensure-list dir))) - t "GEN"))))))) + t "GEN"))))) + + ;; HACK: If no file with autoloads were found, but EXTRA-DATA was + ;; passed, we still want to generate a file. + (unless (and extra-data (file-exists-p output-file)) + (with-temp-buffer + (insert (loaddefs-generate--rubric output-file nil t)) + (search-backward "\f") + (insert extra-data) + (ensure-empty-lines 1) + (write-region (point-min) (point-max) output-file nil 'silent))))) (defun loaddefs-generate--print-form (def) "Print DEF in a format that makes sense for version control." --=-=-= Content-Type: text/plain -- Philip Kaludercic --=-=-=--