Subject: bug#45303: #45303 [feature/native-comp] building error on Windows

From: Andy Moreton <[email-masked]>
Date: Mon, 21 Dec 2020 22:46:58 +0000

On Mon 21 Dec 2020, Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> Pal Gloss <[email-masked]> writes:
>
>>> There are still problems related to the usage of Fdirectory_files and
>>> internal_condition_case_5 I think. At least, I get a crash after the
>>> bootstrap is dumped (? see attached build log)
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument wholenump t)
>>
>> Despite 2526032ea954671aa48a6ad6d924df2941a8364a, this error still happens:
>> Qt and Qnil should be swapped (see sed script at the bottom of the mail
>> inside my build commands or the git diff in the build log).
>
> Hi Pal thanks for trying.
>
> I don't like to run or decript scripts, I like to review and apply
> patches from contributors, why don't you submit one for this? :)

The fix needed here is another tweak to eln_load_path_final_clean_up:
the arguments for internal_condition_case_5 should end "Qnil, Qt,
return_nil". After fixing that then a bootstrap build completes without
crashes.

Other issues noted when running the uninstalled emacs from build dir:
a) The ELN compile step is very slow during bootstrap.

b) The built emacs will run uninstalled (i.e. directly from the build
   tree), but is almost unusable as the async ELN compile make emacs
   very unresponsive to input.

c) The .eln files for a few core .el files are built in:
     <builddir>/native-lisp/<version>-<target>-<hash>/*.eln

   The async compile puts .eln files in:
     $HOME/.emacs.d/eln-cache/<version>-<target>-<hash>/*.eln

   Q1: Why are the compiled files not added to builddir/lisp-native ?
   Q2: Why are the directory and filenames so long ?
   Q3: Why are the directory names different ?

   This needs a heirarchy of files named after a hash of their content.
   This problem has been solved by git, mercurial etc, and it would be
   better to use a similar layout, and learn lessons from those tools
   for how to do so efficiently.

   Q4: Why are the lisp files not *all* precompiled as part of the build ?
   Q5: What can be done to improve the slow compile time ?

   Q6: Why are the built files so large ?
   For example:
     47609  abbrev.el
     40298  abbrev.elc
    174799  abbrev-2af30c9ac0795d54ce43b6286aa259ff-a03852565cd14ed2eaa6f4159b530c2e.eln

Thanks for working on this,

    AndyM