unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source
@ 2022-05-31 13:01 cinnaroll45 via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-05-31 15:58 ` Eli Zaretskii
  2022-05-31 16:29 ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: cinnaroll45 via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-05-31 13:01 UTC (permalink / raw)
  To: 55741

[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]

OS: Debian 11 (Fresh Install)

ARCH: amd64

When building Emacs 27.2 from source, I use the following config:

```bash

./autogen.sh
./configure --prefix=/home/user/emacs --bindir=/home/user/bin \
    --with-json --with-gif --with-jpeg --with-png --with-tiff --with-rsvg

```

It builds without an issue and the binaries end up in my PATH and I can run Emacs.

When building Emacs 28.1 on the same system, I use the same config but with the addition of the `--with-native-compilation`flag:

```bash

./autogen.sh
./configure --prefix=/home/user/emacs --bindir=/home/user/bin \
    --with-native-compilation \
    --with-json --with-gif --with-jpeg --with-png --with-tiff --with-rsvg

```

The build goes without a hitch and the binaries end up in my PATH. However when I try to run the Emacs binary, I get the following error:

`Error using execdir /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/:
emacs: /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/../native-lisp/28.1-2120ad00/preloaded/window-0d1b8b93-7ef4271a.eln: cannot open shared object file: No such file or directory`

I should also note that, if I try to run the built binary within the `src`folder, Emacs starts without an issue. Only the binary that's on my PATH seems to have this error.

I have found a very similar problem on the emacs-devel mailing list:

[https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg00003.htm](https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg00003.html)

However, the person is trying to create a deb package so the recommendations there didn't help me.

Both source files are tarballs from the GNU FTP server and my system is Debian stable. Cleaning up build configs and trying fresh builds has not helped.

[-- Attachment #2: Type: text/html, Size: 13050 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source
  2022-05-31 13:01 bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source cinnaroll45 via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-05-31 15:58 ` Eli Zaretskii
       [not found]   ` <RKVYjycV9vhF-w_P2jZl06F_xdQXNTPAE8q9YTBR2day91p9qWwBo93JnKMApdg4BE_Uqhkk1BpMQEHKPQVuMWoujvnk5yC6Jsh3Y28whLE=@proton.me>
  2022-05-31 16:29 ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-05-31 15:58 UTC (permalink / raw)
  To: cinnaroll45; +Cc: 55741

> Date: Tue, 31 May 2022 13:01:06 +0000
> From:  cinnaroll45 via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> When building Emacs 28.1 on the same system, I use the same config but with the addition of the
> `--with-native-compilation` flag:
> 
> ```bash
> 
> ./autogen.sh
> ./configure --prefix=/home/user/emacs --bindir=/home/user/bin \
>     --with-native-compilation \
>     --with-json --with-gif --with-jpeg --with-png --with-tiff --with-rsvg
> 
> ```
> 
> The build goes without a hitch and the binaries end up in my PATH. However when I try to run the Emacs
> binary, I get the following error:
> 
> `Error using execdir /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/:
> emacs:
> /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/../native-lisp/28.1-2120ad00/preloaded/window-0d1b8b93-7ef4271a.eln:
> cannot open shared object file: No such file or directory`

The --bindir switch could be the problem: as you see from the error
message, Emacs 28.1 thinks its binary is in /home/user/emacs/bin, not
in /home/user/bin.  So my suggestion is to reconfigure without the
--bindir switch, as I don't think this is currently supported for the
build with native-compilation.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source
  2022-05-31 13:01 bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source cinnaroll45 via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-05-31 15:58 ` Eli Zaretskii
@ 2022-05-31 16:29 ` Eli Zaretskii
  2022-05-31 16:57   ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-05-31 16:29 UTC (permalink / raw)
  To: cinnaroll45; +Cc: 55741

> Date: Tue, 31 May 2022 13:01:06 +0000
> From:  cinnaroll45 via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> The build goes without a hitch and the binaries end up in my PATH. However when I try to run the Emacs
> binary, I get the following error:
> 
> `Error using execdir /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/:
> emacs:
> /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/../native-lisp/28.1-2120ad00/preloaded/window-0d1b8b93-7ef4271a.eln:
> cannot open shared object file: No such file or directory`

Can you show the full absolute file name of the file
window-0d1b8b93-7ef4271a.eln with this installation?  In which
directory is it installed by "make install"?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source
  2022-05-31 16:29 ` Eli Zaretskii
@ 2022-05-31 16:57   ` Eli Zaretskii
  2022-05-31 19:50     ` cinnaroll45 via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-05-31 16:57 UTC (permalink / raw)
  To: cinnaroll45; +Cc: 55741

