unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Aymeric Agon-Rambosson <aymeric.agon@yandex.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: spwhitton@spwhitton.name, monnier@iro.umontreal.ca,
	emacs-devel@gnu.org, akrl@sdf.org, larsi@gnus.org,
	rlb@defaultvalue.org
Subject: Re: Finalizing 'inhibit-automatic-native-compilation'
Date: Thu, 09 Feb 2023 09:40:35 +0100	[thread overview]
Message-ID: <87mt5ncjuk.fsf@X570GP> (raw)
In-Reply-To: <83a61pprm8.fsf@gnu.org>


Le mardi 7 février 2023 à 14:49, Eli Zaretskii <eliz@gnu.org> a 
écrit :

> I don't think I follow: why not?

> Why do you need it to be the first directory?

What I am going to describe is true only in the specific setting I 
am presenting, projectile.

After the advice of `file-exists-p' so as to make it always return 
t, implemented by this line :

(spy-on 'file-exists-p :and-return-value t)

Whenever we enter the function `comp-subr-trampoline-install', for 
instance when we advise another primitive, we will enter the 
function `comp-trampoline-search' if :
- we have trampoline compilation enabled
- AND the primitive has not been excluded from trampoline 
  compilation
- AND the trampoline is not already installed

we will try to install the trampoline, by either finding it on the 
filesystem, or if we don't find it, by compiling it.

If `file-exists-p' has been advised as to always return t, 
`comp-trampoline-search' will *always* return a filename of the 
form :

<first directory returned by 
comp-eln-load-path-eff>/subr--trampoline-<hash>_<primitive 
name>.eln (or something like this)

*Regardless* of whether said file actually exists, and in 
 particular even when it should really return nil because the file 
 does not exist.

So if this file that `comp-trampoline-search' assures us to exist 
does not, we reach the error.

So the point was, in order not to reach the error, we need :
- the file subr--trampoline-<hash>_<primitive name>.eln to already 
  exist.
- AND for it to be in the first directory returned by 
  `comp-eln-load-path-eff'.

This was just to show that avoiding the problem without resorting 
to deactivating trampoline compilation for this specific primitive 
is too complicated to bother with.

I hope this answers your first two questions.

> Are you sure you interpret this correctly? what do you think 
> being a
> "system one" means for the purposes of your situation, and why 
> is that
> important in the first place?

I just meant that maybe this assumption of the last directory in 
the list being /usr/lib/emacs/<version>/native-lisp was used 
somewhere else, and that we should not violate it.

In fact, I seem to remember that a function to prune eln cache 
directories from stale eln files was discussed on emacs-devel and 
even implemented. This function was later patched as to exclude 
the system eln cache from such pruning, for some reason I do not 
remember. The "system" eln cache was identified by its being the 
last in the list. So there is in fact at least one place in emacs 
where this assumption is used, and maybe Andrea or Lars or Stefan 
could find others.

But again, this was just part of the hypothetical thinking of 
"what should we do if we want to avoid this specific problem 
without resorting to disabling primitive trampoline 
compilation". That was confusing rather than clarifying, my 
mistake.

All the more since we agree on the necessity to be able to disable 
trampoline compilation.

> We intend to modify comp-enable-subr-trampolines so that it 
> could
> accept a string value, which would be interpreted as the 
> directory to
> place compiled trampolines.  Would that be good enough?

So if I follow, we would have these different possible values for 
`comp-enable-subr-trampolines' :
- nil means not compiling trampolines (no change with now)
- t means compiling them, and outputting them in the location 
  either pointed by `native-compile-target-directory' if it 
  exists, the first valid directory returned by 
  `comp-eln-load-path-eff' if not (no changes with now)
- a string value means compiling them, and outputting them in the 
  location pointed by the string (error if unwritable, or fallback 
  to `native-compile-target-directory' or `comp-eln-load-path-eff' 
  possibly ?) (this is new)

Would it possible to add a constant value, like 
'compile-but-no-output, that would have exactly the second 
behaviour I was mentioning before, that is compiling trampolines 
but not even trying to output them anywhere, by passing nil as the 
last argument of `comp--native-compile' ?

> The problem I'm trying to solve is that a boolean variable,
> inhibit-automatic-native-compilation, has a two effects that 
> cannot be
> separated. I'd like to have two variables instead

That's perfectly reasonable. We would just like to be able to 
replicate with these two variables exactly what 
`inhibit-automatic-native-compilation' did.

> You could do this in the early-init file, which is processed
> approximately at the same place in normal-top-level.

If I am not mistaken, the early init file's name is fixed, and is 
looked for in various places in the user's home. We do not have an 
existing home in our build environment.

Best,

Aymeric




  reply	other threads:[~2023-02-09  8:40 UTC|newest]

