Subject: bug#70357: 30.0.50; loadup.el, load nadvice before seq

From: Gerd Möllmann <[email-masked]>
Date: Sat, 13 Apr 2024 09:07:43 +0200

Eli Zaretskii <[email-masked]> writes:

>> Cc: [email-masked]
>> Date: Fri, 12 Apr 2024 16:43:56 -0400
>> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>> 
>> > If a seq.elc exists, and we dump bootstrap-emacs.pdmp, and seq.el gets
>> > loaded, then the cl-generic machinery will want to warn about the fact
>> > that certain method stuff in seq.elc is already compiled. This warning
>> > wants to use somethign from nadvice, and ultimately a recursive load
>> > (warnings.el requires icons.el, which uses seq, which leads to a
>> > warning, etc).
>> 
>> As a general rule, it's better (long term) to try and fix those circular
>> dependencies by breaking the cycle.
>> 
>> Maybe we could tweak `cl-generic` so it calls the byte-compiler in a way
>> that silences all the warnings?
>> Also, I'm not sure loading `icons` is necessary batch mode, so maybe we
>> could make that conditional.
>
> Me, I don't think I understand the situation well enough.  How come
> this doesn't happen each time Emacs is built, for example?  IOW,
> there's something in the situation that triggers this that doesn't
> happen "usually", and I don't understand from the description what
> that its.  This first sentence:
>
>> If a seq.elc exists, and we dump bootstrap-emacs.pdmp, and seq.el gets
>> loaded, then the cl-generic machinery will want to warn about the fact
>> that certain method stuff in seq.elc is already compiled.
>
> lost me: why is that warning being emitted, if all we need is to load
> seq.el during loadup?

loadup.el loads seq.elc in my case, not seq.el, and I think that's the
difference.

My mental model is, Stefan please correct me, that cl-generic calls the
compiler on method functions, effective method function, and such.

If seq.el, the source file, is loaded from loadup, these functions are
not yet compiled. If seq.elc is loaded, the functions are apparently
already compiled, and a warning is emitted.