Subject: Re: bug#25360: File mode specification errors during building

From: [email-masked] (Phillip Lord)
Date: Tue, 14 Feb 2017 13:46:50 +0000

Glenn Morris <[email-masked]> writes:

> Glenn Morris wrote:
>
>> BTW, I think this loaddefs stuff is now giving a bootstrap failure
>> related to the "used to be in ldefs-boot" string-to-list.
>>
>> http://hydra.nixos.org/build/48432485
>
> Since it's impossible to predict which autoloaded functions are going to
> be needed in future bootstraps, no longer having a comprehensive
> ldefs-boot seems to mean more cryptic failures of this sort are inevitable.
> (Previously, this kind of thing could only happen if a new autoload
> was added that was needed for bootstrap, which was rare and hopefully
> obvious.)

Yes, you are correct; how often this would happen was the unknown
question.

I have checked this bug. I got it to reproduce after I realised that
you'd fixed it on master.

First, "make generate-ldefs-boot" does work correctly update
ldefs-boot-auto.el, actually by including "with-coding-priority". This
isn't as clean as I would hope because make generate-ldefs-boot won't
run from a clean checkout in these circumstances.

Second, I tracked down the cause of the problem -- in this case, it's

d8cca4d8c56a90ec9215d7bfb0b0edfa3a36ad4f

Specifically, it's here:

-(defcustom query-replace-from-to-separator
-  (propertize (if (char-displayable-p ?→) " → " " -> ")
-              'face 'minibuffer-prompt)
-  "String that separates FROM and TO in the history of replacement pairs."
-  ;; Avoids error when attempt to autoload char-displayable-p fails
-  ;; while preparing to dump, also stops customize-rogue listing this.
-  :initialize 'custom-initialize-delay
+(defcustom query-replace-from-to-separator " → "
+  "String that separates FROM and TO in the history of replacement pairs.
+When nil, the pair will not be added to the history (same behavior
+as in emacs 24.5)."
   :group 'matching
-  :type '(choice string (sexp :tag "Display specification"))
+  :type '(choice
+          (const :tag "Disabled" nil)
+          string)

Before this, the call to char-displayable-p would have forced loading of
mule-utils.el.

Unfortunately, as you say this is not predictable from the commit. You
have to know that char-displayable-p is autoloaded *and* that it is this
call to it which is forcing load of mule-utils (and also the associated
functions). It's also not possible to detect without a bootstrap build:
hydra gives this feedback pretty quickly, but obviously having trunk
broken for any time is not ideal.

Solutions:

1) Wait -- it's possible that this will be a rare occurence, and it
leaves us with a better understanding of how bootstrap works. My code is
mostly working as intended.

2) Revert and replace with a non-emacs mechanism for generated
ldefs-boot.el, which is likely to be awk. This would solve this issue
(as well as the "new autoload for bootstrap" problem). It might
introduce a problem because we'd have two different mechanisms for
making autoload files.

3) Revert and decide this is more effort than it's worth

4) Add "make ldefs-generate-boot" to the git commit hook.

I'm wavering between 1 and 2; for the latter I'll have to learn
awk. Number 4 wasn't a serious suggestion.

Phil