bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52376: 28.0.90; libdir is missing from native-comp-eln-load-path wit


From: Eli Zaretskii
Subject: bug#52376: 28.0.90; libdir is missing from native-comp-eln-load-path with GTK3 build
Date: Sat, 11 Dec 2021 14:49:54 +0200

> Date: Fri, 10 Dec 2021 14:53:30 -0500
> Cc: 52376@debbugs.gnu.org, akrl@sdf.org
> From: Ken Brown <kbrown@cornell.edu>
> 
> On 12/10/2021 11:56 AM, Eli Zaretskii wrote:
> > Please reconsider.  When Emacs finds the .pdmp file near its
> > executable, it makes certain assumptions about the location of the
> > *.eln files that don't fit the installed Emacs.  So placing the .pdmp
> > files there is not a good idea.
> 
> Could you elaborate on what problems this causes?  I've been doing something 
> similar in my Cygwin builds, and I'm not aware of any problems.  But maybe I 
> just haven't noticed.  Here's what I have, with three versions of emacs 
> installed:

Look at the logic in pdumper.c:

        /* Check just once if this is a local build or Emacs was installed.  */
        /* Can't use expand-file-name here, because we are too early
           in the startup, and we will crash at least on WINDOWSNT.  */
        if (installation_state == UNKNOWN)
          {
            eln_fname = make_uninit_string (execdir_len + fn1_len);
            fndata = SSDATA (eln_fname);
            memcpy (fndata, emacs_execdir, execdir_len);
            memcpy (fndata + execdir_len, SSDATA (cu_file1), fn1_len);
            if (file_access_p (fndata, F_OK))
              installation_state = INSTALLED;
            else
              {
                eln_fname = make_uninit_string (execdir_len + fn2_len);
                fndata = SSDATA (eln_fname);
                memcpy (fndata, emacs_execdir, execdir_len);
                memcpy (fndata + execdir_len, SSDATA (cu_file2), fn2_len);
                installation_state = LOCAL_BUILD;
              }
            fixup_eln_load_path (eln_fname);
          }

It decides whether this is an installed or an uninstalled Emacs
according to whether it can access the .eln file under the first or
the second candidate directory.  If you are careful enough to use real
/usr/bin and /usr/lib directories, this will work.  But if
/usr/bin/emacs is a symlink, and there's no real /usr/lib directory to
go with it, the logic shown about can easily fail.

This logic was generally designed to handle the "normal" case, where
the pdumper file is under /usr/libexec; the case where it is near the
Emacs binary is typically when you run Emacs uninstalled.  It does
attempt to handle several alternative use cases, but not every
possible one of them.  And the logic is tricky enough so I tend to
forget its details all the time, and need to read the code again...

So caveat emptor.

Why don't you configure each Emacs build with a different libexecdir
instead?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]