Subject: Re: bug#50666: 28.0.50; Fix native compilation on Cygwin

From: Ken Brown <[email-masked]>
Date: Wed, 22 Sep 2021 17:35:28 -0400

On 9/19/2021 1:12 PM, Eli Zaretskii wrote:
>> Cc: [email-masked], [email-masked]
>> From: Ken Brown <[email-masked]>
>> Date: Sun, 19 Sep 2021 12:17:51 -0400
>>
>>>> In the meantime, is it OK if I install my patch to enable building with native
>>>> compilation?  That would simplify experimentation.
>>>
>>> Yes, it's okay to install that, but it's a band-aid at best, and we'd
>>> like to have the complete solution in Emacs before we release v28.1.
>>> Is that feasible?
>>
>> Yes, I think so.
> 
> Great, let's hopw you will succeed.

We've made a good start on the Cygwin side, but I have a question about how to 
integrate it into Emacs.

Let's say we have a script that I'll call "rebase" for the purpose of this 
discussion, which rebases all the eln files in ~/.emacs.d/eln-cache.  The user 
would then start Emacs via a script that first calls rebase and then starts 
Emacs.  Within Emacs, I would then want to do something like

(if (eq system-type 'cygwin)
     (call-process "rebase" nil
                   '(:file "<log file>")
                   nil "<arg>" ...))

after every compilation but before the compiled file is loaded.

I'm not familiar enough with native compilation to know where this should go. 
Or maybe it has to be done in more than one place, depending on whether the 
compilation is synchronous or not.

Can you help?

Thanks.

Ken

P.S. The rebase script will fail to rebase eln files that are already loaded, 
but that's harmless in the scenario above.