all messages for Emacs-related lists mirrored at yhetil.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: Tue, 07 Feb 2023 04:39:09 +0100	[thread overview]
Message-ID: <87ttzy2lgi.fsf@X570GP> (raw)
In-Reply-To: <83357irhnv.fsf@gnu.org>


Le lundi 6 février 2023 à 16:29, Eli Zaretskii <eliz@gnu.org> a 
écrit :

> I don't think I understand: the output of that function depends 
> on
> native-comp-eln-load-path, so why tweaking that is not enough?

For this specific problem, if the trampoline has not already been 
compiled, and can therefore be found in none of the directories in 
the `native-comp-eln-load-path' list, being able to tweak the 
variable does us no good.

If we assume that all trampolines have been compiled beforehand by 
a mechanism similar to "make trampolines", then we can find the 
trampolines in the system eln cache directory, but we still need 
to ensure that this system eln cache directory is the first in the 
variable `native-comp-eln-load-path'. However, the docstring says 
"The last directory of this list is assumed to be the system 
one.".

So for the variable `native-comp-eln-load-path', in order to 
respect that assumption and solve our projectile problem, we can 
either have :

("/usr/lib/emacs/<version>/native-lisp")

or

("/usr/lib/emacs/<version>/native-lisp" <arbitrary number of user 
eln cache directories> "/usr/lib/emacs/<version>/native-lisp")

The first solution works only if we are sure not to have to load 
any native-compiled elisp from user cache directories, and we 
don't have to native-compile any elisp (if we assume emacs running 
as unpriviledged user).

The second solution could work, I'm not sure whether the same 
value being present twice would create problems.

This projectile case is very specific, I admit, but just to give 
you an idea of why we might want to avoid all of this and simply 
disable trampoline compilation, either globally (which we did not 
have to do until now) or a specific number of primitives (see the 
list of my last message).

> If those can help you solve your problem, I think that's "good 
> enough"
> for something that needs to be done in a test suite.  My primary
> target audience, in contrast, is Emacs users.

I agree. For this specific case, disabling trampoline compilation 
on the relevant primitives by modifying 
`native-comp-never-optimize-functions' works (see 
https://github.com/bbatsov/projectile/commit/e18ad4d6111eb9e975ccce028baf5e4bb786bfcf), 
and is also the least intrusive way. And since it is not specific 
to our build system, we can reproduce with the upstream sources 
under specific circumstances, those can eventually be patched.

> A similar solution could have solved your problem even if
> inhibit-automatic-native-compilation didn't exist at all,and we 
> only
> had comp-enable-subr-trampolines and 
> native-comp-deferred-compilation,
> right?

`inhibit-automatic-native-compilation' is not exactly the negation 
of 
`native-comp-deferred-compilation'. `inhibit-automatic-native-compilation' 
also disables the outputting of the result of trampoline 
compilation to the file system, which solves the other problems 
related to unwritable $HOME mentioned earlier. This new variable 
allows for three behaviours :
- Not compiling trampolines (`comp-enable-subr-trampolines' set to 
  nil)
- Compiling them, but not outputting them to the filesystem 
  (`comp-enable-subr-trampolines' set to non-nil, and 
  `inhibit-automatic-native-compilation' set to non-nil)
- Compiling them and outputting them to the filesystem 
  (`comp-enable-subr-trampolines' set to non-nil, and 
  `inhibit-automatic-native-compilation' set to nil)

By contrast, `native-comp-deferred-compilation' and 
`comp-enable-subr-trampolines' only allowed for the first and the 
third behaviour. This second behaviour is the one we use by 
default now. The trampolines are used in the test (except in the 
pathological cases where they make emacs error or make the test 
fail), but we do not worry about where to output them, because we 
don't.

> Why do you need this to be done together with disabling native
> compilation? why not do it with two separate settings?

We could do it with two separate settings, but if it is decided 
not to get rid of environment variables, that would mean two of 
them.

> I understand the convenience, but once again, my primary 
> audience is
> the Emacs users, and they rarely need to handle such convoluted
> situations.  Some relative inconvenience aside, I see no reason 
> why
> you couldn't make do without the environment variable, but via 
> some
> automatically-loaded init files or somesuch.

I think there was some worry about whether an extra eval would 
arrive "soon enough", that is before any native compilation would 
have been attempted. In contrast, the value of the environment 
variable is obtained at very beginning of `normal-top-level', that 
is before any native compilation could possibly happen.

Other than that, I agree that this is mainly a question of 
convenience for us. So much so that, as Sean said, we would 
probably patch it back should it be removed. On top of that, the 
delta corresponding to the environment variable specifically is 
negligible (1 line in normal-top-level) when compared to the delta 
needed to implement the underlying 
`inhibit-automatic-native-compilation'.

Thanks !




  reply	other threads:[~2023-02-07  3:39 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 [this message]
2023-02-07 12:49                                       ` Eli Zaretskii
2023-02-09  8:40                                         ` Aymeric Agon-Rambosson
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

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

  git send-email \
    --in-reply-to=87ttzy2lgi.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.