[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Updating *.el files and native compilation
From: |
Andrea Corallo |
Subject: |
Re: Updating *.el files and native compilation |
Date: |
Mon, 10 May 2021 15:44:16 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andrea Corallo <akrl@sdf.org>
>> Cc: emacs-devel@gnu.org
>> Date: Mon, 10 May 2021 07:35:53 +0000
>>
>> > . if, for some reason, Emacs loads an incompatible .eln file, then
>> > some Lisp programs could crash the Emacs session, is that correct?
>> > If so, how do we make sure such incompatible changes always cause
>> > a new native compilation that yields a different file name for the
>> > .eln file?
>>
>> Yes but this should not happen, every change that can introduce an
>> incompatibility has to be accounted in the `comp-abi-hash' computation
>> and AFAIK ATM it is.
>
> Some changes don't require updating comp-abi-hash, but still create
> *.eln files with different hashes in its name. AFAIU, that happens
> when the primitives don't change, but the .el file itself changes,
> isn't that so?
Correct
> In any case, are you saying that the only situations where loading and
> using a .eln file could crash Emacs are those which are handled by
> changing comp-abi-hash?
Yes
> If so, how can we make sure we never fail to update comp-abi-hash when
> that is needed?
The vast majority of the cases is when some subr is added or a signature
is changed and we account for this automatically. The rest should be
only about changes specific to the eln load mechanism in comp.c. I hope
who does that is very well aware of consequences but I don't know if
there's a way we can automatically guard against these changes breaking
the system (I guess there's not).
Regards
Andrea