Thread overview: 146+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 12:57 Finalizing 'inhibit-automatic-native-compilation' Eli Zaretskii
2023-01-27 14:19 ` Andrea Corallo
2023-01-27 23:11 ` Stephen Leake
2023-01-27 23:58   ` Stefan Monnier
2023-01-28  0:32     ` Stephen Leake
2023-01-28  8:31       ` Eli Zaretskii
2023-01-28  8:08   ` Eli Zaretskii
2023-01-29 21:42     ` Stephen Leake
2023-01-27 23:57 ` Stefan Monnier
2023-01-28  9:17   ` Eli Zaretskii
2023-01-28 17:00     ` Stefan Monnier
2023-01-28 17:09       ` Eli Zaretskii
2023-01-28 17:42         ` Stefan Monnier
2023-01-28 17:54           ` Eli Zaretskii
2023-01-28 18:00             ` Stefan Monnier
2023-01-28 18:09               ` Eli Zaretskii
2023-01-28 21:41                 ` Andy Moreton
2023-01-29  6:46                   ` Eli Zaretskii
2023-01-29 11:46                     ` Andy Moreton
2023-01-28 22:24                 ` Stefan Monnier
2023-01-29  6:25                   ` Eli Zaretskii
2023-01-29 14:58                     ` Stefan Monnier
2023-01-29 15:30                       ` Eli Zaretskii
2023-01-30  2:30                         ` Stefan Monnier
2023-01-30 12:47                           ` Eli Zaretskii
2023-01-30 14:57                             ` Stefan Monnier
2023-01-30 17:07                               ` Eli Zaretskii
2023-01-30 17:18                                 ` Stefan Monnier
2023-01-31  4:19                               ` Richard Stallman
2023-01-31 14:26                                 ` Stefan Monnier
2023-02-01  5:04                                   ` Richard Stallman
2023-02-04 19:55                                     ` Lynn Winebarger
2023-02-04 20:08                                       ` Eli Zaretskii
2023-02-04 22:05                                         ` Lynn Winebarger
2023-02-05  7:40                                           ` Eli Zaretskii
2023-02-05 16:22                                             ` Lynn Winebarger
2023-02-06 10:15                                             ` Andrea Corallo
2023-02-06 10:25                                               ` Andrea Corallo
2023-02-06 13:05                                               ` Eli Zaretskii
2023-02-06 13:37                                                 ` Lynn Winebarger
2023-02-06 14:07                                                   ` Eli Zaretskii
2023-02-06 14:29                                                     ` Lynn Winebarger
2023-02-06 15:28                                                       ` Eli Zaretskii
2023-02-07  3:57                                                         ` Lynn Winebarger
2023-02-06 15:26                                               ` Lynn Winebarger
2023-02-02  5:18                           ` Sean Whitton
2023-02-02  7:55                             ` Eli Zaretskii
2023-02-02 16:17                               ` Sean Whitton
2023-02-06 10:57                                 ` Aymeric Agon-Rambosson
2023-02-06 14:29                                   ` Eli Zaretskii
2023-02-07  3:39                                     ` Aymeric Agon-Rambosson
2023-02-07 12:49                                       ` Eli Zaretskii
2023-02-09  8:40                                         ` Aymeric Agon-Rambosson [this message]
2023-02-09 10:11                                           ` Eli Zaretskii
2023-02-09 21:07                                             ` Sean Whitton
2023-02-10  8:13                                               ` Eli Zaretskii
2023-02-10  8:37                                             ` Aymeric Agon-Rambosson
2023-02-10 16:53                                               ` Andrea Corallo
2023-02-10 17:34                                                 ` Aymeric Agon-Rambosson
2023-02-11  8:11                                                   ` Andrea Corallo
2023-02-11 10:06                                                     ` Aymeric Agon-Rambosson
2023-02-11 10:44                                                       ` Eli Zaretskii
2023-02-12 16:47                                                         ` Aymeric Agon-Rambosson
2023-02-12 16:55                                                           ` Eli Zaretskii
2023-02-12 19:58                                                             ` Aymeric Agon-Rambosson
2023-02-12 20:09                                                               ` Eli Zaretskii
2023-02-14 10:36                                                                 ` Aymeric Agon-Rambosson
2023-02-14 13:51                                                                   ` Eli Zaretskii
2023-02-15 22:39                                                                     ` Aymeric Agon-Rambosson
2023-02-16  8:04                                                                       ` Eli Zaretskii
2023-02-17  8:15                                                                         ` Eli Zaretskii
2023-02-17 10:16                                                                           ` Andrea Corallo
2023-02-17 14:17                                                                             ` Eli Zaretskii
2023-02-18 21:48                                                                               ` Andrea Corallo
2023-02-19  9:21                                                                                 ` Eli Zaretskii
2023-02-20  9:14                                                                                   ` Andrea Corallo
2023-02-20 12:02                                                                                     ` Eli Zaretskii
2023-02-09 21:05                                       ` Sean Whitton
2023-02-10  8:08                                         ` Eli Zaretskii
2023-02-10 22:13                                           ` Sean Whitton
2023-02-11  9:16                                             ` Eli Zaretskii
2023-02-13 22:57                                               ` Sean Whitton
2023-02-14  5:17                                                 ` tomas
2023-02-14 13:21                                                   ` Eli Zaretskii
2023-02-14 11:29                                                 ` Andrea Corallo
2023-02-14 17:11                                                   ` Sean Whitton
2023-02-16 18:10                                                   ` Sean Whitton
2023-02-17  9:00                                                     ` Andrea Corallo
2023-02-17 16:42                                                       ` Sean Whitton
2023-02-17 19:18                                                         ` Eli Zaretskii
2023-02-17 21:13                                                         ` Bug#1021842: " Tatsuya Kinoshita
2023-02-18 21:56                                                           ` Andrea Corallo
2023-02-19  4:22                                                             ` Stefan Monnier
2023-02-20  9:03                                                               ` Andrea Corallo
2023-02-20 12:01                                                                 ` Eli Zaretskii
2023-02-20 15:42                                                                   ` Andrea Corallo
2023-02-20 16:02                                                                     ` Stefan Monnier
2023-02-20 20:22                                                                       ` Andrea Corallo
2023-02-20 16:57                                                                     ` Eli Zaretskii
2023-02-20 20:29                                                                       ` Andrea Corallo
2023-02-20 12:48                                                                 ` Stefan Monnier
2023-02-20 16:07                                                                   ` Andrea Corallo
2023-02-20 17:24                                                                     ` tomas
2023-02-07 13:56                                   ` Andrea Corallo
2023-02-07 15:03                                     ` Stefan Monnier
2023-02-07 15:27                                       ` Andrea Corallo
2023-02-09  7:26                                     ` Aymeric Agon-Rambosson
2023-02-09  7:52                                       ` Eli Zaretskii
2023-02-10  8:04                                         ` Aymeric Agon-Rambosson
2023-02-10  8:46                                           ` Eli Zaretskii
2023-02-10 17:02                                             ` Andrea Corallo
2023-02-02  5:40 ` Sean Whitton
2023-02-02  8:02   ` Eli Zaretskii
2023-02-02  8:41     ` tomas
2023-02-02  9:18       ` Eli Zaretskii
2023-02-02 16:28     ` Sean Whitton
2023-02-02 17:21       ` Eli Zaretskii
2023-02-09 21:12         ` Sean Whitton
2023-02-04 17:48 ` Liliana Marie Prikler
2023-02-04 18:18   ` Eli Zaretskii
2023-02-06 10:21     ` Andrea Corallo
2023-02-13 12:05 ` Andrea Corallo
2023-02-13 13:19   ` Eli Zaretskii
2023-02-13 15:21     ` Andrea Corallo
2023-02-13 15:37       ` Eli Zaretskii
2023-02-13 16:15         ` Andrea Corallo
2023-02-13 19:17   ` Stefan Monnier
2023-02-13 19:34     ` Andrea Corallo
2023-02-13 20:43       ` Stefan Monnier
2023-02-13 21:53         ` Andrea Corallo
2023-02-13 23:04           ` Stefan Monnier
2023-02-14  8:56             ` Andrea Corallo
2023-02-14 11:32             ` Andrea Corallo
     [not found]               ` <166586215062.368699.18398270685158383578.reportbug@convex>
2023-02-19 14:31                 ` Bug#1021842: " Tatsuya Kinoshita
2023-02-20  9:18                 ` Andrea Corallo
2023-02-20 12:03                   ` Eli Zaretskii
2023-02-20 20:50                 ` Bug#1021842: " Lynn Winebarger
2023-02-20 21:34                   ` Stefan Monnier
2023-02-20 22:17                     ` Lynn Winebarger
2023-02-20 22:02                 ` Bug#1021842: " Tatsuya Kinoshita
2023-02-21 15:40                 ` Andrea Corallo
2023-02-14  3:23       ` Eli Zaretskii
2023-02-14  3:31         ` Stefan Monnier
2023-02-14  8:55           ` Andrea Corallo
2023-02-14 13:11           ` Eli Zaretskii
2023-02-14 15:09             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mt5ncjuk.fsf@X570GP \
    --to=aymeric.agon@yandex.com \
    --cc=akrl@sdf.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rlb@defaultvalue.org \
    --cc=spwhitton@spwhitton.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).