Subject: bug#45103: [feature/native-comp] add re-dumping support

From: Elric Milon <[email-masked]>
Date: Tue, 03 Aug 2021 13:46:27 +0200

Andrea Corallo <[email-masked]> writes:

> Hi Ying Qu,
>
> I guess you are the first trying to re-dump a native compiled 
> Emacs
> session.  Despite being in principle possible there's certanly 
> something
> to look at.
>
> In general my understanding is that ATM we do not support 
> officially
> Emacs re-dumps, so also on a vanilla build it may work or not.
>
> As a consequence I'm not sure this is a requirement for this 
> feature
> ATM.  Perhaps we'll get some other opinion on this.

Hi Andrea,

Even if not supported, it did work (some workarounds required at 
times)
and it's used. I had been using it before switching to native-comp 
via
spacemacs' dumping support:

https://github.com/syl20bnr/spacemacs/blob/develop/EXPERIMENTAL.org#spacemacs-dumps-using-the-portable-dumper

I think it would be really nice to be able to do something similar 
again.

I spent some time attempting to make it work again by avoiding
re-dumping (starting from bare temacs) but at some point I gave up 
(It's
been a while but, if memory serves, I found C and lisp code 
clearly
not expecting for anyone to want to dump anything else than 
loadup.el).
If that where an option then support for re-dumping would not be
needed anymore.

Maybe it would be a good idea to add a guard to prevent re-dumping 
so
that users are aware they are doing something that will never work 
and
it's not something they are doing wrong (I spent a lot of time on 
this
myself :)).

Cheers!