Subject: bug#73318: 31.0.50; with-native-compilation=aot breaks exec -a emacs

From: Spencer Baugh <[email-masked]>
Date: Mon, 07 Oct 2024 16:16:06 -0400

Eli Zaretskii <[email-masked]> writes:

>> From: Spencer Baugh <[email-masked]>
>> Cc: [email-masked],  [email-masked],  [email-masked],
>>    [email-masked],  [email-masked]
>> Date: Mon, 07 Oct 2024 10:18:37 -0400
>> 
>> Eli Zaretskii <[email-masked]> writes:
>> 
>> > That means to throw away a lot of code in emacs.c which we use now and
>> > was tested for several Emacs releases.  No, thanks, not for this
>> > obscure scenario.
>> 
>> OK, then perhaps just falling back on finding it relative to the pdump.
>> 
>> > I still don't understand why you insist on not changing your script to
>> > include the leading directories in argv[0].  It makes absolutely no
>> > sense to me to invent new code in such a place, when the alternative
>> > is so easy and reliable.
>> 
>> I would change the script if I could, but I can't: It's already been
>> copied into thousands of users' home directories.  It's such a tiny
>> wrapper (it just does "exec -a program /path/to/program") that it has
>> never needed to be modified for any program before this.
>
> Suit yourself, but I don't promise I will agree to accept the code
> changes you want to make.  This makes less and less sense to me as we
> continue talking about it.

That's fair enough.

Of the ways to make "exec -a emacs" work that I've proposed, which one
do you dislike the least?

So far I think the choice is between:

- Fallback to finding elns relative to PATH_EXEC (or some similar hardcoded path)
- Fallback to finding elns relative to the pdump location

Or maybe there's some other way to make "exec -a emacs" work that you
like better?

If you dislike them all equally, I'll probably implement the "fallback
to finding elns relative to pdump" approach.