From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#48181: incremental autoloads update can put output in wrong file Date: Sun, 02 May 2021 21:08:57 -0400 Message-ID: <9fpmy8fwt2.fsf@fencepost.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24271"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cc: Stefan Monnier To: 48181@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 03 03:10:36 2021 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 1ldN6a-0006CM-L1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 May 2021 03:10:36 +0200 Original-Received: from localhost ([::1]:41690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldN6Z-00073m-P6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 May 2021 21:10:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldN62-00073M-O4 for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 21:10:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldN62-0000KN-9X for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 21:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldN61-0005Jy-P3; Sun, 02 May 2021 21:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 May 2021 01:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48181 X-GNU-PR-Package: emacs X-Debbugs-Original-To: submit@debbugs.gnu.org X-Debbugs-Original-Xcc: Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.162000414620422 (code B ref -1); Mon, 03 May 2021 01:10:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 May 2021 01:09:06 +0000 Original-Received: from localhost ([127.0.0.1]:45838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldN58-0005JK-GD for submit@debbugs.gnu.org; Sun, 02 May 2021 21:09:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldN56-0005Ie-F2 for submit@debbugs.gnu.org; Sun, 02 May 2021 21:09:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43484) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldN51-0008A3-BL for submit@debbugs.gnu.org; Sun, 02 May 2021 21:08:59 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1ldN4z-0006c9-VT; Sun, 02 May 2021 21:08:58 -0400 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-Attribution: GM 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" Xref: news.gmane.io gmane.emacs.bugs:205463 Archived-At: 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.