emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finalizing 'inhibit-automatic-native-compilation'


From: Aymeric Agon-Rambosson
Subject: Re: Finalizing 'inhibit-automatic-native-compilation'
Date: Tue, 14 Feb 2023 11:36:15 +0100
User-agent: mu4e 1.6.10; emacs 28.1

Le dimanche 12 février 2023 à 22:09, Eli Zaretskii <eliz@gnu.org> 
a écrit :
But it caused trouble in other situations, and is very hard to support portably. Any code that removes a .eln file that is being used by the
very Emacs session which removes it is building on non-portable
assumptions.

So I very much want to remove this part from Emacs.
I probably wasn't very clear.

From what I understand, passing nil as last argument to
`comp--native-compile' only means that a temporary file will be created in `temporary-file-directory' to store the output of the native compilation process.
On top of that, in the current state of emacs, when the result of 
this native compilation is a trampoline, this temporary .eln file 
is deleted after the trampoline is loaded in memory to be 
associated with the primitive.
This last part (the deletion after loading) is what you want to 
get rid of, and I agree this is the sensible thing to do. To be 
clear, I was not asking that you keep that part.
But the first part (the creating of a temporary file in 
`temporary-file-directory') is completely independent from the 
last one, or am I missing something ? It should still be possible 
to output the result of a native compilation to a temporary file, 
without having to remove that file afterwards ?
So something like (setq comp-enable-subr-trampolines 
'compile-but-no-output) would *only* mean : output to a temporary 
file in `temporary-file-directory'. It wouldn't also mean "and 
remove it afterwards". This meaning is perfectly compatible with 
the removal of the deletion after loading logic.
This is approximately what (setq comp-enable-subr-trampolines 
temporary-file-directory) would mean, except the two are not 
exactly equivalent. In the first case, `temporary-file-directory' 
would be evaluated when the temporary file needs to be created, 
which would be a guarantee that the file creation always works. In 
the second case, since `temporary-file-directory' is evaluated at 
the time of the setq, we would need its value at the time of the 
eval to remain valid for the whole duration of the emacs 
session. The first one is preferable to us because it always works 
and respects any modification we might make to 
`temporary-file-directory' for whatever reason.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]