Subject: Re: bug#79353: 31.0.50; Eager macro expansion errors when building master

From: JD Smith <[email-masked]>
Date: Tue, 2 Sep 2025 09:51:47 -0400

> On Sep 2, 2025, at 12:48 AM, Gerd Möllmann <[email-masked]> wrote:
> 
> Stefan Monnier <[email-masked]> writes:
> 
>>>> FWIW it sounds like a problem I've seen before in other circumstances
>>>> where I just added a `(require 'cl-extra)`, e.g.:
>>>> 
>>>>    lisp/emacs-lisp/comp-cstr.el:(require 'cl-extra) ;HACK: For
>>>> `cl-find-class' when `cl-loaddefs' is missing.
>>> 
>>> Interesting.  `tramp.el' could probably just (require 'cl-extra) to fix
>>> this.  I guess this is a new use of this cl-extra macro somewhere, which
>>> wasn't caught in testing.
>> 
>> I wouldn't call it "new use".  It's probably just a use that can now
>> occur a bit earlier (before `cl-loaddefs.el` is built).
>> 
>> See also comment in cl-lib.el:
>> 
>>    (unless (load "cl-loaddefs" 'noerror 'quiet)
>>      ;; When bootstrapping, cl-loaddefs hasn't been built yet!
>>      (require 'cl-macs)
>>      (require 'cl-seq)
>>      ;; FIXME: Arguably we should also load `cl-extra', except that this
>>      ;; currently causes more bootstrap troubles, and `cl-extra' is
>>      ;; rarely used, so instead we explicitly (require 'cl-extra) at
>>      ;; those rare places where we do need it.
>>      )
>> 
>> 
>> - Stefan
> 
> Not sure if that's relevant, don't know what this is all about anyway.

I think the idea is to require 'cl-extra in tramp.el, after 'cl-lib.  The issue is we are loading tramp during the build of *-loaddefs.el files, and yet tramp is currently relying (indirectly) on the autoload of cl-subseq from cl-extra.