> Cc: 55741@debbugs.gnu.org
> Date: Tue, 31 May 2022 19:29:50 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > Date: Tue, 31 May 2022 13:01:06 +0000
> > From:  cinnaroll45 via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> > 
> > The build goes without a hitch and the binaries end up in my PATH. However when I try to run the Emacs
> > binary, I get the following error:
> > 
> > `Error using execdir /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/:
> > emacs:
> > /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/../native-lisp/28.1-2120ad00/preloaded/window-0d1b8b93-7ef4271a.eln:
> > cannot open shared object file: No such file or directory`
> 
> Can you show the full absolute file name of the file
> window-0d1b8b93-7ef4271a.eln with this installation?  In which
> directory is it installed by "make install"?

And in addition, please show the full absolute file name of the
emacs.pdmp file, so we could know in which directory it is installed
on your system.

Thanks.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source
       [not found]   ` <RKVYjycV9vhF-w_P2jZl06F_xdQXNTPAE8q9YTBR2day91p9qWwBo93JnKMApdg4BE_Uqhkk1BpMQEHKPQVuMWoujvnk5yC6Jsh3Y28whLE=@proton.me>
@ 2022-05-31 19:10     ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-05-31 19:10 UTC (permalink / raw)
  To: cinnaroll45; +Cc: 55741

[Please use Reply All to keep the bug tracker on the CC list.]

> Date: Tue, 31 May 2022 18:10:56 +0000
> From: cinnaroll45 <cinnaroll45@proton.me>
> 
> > The --bindir switch could be the problem: as you see from the error
> > message, Emacs 28.1 thinks its binary is in /home/user/emacs/bin, not
> > in /home/user/bin. So my suggestion is to reconfigure without the
> > --bindir switch, as I don't think this is currently supported for the
> > build with native-compilation.
> 
> Removing the --bindir switch solved the issue for me. Everything gets installed to the
> expected location and the Emacs binary runs.

OK.

> > And in addition, please show the full absolute file name of the
> > emacs.pdmp file, so we could know in which directory it is installed on your system.
> 
> The location of the pdmp file was:
> /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/emacs.pdmp

OK.

> > Can you show the full absolute file name of the file window-0d1b8b93-7ef4271a.eln with
> > this installation?  In which directory is it installed by "make install"?
> 
> I couldn't expand the absolute location of `window-0d1b8b93-7ef4271a.eln`. The error message seemed to
> indicate that it was looking for it under the directory where `emacs.pdmp` is, however there were no
> directories present in that path. Just the pdmp file and three other binaries.

The *.eln files should be under /home/user/emacs/native-lisp/, can you
see if they are indeed there?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source
  2022-05-31 16:57   ` Eli Zaretskii
