GNU bug report logs - #48181
incremental autoloads update can put output in wrong file

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Glenn Morris <rgm@HIDDEN>; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 29.1, send any further explanations to 48181 <at> debbugs.gnu.org and Glenn Morris <rgm@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 48181 <at> debbugs.gnu.org:


Received: (at 48181) by debbugs.gnu.org; 5 Jun 2022 16:31:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 05 12:31:37 2022
Received: from localhost ([127.0.0.1]:33368 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nxtA8-00034B-Sy
	for submit <at> debbugs.gnu.org; Sun, 05 Jun 2022 12:31:37 -0400
Received: from quimby.gnus.org ([95.216.78.240]:58632)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nxtA6-0002xr-Us
 for 48181 <at> debbugs.gnu.org; Sun, 05 Jun 2022 12:31:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=VyBDy93aWMDko0pT4LqQIMeuRddkI+lLeX+I3XWQyCg=; b=kMbED0NIa2IzkQc4lcyVIgadnd
 jK4uoRmcWIo7uXhvo4is/KMubZgRUMkISQCAYcfiZhcxxYkElBUAZKs5DdaHB2EPsvMuS0o/HRsqY
 VPsACPRvUGltU81tKgY7cbykcYP6WRwy0qAgxC+u0ZPKuIPkrKwyDi79hAq38QqCng2U=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nxt9w-0003Li-FM; Sun, 05 Jun 2022 18:31:27 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Subject: Re: bug#48181: incremental autoloads update can put output in wrong
 file
References: <9fpmy8fwt2.fsf@HIDDEN>
X-Now-Playing: Exek's _Check it Out!!_: "Weight Loss (Henry's Dream)"
Date: Sun, 05 Jun 2022 18:31:23 +0200
In-Reply-To: <9fpmy8fwt2.fsf@HIDDEN> (Glenn Morris's message of
 "Sun, 02 May 2021 21:08:57 -0400")
Message-ID: <87o7z7ysv8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Glenn Morris <rgm@HIDDEN> writes: > I tried to figure out
 exactly why 68bf917896 caused non-bootstrap builds > to fail, because IIUC
 in theory it shouldn't have. I think this is why: This should be fixed in
 Emacs 29 now with the complete rewrite in how these files are updated, so
 I'm closing this bug report. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48181
Cc: 48181 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Glenn Morris <rgm@HIDDEN> writes:

> I tried to figure out exactly why 68bf917896 caused non-bootstrap builds
> to fail, because IIUC in theory it shouldn't have. I think this is why:

This should be fixed in Emacs 29 now with the complete rewrite in how
these files are updated, so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48181; Package emacs. Full text available.

Message received at 48181 <at> debbugs.gnu.org:


Received: (at 48181) by debbugs.gnu.org; 3 May 2021 12:49:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 03 08:49:31 2021
Received: from localhost ([127.0.0.1]:46445 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ldY0w-00044i-Q5
	for submit <at> debbugs.gnu.org; Mon, 03 May 2021 08:49:30 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57475)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1ldY0v-00044a-Bh
 for 48181 <at> debbugs.gnu.org; Mon, 03 May 2021 08:49:29 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 137EC4407D9;
 Mon,  3 May 2021 08:49:24 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 177144407B3;
 Mon,  3 May 2021 08:49:22 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1620046162;
 bh=lXOPPLotMBZKbvDTXTWnqap5J16aE8Pone3FT+rmtqo=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=Mqp9seI72mDedBf3UNPkrACoIM09ZjTlV4U2Isw7FTc0TVCBI79dt9pCW6GuAsMLn
 dOhEx+r9Oughg5hU4PpboP6zp2K3p4NSgPEiLoA5BBTAMb9RQpsReiRKkO5k3rVYcb
 8iurZ/s2aMZpZ2ikAJyuyE+BW9648t1heJ20nr546f9Vih26aWzmJYoe/1rPI5AnZM
 WYsYJhJGLLiYA7RC7MFetNoJ0xm6JNnkaxEP5EEjQPbZutTOX/BwW1Kju96Y8J94n5
 vFef5RaU+E1NjRVY8h8Ys/kuj3ycz1z285j7kT7r2YvHcARJh3s9dh4hMbdtZy09l8
 QWz5eY8MCpibQ==
