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

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Mon, 3 May 2021 01:10:01 UTC

Severity: normal

Found in version 28.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48181 in the body.
You can then email your comments to 48181 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#48181; Package emacs. (Mon, 03 May 2021 01:10:01 GMT) Full text and rfc822 format available.

Message #3 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: submit <at> debbugs.gnu.org
Subject: incremental autoloads update can put output in wrong file
Date: Sun, 02 May 2021 21:08:57 -0400
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48181; Package emacs. (Mon, 03 May 2021 11:39:02 GMT) Full text and rfc822 format available.

Message #6 received at 48181 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 48181 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#48181: incremental autoloads update can put output in wrong
 file
Date: Mon, 03 May 2021 14:37:44 +0300
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Sun, 02 May 2021 21:08:57 -0400
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
> 
> 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 <at> gnu.org:
bug#48181; Package emacs. (Mon, 03 May 2021 12:50:01 GMT) Full text and rfc822 format available.

Message #9 received at 48181 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 48181 <at> debbugs.gnu.org
Subject: Re: bug#48181: incremental autoloads update can put output in wrong
 file
Date: Mon, 03 May 2021 08:49:21 -0400
> 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 <at> gnu.org:
bug#48181; Package emacs. (Sun, 05 Jun 2022 16:32:02 GMT) Full text and rfc822 format available.

Message #12 received at 48181 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 48181 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#48181: incremental autoloads update can put output in wrong
 file
Date: Sun, 05 Jun 2022 18:31:23 +0200
Glenn Morris <rgm <at> gnu.org> 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




bug marked as fixed in version 29.1, send any further explanations to 48181 <at> debbugs.gnu.org and Glenn Morris <rgm <at> gnu.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 05 Jun 2022 16:32:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 04 Jul 2022 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 294 days ago.

Previous Next


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