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

From: Stefan Monnier <[email-masked]>
Date: Wed, 03 Sep 2025 11:19:31 -0400

> available) unicode syntax.  Turns out there are more footguns to early
> loading of lisp files than expected.

Bootstrap is full of exciting surprises.

> Zooming back out, this entire feature was really created for /external
> packages/, so they could provide their own macros which wrap
> e.g. `define-minor-mode`, and have these autoloads handled correctly
> without pre-loading anything:

FWIW, it's best to reduce differences between "internal" and "external"
packages.

> 1. Find and fix the footguns, making the bootstrap version of Emacs used
>    for autoload generation more robust.  E.g. move unicode table
>    generation earlier in the build.

Worth a try, but as you've seen the bootstrap is ... interesting so it
may prove more trouble than its worth.
We could also change `tramp-compat.el` to refrain from using the \N{...} syntax.

One more thing: AFAIK we're talking about eliminating a compile-time
*warning*, right?  IOW, the new autoload-macro-expansion is sufficiently
careful to withstand errors that the resulting code still works, no?

> 2. Stop loading internal files during bootstrap.  Add an argument to
>    `loaddefs-generate--make-autoload' which inhibits loading absolutely.
>    Pass this arg in during bootstrap autoload generation.

I'd rather not go there if I can avoid it.

> For option 2, we'd remove the expand declaration from
> `tramp--with-startup', which is incomplete anyway, since some of its
> autoloads are gated behind e.g. `(when ... (tramp--with-startup))'.

We should probably remove it anyway: it was a good way to test the new
functionality, but it's not that important.

        Stefan