Received: from alfajor (unknown [108.161.125.61])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DC54A1203C4;
 Mon,  3 May 2021 08:49:21 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Subject: Re: bug#48181: incremental autoloads update can put output in wrong
 file
Message-ID: <jwvv980ugol.fsf-monnier+emacs@HIDDEN>
References: <9fpmy8fwt2.fsf@HIDDEN>
Date: Mon, 03 May 2021 08:49:21 -0400
In-Reply-To: <9fpmy8fwt2.fsf@HIDDEN> (Glenn Morris's message of
 "Sun, 02 May 2021 21:08:57 -0400")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.146 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48181
Cc: 48181 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> 3) make-directory-autoloads correctly finds that texnfo-upd.el is newer
> than loaddefs.el, so we execute this branch:
>   
>   (t
>    (setq changed t)
>    (autoload-remove-section (match-beginning 0))
>    (if (autoload-generate-file-autoloads
>          ;; Passing `current-buffer' makes it insert at point.   
>          file (current-buffer) buffer-file-name)
>         (push file no-autoloads)))
>
> Because a non-nil OUTBUF is passed to autoload-generate-file-autoloads,
> it ignores the buffer-local setting for generated-autoload-file,
> and so puts the autoloads in the main loaddefs.el file, which is wrong.

Yep, sounds like you found of the bug.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48181; Package emacs. Full text available.

Message received at 48181 <at> debbugs.gnu.org:


Received: (at 48181) by debbugs.gnu.org; 3 May 2021 11:38:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 03 07:38:13 2021
Received: from localhost ([127.0.0.1]:46352 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ldWtx-0003SD-9r
	for submit <at> debbugs.gnu.org; Mon, 03 May 2021 07:38:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35930)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ldWtw-0003S7-8p
 for 48181 <at> debbugs.gnu.org; Mon, 03 May 2021 07:38:12 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50979)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1ldWtq-0002D5-KI; Mon, 03 May 2021 07:38:06 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3381
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1ldWtk-0004Kl-Du; Mon, 03 May 2021 07:38:00 -0400
Date: Mon, 03 May 2021 14:37:44 +0300
Message-Id: <83eeeo6oaf.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
In-Reply-To: <9fpmy8fwt2.fsf@HIDDEN> (message from Glenn Morris on
 Sun, 02 May 2021 21:08:57 -0400)
Subject: Re: bug#48181: incremental autoloads update can put output in wrong
 file
References: <9fpmy8fwt2.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48181
Cc: 48181 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Glenn Morris <rgm@HIDDEN>
> Date: Sun, 02 May 2021 21:08:57 -0400
> Cc: Stefan Monnier <monnier@HIDDEN>
> 
> 1) before 68bf917896, lisp/loaddefs.el contains sections like this:
> 
>   ;;;### (autoloads nil "texnfo-upd" "textmodes/texnfo-upd.el" (0 0
>   ;;;;;;  0 0))
>   ;;; Generated autoloads from textmodes/texnfo-upd.el
> 
>   (register-definition-prefixes "texnfo-upd" '("texinfo-"))

(The other 2 files, makeinfo.el and texinfo.el, are also related,
right?)

> So even though there aren't any real autoloads in texnfo-upd.el, it's
> not in the "no autoloads" section.
> 
> 2) 68bf917896 added real autoload cookies to texnfo-upd.el, and set
> generated-autoload-file to texinfo-loaddefs.el.
> 
> 3) make-directory-autoloads correctly finds that texnfo-upd.el is newer
> than loaddefs.el, so we execute this branch:
>   
>   (t
>    (setq changed t)
>    (autoload-remove-section (match-beginning 0))
>    (if (autoload-generate-file-autoloads
>          ;; Passing `current-buffer' makes it insert at point.   
>          file (current-buffer) buffer-file-name)
>         (push file no-autoloads)))
> 
> Because a non-nil OUTBUF is passed to autoload-generate-file-autoloads,
> it ignores the buffer-local setting for generated-autoload-file,
> and so puts the autoloads in the main loaddefs.el file, which is wrong.
> 
> 
> In contrast, if the input loaddefs.el file in step 1 had texnfo-upd.el
> in the "no loaddefs" section, then we would execute this branch:
> 
>   ;; Passing nil as second argument forces                             
>   ;; autoload-generate-file-autoloads to look for the right            
>   ;; spot where to insert each autoloads section.                      
>   ((setq file-time
>          (autoload-generate-file-autoloads file nil buffer-file-name))
>  
> As the comment says, this version has OUTBUF nil, so the loaddefs end up
> the right file.

Yes, I've also figured out that by suitable editing of the nascent
loaddefs.el I could fix the original problem.  But such manual editing
sounded gross to me.

Or are you saying something else?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48181; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 May 2021 01:09:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 02 21:09:06 2021
Received: from localhost ([127.0.0.1]:45838 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ldN58-0005JK-GD
	for submit <at> debbugs.gnu.org; Sun, 02 May 2021 21:09:06 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44564)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rgm@HIDDEN>) id 1ldN56-0005Ie-F2
 for submit <at> debbugs.gnu.org; Sun, 02 May 2021 21:09:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:43484)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <rgm@HIDDEN>) id 1ldN51-0008A3-BL
 for submit <at> debbugs.gnu.org; Sun, 02 May 2021 21:08:59 -0400
