Subject: Re: bug#47800: bug#44128: [feature/native-comp] When invoking a symlink to the 'emacs' binary Emacs fails to start

From: Phil Sainty <[email-masked]>
Date: Sun, 18 Apr 2021 19:40:20 +1200

Thank you Eli, this looks good to me too.

I tested with the following set of symlinks:

/home/phil/bin/emacs                         -> /home/phil/emacs/native-comp/usr/local/bin/emacs
/home/phil/bin/emacs-native-comp             -> /home/phil/emacs/native-comp/usr/local/bin/emacs
/home/phil/bin/emacs-28.0.50                 -> /home/phil/emacs/native-comp/usr/local/bin/emacs-28.0.50
/home/phil/bin/emacs-native-comp-28.0.50     -> /home/phil/emacs/native-comp/usr/local/bin/emacs-28.0.50
/home/phil/bin/emacs-native-comp-uninstalled -> /home/phil/emacs/native-comp/shallow-repository/src/emacs

For each of those symlinks, and also the absolute paths for the
link targets, I tested running them from multiple directories.
These included the directories of the real binaries, plus two
other directories containing a file or sub-directory named 'emacs':

drwxrwxr-x 25 phil phil 4096 Mar 28 23:30 /home/phil/emacs
-rw-rw-r--  1 phil phil    0 Apr 18 11:34 /tmp/emacs

In each test I ran --batch --eval "(prin1 comp-eln-load-path)"

$ (for dir in / /home /home/phil /home/phil/bin /home/phil/emacs /home/phil/emacs/native-comp/usr/local/bin /home/phil/emacs/native-comp/shallow-repository/src /tmp; do echo; echo $dir; cd $dir; for E in emacs emacs-native-comp emacs-28.0.50 emacs-native-comp-28.0.50 /home/phil/emacs/native-comp/usr/local/bin/emacs /home/phil/emacs/native-comp/usr/local/bin/emacs-28.0.50 emacs-native-comp-uninstalled /home/phil/emacs/native-comp/shallow-repository/src/emacs; do $E --batch --eval "(prin1 comp-eln-load-path)"; echo " -- $E"; done; done)

Nothing failed, and for every directory the output was the same:

("/home/phil/.emacs.d/eln-cache/" "/home/phil/emacs/native-comp/usr/local/lib/emacs/28.0.50/native-lisp/") -- emacs
("/home/phil/.emacs.d/eln-cache/" "/home/phil/emacs/native-comp/usr/local/lib/emacs/28.0.50/native-lisp/") -- emacs-native-comp
("/home/phil/.emacs.d/eln-cache/" "/home/phil/emacs/native-comp/usr/local/lib/emacs/28.0.50/native-lisp/") -- emacs-28.0.50
("/home/phil/.emacs.d/eln-cache/" "/home/phil/emacs/native-comp/usr/local/lib/emacs/28.0.50/native-lisp/") -- emacs-native-comp-28.0.50
("/home/phil/.emacs.d/eln-cache/" "/home/phil/emacs/native-comp/usr/local/lib/emacs/28.0.50/native-lisp/") -- /home/phil/emacs/native-comp/usr/local/bin/emacs
("/home/phil/.emacs.d/eln-cache/" "/home/phil/emacs/native-comp/usr/local/lib/emacs/28.0.50/native-lisp/") -- /home/phil/emacs/native-comp/usr/local/bin/emacs-28.0.50
("/home/phil/.emacs.d/eln-cache/" "/home/phil/emacs/native-comp/shallow-repository/native-lisp/") -- emacs-native-comp-uninstalled
("/home/phil/.emacs.d/eln-cache/" "/home/phil/emacs/native-comp/shallow-repository/native-lisp/") -- /home/phil/emacs/native-comp/shallow-repository/src/emacs

-Phil