@ 2022-05-31 19:50     ` cinnaroll45 via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-02  7:02       ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: cinnaroll45 via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-05-31 19:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 55741

> The --bindir switch could be the problem: as you see from the error
> message, Emacs 28.1 thinks its binary is in /home/user/emacs/bin, not
> in /home/user/bin. So my suggestion is to reconfigure without the
> --bindir switch, as I don't think this is currently supported for the
> build with native-compilation.

Removing the --bindir switch solved the issue for me. Everything gets installed to the
expected location and the Emacs binary runs.

> And in addition, please show the full absolute file name of the
> emacs.pdmp file, so we could know in which directory it is installed on your system.

The location of the pdmp file was:
/home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/emacs.pdmp

> Can you show the full absolute file name of the file window-0d1b8b93-7ef4271a.eln with
> this installation?  In which directory is it installed by "make install"?

I couldn't expand the absolute location of `window-0d1b8b93-7ef4271a.eln`. The error message seemed to
indicate that it was looking for it under the directory where `emacs.pdmp` is, however there were no
directories present in that path. Just the pdmp file and three other binaries.

Thank you for helping out!





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source
  2022-05-31 19:50     ` cinnaroll45 via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-02  7:02       ` Eli Zaretskii
  2022-06-11 10:54         ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-06-02  7:02 UTC (permalink / raw)
  To: cinnaroll45; +Cc: 55741

> Date: Tue, 31 May 2022 19:50:42 +0000
> From: cinnaroll45 <cinnaroll45@proton.me>
> Cc: 55741@debbugs.gnu.org
> 
> > The --bindir switch could be the problem: as you see from the error
> > message, Emacs 28.1 thinks its binary is in /home/user/emacs/bin, not
> > in /home/user/bin. So my suggestion is to reconfigure without the
> > --bindir switch, as I don't think this is currently supported for the
> > build with native-compilation.
> 
> Removing the --bindir switch solved the issue for me. Everything gets installed to the
> expected location and the Emacs binary runs.
> 
> > And in addition, please show the full absolute file name of the
> > emacs.pdmp file, so we could know in which directory it is installed on your system.
> 
> The location of the pdmp file was:
> /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/emacs.pdmp
> 
> > Can you show the full absolute file name of the file window-0d1b8b93-7ef4271a.eln with
> > this installation?  In which directory is it installed by "make install"?
> 
> I couldn't expand the absolute location of `window-0d1b8b93-7ef4271a.eln`. The error message seemed to
> indicate that it was looking for it under the directory where `emacs.pdmp` is, however there were no
> directories present in that path. Just the pdmp file and three other binaries.
> 
> Thank you for helping out!

Thanks, but could you please test a possible fix for the original
problem?  I'd like us to keep supporting the --bindir configure-time
option, as we didn't intend dropping its support in Emacs 28.

So could you please re-configure Emacs 28.1 with your original
options, including the separate --bindir, and then rebuild it with the
patch below, install it by "make install", and see if Emacs now starts
up correctly?  If it doesn't start (or doesn't build), please show any
error messages you see.  TIA.

diff --git a/src/emacs.c b/src/emacs.c
index ccc0dd2..0a90b09 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -940,20 +940,24 @@ load_pdump (int argc, char **argv)
   sprintf (dump_file, "%s%c%s%s",
            path_exec, DIRECTORY_SEP, argv0_base, suffix);
 #if !defined (NS_SELF_CONTAINED)
-  /* Assume the Emacs binary lives in a sibling directory as set up by
-     the default installation configuration.  */
-  const char *go_up = "../../../../bin/";
-  needed += (strip_suffix ? strlen (strip_suffix) : 0)
-    - strlen (suffix) + strlen (go_up);
-  if (exec_bufsize < needed)
-    {
-      xfree (emacs_executable);
-      emacs_executable = xpalloc (NULL, &exec_bufsize, needed - exec_bufsize,
-				  -1, 1);
-    }
-  sprintf (emacs_executable, "%s%c%s%s%s",
-	   path_exec, DIRECTORY_SEP, go_up, argv0_base,
-	   strip_suffix ? strip_suffix : "");
+  if (!(emacs_executable && *emacs_executable))
+    {
+      /* If we didn't find the Emacs binary, assume that it lives in a
+	 sibling directory as set up by the default installation
+	 configuration.  */
+      const char *go_up = "../../../../bin/";
+      needed += (strip_suffix ? strlen (strip_suffix) : 0)
+	- strlen (suffix) + strlen (go_up);
+      if (exec_bufsize < needed)
+	{
+	  xfree (emacs_executable);
+	  emacs_executable = xpalloc (NULL, &exec_bufsize,
+				      needed - exec_bufsize, -1, 1);
+	}
+      sprintf (emacs_executable, "%s%c%s%s%s",
+	       path_exec, DIRECTORY_SEP, go_up, argv0_base,
+	       strip_suffix ? strip_suffix : "");
+    }
 #endif
   result = pdumper_load (dump_file, emacs_executable);
 





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source
  2022-06-02  7:02       ` Eli Zaretskii
