Subject: Re: bug#74490: 31.0.50; make bootstrap fails

From: Stefan Monnier <[email-masked]>
Date: Sat, 23 Nov 2024 12:03:56 -0500

> I couldn't find a clean way to do that, so I installed a quick
> workaround to avoid having a broken master.  If anyone has a better
> idea, please speak up (or just install it).

[ I don't know if it qualifies as "clean" but: ]

The problem we're facing shows up only during bootstrap, when we're
loading `loaddefs.el`, and not in the real dump where we load
`loaddefs.elc`.

Since we presumably don't make any real use of that regexp (we don't
visit any Python file) while compiling Emacs, another workaround might
be to wrap the call to `rx` around something like an `(when (fboundp
'rx) ...)`.

>> Stefan, are there any clean ways of using calls to autoloaded macros
>> in autoloaded defconst or defvar?

Currently our autoloading mechanism doesn't offers any clean way to
enforce some kind of ordering, sadly.  I guess we could also try
something like:

    ;;;###autoload
    (defconst python--auto-mode-alist-regexp
      (eval-when-compile
        (require 'rx)
        (rx (or
             (seq "." (or "py"
                          "pth"               ; Python Path Configuration File
                          "pyi"               ; Python Stub File (PEP 484)
                          "pyw"))             ; MS-Windows specific extension
             (seq "/" (or "SConstruct" "SConscript"))) ; SCons Build Files
            eos)))

- Stefan