Subject: bug#41242: closed (Re: bug#41242: Port feature/native-comp to Windows - Reduce the number of files probed when finding a lisp file.)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 06 Jun 2020 21:42:02 +0000

Your bug report

#41242: Port feature/native-comp to Windows

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
41242: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=41242
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#41242: Port feature/native-comp to Windows - Reduce the number of files probed when finding a lisp file.
From: Andrea Corallo <[email-masked]>
To: Nicolas Bértolo <[email-masked]>
Cc: [email-masked]
Date: Sat, 06 Jun 2020 21:41:24 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

I did the suggested style modification myself and applied the patch as
e38678b268.

Thanks I'm closing this.

  Andrea

-- 
[email-masked]

Subject: Port feature/native-comp to Windows
From: Nicolas Bértolo <[email-masked]>
To: [email-masked]
Date: Wed, 13 May 2020 16:26:57 -0300
List-Id: <debbugs-submit.debbugs.gnu.org>

The attached patches contain changes to make the feature/native-comp branch work
on Windows.

There are a few remaining issues:

* The loading process is very slow. This is especially annoying when coupled
  with autoloading. For example, autoloading Helm may stall Emacs for 5 seconds
  in my machine.

  I have thought a possible solution to this problem: load the byte-compiled
  file and put the native-compiled version in a list. Then load that list one by
  one on an idle-timer, that way the UI freezes should be minimized. This could
  reuse the "late loading" machinery implemented for deferred compilation.

* `package-delete` fails because it tries to delete the .eln file via
  `delete-file`. This is impossible in Windows because it's generally impossible
  to delete files that have an open HANDLE in the system.

  Three solutions have crossed my mind:

  - Edit `package-delete` to put the eln on a list of files that should be
    deleted when Emacs is closed.

  - Implement an unloading mechanism for native-compiled files.

  - Copy eln files to temporary files and load those temporary files instead.
    This means that deleting the original eln file is possible.

  I'd prefer the second option, but I have a semi-working patch for the third
  option.

* The `emacs_dir` environment variable needs to be set when loading the dump
  file. It is necessary for `expand-file-name`, which calls emacs_root_dir(). I
  haven't investigated why this is necessary yet. One workaround would be to use
  GetModuleFileName() to get the path to emacs.exe when `emacs_dir` is not set.