Little correction on what I wrote earlier. Sorry about that, I should have been more careful.

Le vendredi 4 août 2023 à 18:49, Aymeric Agon-Rambosson <aymeric.a...@yandex.com> a écrit :

The *only* thing these patches do is :
- If inhibit-automatic-native-compilation (very misleading variable name indeed) is t, then trampolines are output in a temporary file. - If inhibit-automatic-native-compilation is nil, then trampolines are output in the first available candidate directory, OR in a temporary directory if
 no suitable candidate was found.

This is *all* they do, despite the name of the variable that seems to promise so much more. You see what I mean when I say they are useless. With or without the patch, in our build environment, we end up doing the exact same thing :
outputting our trampolines to a file somewhere in /tmp.

You can check this by looking at all the places where the content of this variable is actually used. You will find that it is only used in the function comp--trampoline-abs-filename, to do what I described you it does previously.

That is not entirely true. The C variable Vinhibit_automatic_native_compilation, corresponding to elisp variable inhibit-automatic-native-compilation, is effectively used to disable native compilation of loaded elc files.

The patch remains useless nonetheless : this (partial) disabling of native compilation is redundant with the one already provided by variable native-comp-jit-compilation.

In fact, if you look at this part of the patch :

diff --git a/src/comp.c b/src/comp.c
index 59c9e9619a3..06ddb956bb5 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -5179,6 +5179,7 @@ maybe_defer_native_compilation (Lisp_Object function_name,
     return;
 
   if (!native_comp_jit_compilation
+      || !NILP (Vinhibit_native_compilation)
       || noninteractive
       || !NILP (Vpurify_flag)
       || !COMPILEDP (definition)

You will notice that the first two boolean conditions are redundant : native_comp_jit_compilation already does what Vinhibit_native_compilation wants to do, albeit with an inverted meaning.

So, let me correct myself ; the patch does not do one, but two useless things : - it provides a mechanism to output trampolines to a temporary location, despite the fact that there already is one that does the same thing. - it duplicates variable native-comp-jit-compilation to inhibit-automatic-native-compilation, simply flipping its meaning.

The rest of what I wrote about us just needing the little patch I provided to control the relevant variables remains valid, of course.

Sorry again, I shall be more careful next time.

Reply via email to