Subject: Re: 28.0.50; make install with native-comp branch

From: Thierry Volpiatto <[email-masked]>
Date: Sat, 10 Apr 2021 19:55:15 +0200

Andrea Corallo <[email-masked]> writes:

> Thierry Volpiatto <[email-masked]> writes:
>
>> Andrea Corallo <[email-masked]> writes:
>>
>>> Eli Zaretskii <[email-masked]> writes:
>>>
>>>>> From: Thierry Volpiatto <[email-masked]>
>>>>> Date: Fri, 26 Feb 2021 08:35:30 +0100
>>>>>
>>>>> giving a try to native-comp branch.
>>>>>
>>>>> I install Emacs generaly with:
>>>>>
>>>>> make install bindir=/usr/local/sbin/emacs-28.0.50 infodir=/usr/local/share/info-28.0.50
>>>>>
>>>>> This always worked fine.  However with native-comp branch, I have to
>>>>> manually add a symlink of "/usr/local/lib/emacs/28.0.50/native-lisp/" to
>>>>> "/usr/local/sbin" otherwise I endup with an error:
>>>>>
>>>>> thierry@IPadS340:/usr/local/sbin/emacs-28.0.50$ ls
>>>>> ctags  ebrowse  emacs  emacs-28.0.50  emacsclient  etags
>>>>> thierry@IPadS340:/usr/local/sbin/emacs-28.0.50$ ./emacs-28.0.50
>>>>> emacs: /usr/local/sbin/emacs-28.0.50/../native-lisp/28.0.50-40158ec0/window-0d1b8b93-738411b0.eln: cannot open shared object file: No such file or directory
>>>>> thierry@IPadS340:/usr/local/sbin/emacs-28.0.50$ ./emacs
>>>>> emacs: /usr/local/sbin/emacs-28.0.50/../native-lisp/28.0.50-40158ec0/window-0d1b8b93-738411b0.eln: cannot open shared object file: No such file or directory
>>>>
>>>> Hmm... I'm not sure we can resolve this in any other way, although we
>>>> should try.  What worked for you with previous versions was just a
>>>> side effect of the implementation detail: how Emacs finds the files it
>>>> needs when it starts.  The *.eln files bring more restrictions to the
>>>> table, and it could very well be that the symlink trick will be the
>>>> only practical solution to such a non-standard installation.
>>>>
>>>> A possible solution is to set EMACSNATIVELOADPATH in the environment.
>>>
>>> As the error is while resurrecting from dump I think acting on the load
>>> path will not help as in this phase we relocate elns simply by filename.
>>>
>>> Thierry, are you specifying your custom bindir only when installing or
>>> also while building?
>>
>> Only when installing.
>>
>>> If the case is the first could you please try again setting bindir
>>> also while building?
>>
>> How, is this allowed or even possible?
>
> make bootstrap bindir=/xxx
>
> I think ATM this should work (would be nice if you could check this),

I tried and it is working partially.

Calling emacs from /usr/local/sbin works, however when I symlink
/usr/local/sbin/emacs-28.0.50/emacs-28.0.50 to /usr/local/bin I have the
same error:

make[1] : on quitte le répertoire « /home/thierry/tmp/emacs/lib-src »
find native-lisp -type d -exec /bin/mkdir -p "/usr/local/lib/emacs/28.0.50/{}" \; ; \
find native-lisp -type f -exec /usr/bin/install -c -m 644 "{}" "/usr/local/lib/emacs/28.0.50/{}" \;
thierry@IPadS340:~/tmp/emacs$ cd
thierry@IPadS340:~$ cd /usr/local/sbin/emacs-28.0.50/
thierry@IPadS340:/usr/local/sbin/emacs-28.0.50$ ls
ctags  ebrowse  emacs  emacs-28.0.50  emacsclient  etags
thierry@IPadS340:/usr/local/sbin/emacs-28.0.50$ ./emacs
thierry@IPadS340:/usr/local/sbin/emacs-28.0.50$ sudo eselect-emacs
Versions availables:
1) emacs-27.1
2) emacs-26.3
3) emacs-28.0.50

Current version is emacs-27.2
Choose a new version: 3
Deleting Symlink /usr/local/bin/emacsclient
Deleting Symlink /usr/local/bin/ctags
Deleting Symlink /usr/local/bin/etags
Deleting Symlink /usr/local/bin/ebrowse
Deleting Symlink /usr/local/bin/emacs
Symlinking /usr/local/sbin/emacs-28.0.50/emacsclient to /usr/local/bin/emacsclient
Symlinking /usr/local/sbin/emacs-28.0.50/ctags to /usr/local/bin/ctags
Symlinking /usr/local/sbin/emacs-28.0.50/etags to /usr/local/bin/etags
Symlinking /usr/local/sbin/emacs-28.0.50/ebrowse to /usr/local/bin/ebrowse
Symlinking /usr/local/sbin/emacs-28.0.50/emacs-28.0.50 to /usr/local/bin/emacs
Deleting symlink/usr/local/share/info
Symlinking /usr/local/share/info-28.0.50 to /usr/local/share/info

emacs-28.0.50 installed
thierry@IPadS340:/usr/local/sbin/emacs-28.0.50$ cdl
thierry@IPadS340:/usr/local/sbin$ cdl
thierry@IPadS340:/usr/local$ cd bin
thierry@IPadS340:/usr/local/bin$ ls
apt  ctags  ebrowse  emacs  emacsclient  emacseditor  eselect-emacs  etags  gnome-help  helm  highlight-mint  mint-sha256sum  mu  piactl  search  xournal  yelp
thierry@IPadS340:/usr/local/bin$ ./emacs
emacs: /usr/local/bin/../native-lisp/28.0.50-2f134e58/preloaded/window-0d1b8b93-513ac8ca.eln: cannot open shared object file: No such file or directory
thierry@IPadS340:/usr/local/bin$ emacs
emacs: /usr/local/bin/../native-lisp/28.0.50-2f134e58/preloaded/window-0d1b8b93-513ac8ca.eln: cannot open shared object file: No such file or directory

So for now what is working best for me is symlinking native-lisp
directory to /usr/local/sbin.

> 
> reading Eli's opinion we may change it tho.
>
>>> Sorry for not responding earlier, I've been in round robin on the issues
>>> I had the feeling were higher priority but was still in my todo list :)
>>
>> No problems, congrats for the huge work.
>
> Thanks
>
>   Andrea

-- 
Thierry