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

From: [email-masked] (Phillip Lord)
Date: Tue, 10 Jan 2017 18:40:28 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: [email-masked] (Phillip Lord)
>> Date: Tue, 10 Jan 2017 10:21:12 +0000
>> Cc: [email-masked]
>> 
>> I do not quite understand why this is not working -- loaddefs.el has
>> been generated at this point. I still do not fully understand what is
>> happening during the dumping process, though, so I guess bootstrap-emacs
>> is different now than before.
>
> Can you describe what you did understand from looking into this issue?
> E.g., which code emits the error and why?

One error is caused when bootstrap-emacs loads CTLau.html, when it's
running this code in leim.

misc_convert = $(AM_V_GEN)${RUN_EMACS} \
  -l titdic-cnv -f batch-miscdic-convert -dir ${leimdir}/quail

## CTLau.el, CTLau-b5.el.
${leimdir}/quail/CT%.el: ${srcdir}/MISC-DIC/CT%.html
	${misc_convert} $<

As far as I can tell it is happening because emacs tries to put
CTLau.html into html-mode. AFAICT, batch-miscdic-convert uses no
features of html-mode.

I've seen this sort of thing before; the deep problem is that
bootstrap-emacs obeys things like auto-mode-alist and .dir-locals.el,
when it probably doesn't really need to.

>> Before I investigate further, two simple solutions leap to mind. One is
>> just to suppress the errors probably in "titdic-cnv.el".
>> 
>> The other would be just to stop generating CTLau.el and
>> tstang-b5.el. Neither of the files from which they are generated have
>> been materially changed in since 2001, and CTLau.html apparently does
>> not exist any more in its source location. Deleting them, and adding
>> CTLau.el as source would solve the problem and remove a step from the
>> build.
>> 
>> Thoughts?
>
> I think we should try to understand the problem before we consider
> solutions.  In particular, the same problem could be at work in other
> places, just without such a spectacular indications.

True enough. Although, we don't have the problem anywhere else. Shortly
after this, emacs dumps fully, then the first version of bootstrap-emacs
is replaced with the fully dumped emacs. These errors will occur only
during a full bootstrap build I think.

Still, I'll plug at it a little more.

Phil