@ 2022-06-11 10:54         ` Eli Zaretskii
  2022-06-20 16:05           ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-06-11 10:54 UTC (permalink / raw)
  To: cinnaroll45; +Cc: 55741

Ping!

Could you please try the fix I posted?  I'd like to install it for
Emacs 28.2.

> Cc: 55741@debbugs.gnu.org
> Date: Thu, 02 Jun 2022 10:02:42 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > Date: Tue, 31 May 2022 19:50:42 +0000
> > From: cinnaroll45 <cinnaroll45@proton.me>
> > Cc: 55741@debbugs.gnu.org
> > 
> > > The --bindir switch could be the problem: as you see from the error
> > > message, Emacs 28.1 thinks its binary is in /home/user/emacs/bin, not
> > > in /home/user/bin. So my suggestion is to reconfigure without the
> > > --bindir switch, as I don't think this is currently supported for the
> > > build with native-compilation.
> > 
> > Removing the --bindir switch solved the issue for me. Everything gets installed to the
> > expected location and the Emacs binary runs.
> > 
> > > And in addition, please show the full absolute file name of the
> > > emacs.pdmp file, so we could know in which directory it is installed on your system.
> > 
> > The location of the pdmp file was:
> > /home/user/emacs/libexec/emacs/28.1/x86_64-pc-linux-gnu/emacs.pdmp
> > 
> > > Can you show the full absolute file name of the file window-0d1b8b93-7ef4271a.eln with
> > > this installation?  In which directory is it installed by "make install"?
> > 
> > I couldn't expand the absolute location of `window-0d1b8b93-7ef4271a.eln`. The error message seemed to
> > indicate that it was looking for it under the directory where `emacs.pdmp` is, however there were no
> > directories present in that path. Just the pdmp file and three other binaries.
> > 
> > Thank you for helping out!
> 
> Thanks, but could you please test a possible fix for the original
> problem?  I'd like us to keep supporting the --bindir configure-time
> option, as we didn't intend dropping its support in Emacs 28.
> 
> So could you please re-configure Emacs 28.1 with your original
> options, including the separate --bindir, and then rebuild it with the
> patch below, install it by "make install", and see if Emacs now starts
> up correctly?  If it doesn't start (or doesn't build), please show any
> error messages you see.  TIA.
> 
> diff --git a/src/emacs.c b/src/emacs.c
> index ccc0dd2..0a90b09 100644
> --- a/src/emacs.c
> +++ b/src/emacs.c
> @@ -940,20 +940,24 @@ load_pdump (int argc, char **argv)
>    sprintf (dump_file, "%s%c%s%s",
>             path_exec, DIRECTORY_SEP, argv0_base, suffix);
>  #if !defined (NS_SELF_CONTAINED)
> -  /* Assume the Emacs binary lives in a sibling directory as set up by
> -     the default installation configuration.  */
> -  const char *go_up = "../../../../bin/";
> -  needed += (strip_suffix ? strlen (strip_suffix) : 0)
> -    - strlen (suffix) + strlen (go_up);
> -  if (exec_bufsize < needed)
> -    {
> -      xfree (emacs_executable);
> -      emacs_executable = xpalloc (NULL, &exec_bufsize, needed - exec_bufsize,
> -				  -1, 1);
> -    }
> -  sprintf (emacs_executable, "%s%c%s%s%s",
> -	   path_exec, DIRECTORY_SEP, go_up, argv0_base,
> -	   strip_suffix ? strip_suffix : "");
> +  if (!(emacs_executable && *emacs_executable))
> +    {
> +      /* If we didn't find the Emacs binary, assume that it lives in a
> +	 sibling directory as set up by the default installation
> +	 configuration.  */
> +      const char *go_up = "../../../../bin/";
> +      needed += (strip_suffix ? strlen (strip_suffix) : 0)
> +	- strlen (suffix) + strlen (go_up);
> +      if (exec_bufsize < needed)
> +	{
> +	  xfree (emacs_executable);
> +	  emacs_executable = xpalloc (NULL, &exec_bufsize,
> +				      needed - exec_bufsize, -1, 1);
> +	}
> +      sprintf (emacs_executable, "%s%c%s%s%s",
> +	       path_exec, DIRECTORY_SEP, go_up, argv0_base,
> +	       strip_suffix ? strip_suffix : "");
> +    }
>  #endif
>    result = pdumper_load (dump_file, emacs_executable);
>  
> 
> 
> 
> 





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source
  2022-06-11 10:54         ` Eli Zaretskii
@ 2022-06-20 16:05           ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-06-20 16:05 UTC (permalink / raw)
  To: cinnaroll45; +Cc: 55741-done

> Cc: 55741@debbugs.gnu.org
> Date: Sat, 11 Jun 2022 13:54:01 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> Ping!
> 
> Could you please try the fix I posted?  I'd like to install it for
> Emacs 28.2.

No further comments, so I installed the fix on the emacs-28 branch,
and I'm closing the bug.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-06-20 16:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31 13:01 bug#55741: Getting an error when running the Emacs 28.1 binary that I built from source cinnaroll45 via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-31 15:58 ` Eli Zaretskii
     [not found]   ` <RKVYjycV9vhF-w_P2jZl06F_xdQXNTPAE8q9YTBR2day91p9qWwBo93JnKMApdg4BE_Uqhkk1BpMQEHKPQVuMWoujvnk5yC6Jsh3Y28whLE=@proton.me>
2022-05-31 19:10     ` Eli Zaretskii
2022-05-31 16:29 ` Eli Zaretskii
2022-05-31 16:57   ` Eli Zaretskii
2022-05-31 19:50     ` cinnaroll45 via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-02  7:02       ` Eli Zaretskii
2022-06-11 10:54         ` Eli Zaretskii
2022-06-20 16:05           ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).