Received: from rgm by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rgm@HIDDEN>)
 id 1ldN4z-0006c9-VT; Sun, 02 May 2021 21:08:58 -0400
From: Glenn Morris <rgm@HIDDEN>
To: submit <at> debbugs.gnu.org
Subject: incremental autoloads update can put output in wrong file
X-Spook: SEAL Scully Spillover Task Force ESN Islamist Bacteria
X-Ran: J5v6T*Y\:xsTv0-.Baz:p:g/U)=$k+Pc~,79vt!OHMWz3l:c)'n9LALUY"1ubuQr9~TQkD
X-Hue: cyan
X-Debbugs-No-Ack: yes
X-Debbugs-CC: Stefan Monnier <monnier@HIDDEN>
X-Attribution: GM
Date: Sun, 02 May 2021 21:08:57 -0400
Message-ID: <9fpmy8fwt2.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Package: emacs
Version: 28.0.50

I tried to figure out exactly why 68bf917896 caused non-bootstrap builds
to fail, because IIUC in theory it shouldn't have. I think this is why:

1) before 68bf917896, lisp/loaddefs.el contains sections like this:

  ;;;### (autoloads nil "texnfo-upd" "textmodes/texnfo-upd.el" (0 0
  ;;;;;;  0 0))
  ;;; Generated autoloads from textmodes/texnfo-upd.el

  (register-definition-prefixes "texnfo-upd" '("texinfo-"))

So even though there aren't any real autoloads in texnfo-upd.el, it's
not in the "no autoloads" section.

2) 68bf917896 added real autoload cookies to texnfo-upd.el, and set
generated-autoload-file to texinfo-loaddefs.el.

3) make-directory-autoloads correctly finds that texnfo-upd.el is newer
than loaddefs.el, so we execute this branch:
  
  (t
   (setq changed t)
   (autoload-remove-section (match-beginning 0))
   (if (autoload-generate-file-autoloads
         ;; Passing `current-buffer' makes it insert at point.   
         file (current-buffer) buffer-file-name)
        (push file no-autoloads)))

Because a non-nil OUTBUF is passed to autoload-generate-file-autoloads,
it ignores the buffer-local setting for generated-autoload-file,
and so puts the autoloads in the main loaddefs.el file, which is wrong.


In contrast, if the input loaddefs.el file in step 1 had texnfo-upd.el
in the "no loaddefs" section, then we would execute this branch:

  ;; Passing nil as second argument forces                             
  ;; autoload-generate-file-autoloads to look for the right            
  ;; spot where to insert each autoloads section.                      
  ((setq file-time
         (autoload-generate-file-autoloads file nil buffer-file-name))
 
As the comment says, this version has OUTBUF nil, so the loaddefs end up
the right file.




Report forwarded to monnier@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#48181; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 5 Jun 2022 16:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.