Re: Deferring native compilation finalization until idle

Stéphane Marks <[email protected]> Sat, 25 Jul 2026 22:21:33 +0200
Newsgroups gmane.emacs.devel
Message-ID <CAN+1HbozBCDha5C6bBZ_XYV+00MSn_dELQ7308x38LnpnzbDLg@mail.gmail.com>
On Sat, Jul 25, 2026 at 3:01 PM Perry Fraser <[email protected]> wrote:

> Stéphane Marks <[email protected]> writes:
>
> > On Sat, Jul 25, 2026 at 11:39 AM Perry Fraser <[email protected]>
> > wrote:
> >>  Stéphane Marks <[email protected]> writes:
> >>
> >>> I pretty much live in Emacs on macOS and this is a non-issue, IME.
> >>
> >>  Are you able to reproduce the behavior I described when starting
> >>  with an empty config and a custom eln cache path in your
> >>  early-init.el? (I found it especially obvious when launching M-x
> >>  gnus, hitting m to compose a message, and then typing.)
> >>
> >>  I also assume you aren’t doing anything odd like running with SIP
> >>  disabled.
> >
> > SIP remains enabled on my systems. On my M1 MAX macOS 26.4 laptop,
> > the only computer I have access to this month, after installing a
> > jimeh nightly as I mentioned and using a custom eln cache path (as I
> > always do), it rebuilds from scratch because the binary hash changed
> > (you can see this in the variable comp-abi-hash) and I do not see
> > annoying hangs.
>
> Not to be pushy, but I am still curious what behavior you see when
> running the above steps to reproduce. Additionally, is your eln cache
> path outside of the .app itself? (See below.)
>

In "production," I run one of the jimeh binaries found here
https://github.com/jimeh/emacs-builds/releases which disable library
validation so I avoid the issue entirely.


> > The Emacs main event loop is not impacted by asynchronous native
> > compilations so I can't say what is preventing your Emacs from
> > processing input keys. The only explanation I have is that macOS
> > itself is doing precisely the thing that etc/PROBLEMS suggests a
> > workaround for and which the jimeh builds use:
> >
> >   codesign --force --sign - \
> >       --entitlements macos-disable-library-validation.entitlements \
> >       src/emacs
> >
> > Are you using that?
>
> I am not, though I think there are some additional details that need
> mentioned in the PROBLEMS file for this to be an effective solution.
> (Namely, macos-disable-library-validation.entitlements needs to be a
> file with the appropriate entitlement enabled in it[1]


These entitlements apply only to the bundle Emacs.app and its main
entrypoint binaries.

and this also
> requires the eln cache location to be within the .app itself as I just
> found out.)
>

I don't know if that is the case.  I suggested that as an area for an
enterprising someone to study in case it turns out that running codesign on
eln files as a post-generation step worked when those files are contained
in the bundle directory tree.