unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
@ 2020-08-10  3:21 via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-08-10  8:27 ` Andreas Schwab
  2020-08-14 14:53 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 19+ messages in thread
From: via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-08-10  3:21 UTC (permalink / raw)
  To: 42790, eliz

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

Hi,

The pdmp file always named as "emcas.pdmp", this will cause error in my
local that I build two Emacs with different configuration options and
different suffix from same source tree. Here are configure lines:

$ cd ~/emacs-min && ~/emacs/configure --program-suffix=m --with-x=no...
$ cd ~/emacs-nor && ~/emacs/configure # normal build

After installation, run the first installed Emacs binary, there is
error message as follow:

emacs: could not load dump file "... emacs.pdmp": not built for this
Emacs executable

This patch will add the version info to pdmp file name to avoid the error.
After apply this patch, pdmp file in my case will be "emacs-27.1.pdmp" 
and "emacs-27.1m.pdmp", Emacs will load pdmp file correctly.

[-- Attachment #2: 0001-Makefile.in-Add-version-info-into-file-name-emacs.pd.patch --]
[-- Type: application/octet-stream, Size: 1243 bytes --]

From 416180fa843750ccedb4d1fcad436cd445f03735 Mon Sep 17 00:00:00 2001
From: Lin Sun <lin.sun@zoom.us>
Date: Mon, 10 Aug 2020 11:10:21 +0800
Subject: [PATCH] * Makefile.in: Add version info into file name "emacs.pdmp"

---
 Makefile.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.in b/Makefile.in
index 67e15cf..078607c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -309,6 +309,7 @@ TRANSFORM =
 EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'`
 EMACS = ${EMACS_NAME}${EXEEXT}
 EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT}
+EMACS_PDMP = `echo emacs-${version} | sed '$(TRANSFORM)'`".pdmp"
 
 # Subdirectories to make recursively.
 SUBDIR = $(NTDIR) lib lib-src src lisp
@@ -495,7 +496,7 @@ install-arch-dep:
 ifeq (${ns_self_contained},no)
 	${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifeq (${DUMPING},pdumper)
-	${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/emacs.pdmp
+	${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/${EMACS_PDMP}
 endif
 	-chmod 755 "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifndef NO_BIN_LINK
-- 
2.2.0


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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-08-10  3:21 bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-08-10  8:27 ` Andreas Schwab
  2020-08-10  9:24   ` via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-08-14 14:53 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 19+ messages in thread
From: Andreas Schwab @ 2020-08-10  8:27 UTC (permalink / raw)
  To: 42790; +Cc: lin.sun

On Aug 10 2020, via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> This patch will add the version info to pdmp file name to avoid the error.

Even better would be to use the fingerprint in the file name.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-08-10  8:27 ` Andreas Schwab
@ 2020-08-10  9:24   ` via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-16  1:03     ` Glenn Morris
  0 siblings, 1 reply; 19+ messages in thread
From: via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-08-10  9:24 UTC (permalink / raw)
  To: schwab, 42790; +Cc: eliz

Hi Andreas,

> Even better would be to use the fingerprint in the file name.

It's an idea solution, but in a build tree the name "emacs.pdmp" is reasonable.
Another excuse, it's also too complicated to modify the c/lisp/automake files 
to support generating pdmp file name with fingerprint correctly.






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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-08-10  3:21 bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-08-10  8:27 ` Andreas Schwab
@ 2020-08-14 14:53 ` Lars Ingebrigtsen
  2020-08-15  4:52   ` via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-14 14:53 UTC (permalink / raw)
  To: lin.sun; +Cc: 42790

<lin.sun@zoom.us> writes:

> The pdmp file always named as "emcas.pdmp", this will cause error in my
> local that I build two Emacs with different configuration options and
> different suffix from same source tree. Here are configure lines:
>
> $ cd ~/emacs-min && ~/emacs/configure --program-suffix=m --with-x=no...
> $ cd ~/emacs-nor && ~/emacs/configure # normal build
>
> After installation, run the first installed Emacs binary, there is
> error message as follow:

I'm not sure I understand the use case or the recipe -- if I try
something like that, it just says

gcc: error: fontset.o: No such file or directory
gcc: error: fringe.o: No such file or directory
gcc: error: image.o: No such file or directory
gcc: error: xgselect.o: No such file or directory
gcc: error: terminfo.o: No such file or directory
gcc: error: lastfile.o: No such file or directory
make[1]: *** [Makefile:651: temacs] Error 1
make[1]: Leaving directory '/tmp/em/src'
make: *** [Makefile:424: src] Error 2

after saying "make".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-08-14 14:53 ` Lars Ingebrigtsen
@ 2020-08-15  4:52   ` via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-08-15 10:42     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-08-15  4:52 UTC (permalink / raw)
  To: 'Lars Ingebrigtsen'; +Cc: eliz, 42790

Hi Lars,

I assume you already have an environment that can compile Emacs success, and these command lines will illustrate what happened,

cd ~ && git clone --depth 1 -b emacs-27 git://git.savannah.gnu.org/emacs.git ~/emacs && cd ~/emacs && ./autogen.sh; 
mkdir -p ~/emacs-min && cd ~/emacs-min && ~/emacs/configure --program-suffix=m --with-x=no && sudo make install;  
mkdir -p ~/emacs-nor && cd ~/emacs-nor && ~/emacs/configure && sudo make install;

Then try run /usr/local/bin/emacsm, you'll get the error message.

Regards
Lin Sun
-----Original Message-----
From: Lars Ingebrigtsen <larsi@gnus.org> 
Sent: Friday, August 14, 2020 22:53
To: lin.sun@zoom.us
Cc: 42790@debbugs.gnu.org; eliz@gnu.org
Subject: Re: bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file

<lin.sun@zoom.us> writes:

> The pdmp file always named as "emcas.pdmp", this will cause error in 
> my local that I build two Emacs with different configuration options 
> and different suffix from same source tree. Here are configure lines:
>
> $ cd ~/emacs-min && ~/emacs/configure --program-suffix=m --with-x=no...
> $ cd ~/emacs-nor && ~/emacs/configure # normal build
>
> After installation, run the first installed Emacs binary, there is 
> error message as follow:

I'm not sure I understand the use case or the recipe -- if I try something like that, it just says

gcc: error: fontset.o: No such file or directory
gcc: error: fringe.o: No such file or directory
gcc: error: image.o: No such file or directory
gcc: error: xgselect.o: No such file or directory
gcc: error: terminfo.o: No such file or directory
gcc: error: lastfile.o: No such file or directory
make[1]: *** [Makefile:651: temacs] Error 1
make[1]: Leaving directory '/tmp/em/src'
make: *** [Makefile:424: src] Error 2

after saying "make".

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no






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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-08-15  4:52   ` via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-08-15 10:42     ` Lars Ingebrigtsen
  2020-08-15 10:47       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-15 10:42 UTC (permalink / raw)
  To: lin.sun; +Cc: 42790

<lin.sun@zoom.us> writes:

> mkdir -p ~/emacs-min && cd ~/emacs-min && ~/emacs/configure
> --program-suffix=m --with-x=no && sudo make install;

I think the problem was that I had already built an Emacs in ~/emacs, so
it didn't want to build the .o files in ~/emacs-min, apparently...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-08-15 10:42     ` Lars Ingebrigtsen
@ 2020-08-15 10:47       ` Lars Ingebrigtsen
  2020-08-16  0:30         ` via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-15 10:47 UTC (permalink / raw)
  To: lin.sun; +Cc: 42790

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I think the problem was that I had already built an Emacs in ~/emacs, so
> it didn't want to build the .o files in ~/emacs-min, apparently...

Anyway, while your patch fixes the problem in your specific setup, it
doesn't really seem like a general fix.  Andreas's suggestion (to add
the fingerprint to the file name) seems like a safer solution.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-08-15 10:47       ` Lars Ingebrigtsen
@ 2020-08-16  0:30         ` via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 19+ messages in thread
From: via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-08-16  0:30 UTC (permalink / raw)
  To: 'Lars Ingebrigtsen'; +Cc: 42790

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

Hi Lars,

Yes, I agree with you that file name with fingerprint is an idea solution.
It may be have to keep the fingerprint be synced in c/lisp/Makefile, too
complicate (for me).
The minor changes in this patch will get an pretty enhance for most
circumstances, this patch can worked before other better solution ready.

Regards
Lin Sun

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 1866 bytes --]

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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-08-10  9:24   ` via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-11-16  1:03     ` Glenn Morris
  2020-11-20 15:07       ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Glenn Morris @ 2020-11-16  1:03 UTC (permalink / raw)
  To: lin.sun; +Cc: schwab, 42790


I have also had problems with configure's transform argument being
ignored for the pdmp file, and with the pdmp file not being found.

Here is a simple-minded proof-of-concept patch for installing the pdmp
file with the fingerprint in the name. It needs cleaning up (compilation
warnings; hexbuf stuff is awful; should look for FINGERPRINT.pdmp first,
then fall back to less specific names, finishing with emacs.pdmp; etc).
Hopefully people who know more about this stuff than me will feel like
finishing this off...

diff --git a/Makefile.in b/Makefile.in
index fbb1891ba7..d1c228c5f3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -309,6 +309,7 @@ TRANSFORM = @program_transform_name@
 EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'`
 EMACS = ${EMACS_NAME}${EXEEXT}
 EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT}
+EMACS_PDMP = `./src/emacs${EXEEXT} --fingerprint 2>&1 | sed 's/.* //'`.pdmp
 
 # Subdirectories to make recursively.
 SUBDIR = $(NTDIR) lib lib-src src lisp
@@ -495,7 +496,7 @@ install-arch-dep: src install-arch-indep install-etcdoc install-$(NTDIR)
 ifeq (${ns_self_contained},no)
 	${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifeq (${DUMPING},pdumper)
-	${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/emacs.pdmp
+	${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/${EMACS_PDMP}
 endif
 	-chmod 755 "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifndef NO_BIN_LINK
diff --git a/src/emacs.c b/src/emacs.c
index 172e460769..1743e1cc99 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -117,6 +117,7 @@ extern char etext;
 #endif
 
 #include "pdumper.h"
+#include "fingerprint.h"
 #include "epaths.h"
 
 static const char emacs_version[] = PACKAGE_VERSION;
@@ -238,6 +239,7 @@ Initialization options:\n\
 #ifdef HAVE_PDUMPER
     "\
 --dump-file FILE            read dumped state from FILE\n\
+--fingerprint               output fingerprint and exit\n\
 ",
 #endif
     "\
@@ -868,9 +870,15 @@ load_pdump (int argc, char **argv)
      "emacs.pdmp" so that the Emacs binary still works if the user
      copies and renames it.  */
   const char *argv0_base = "emacs";
+  enum { hexbuf_size = 2 * sizeof fingerprint };
+  char hexbuf[hexbuf_size];
+  hexbuf_digest (hexbuf, fingerprint, sizeof fingerprint);
+  char finger[hexbuf_size];
+  strcpy (finger, hexbuf);
+  finger[sizeof hexbuf] = '\0';
   ptrdiff_t needed = (strlen (path_exec)
                       + 1
-                      + strlen (argv0_base)
+                      + strlen (finger)
                       + strlen (suffix)
                       + 1);
   if (bufsize < needed)
@@ -879,7 +887,7 @@ load_pdump (int argc, char **argv)
       dump_file = xpalloc (NULL, &bufsize, needed - bufsize, -1, 1);
     }
   sprintf (dump_file, "%s%c%s%s",
-           path_exec, DIRECTORY_SEP, argv0_base, suffix);
+           path_exec, DIRECTORY_SEP, finger, suffix);
   result = pdumper_load (dump_file);
 
   if (result == PDUMPER_LOAD_FILE_NOT_FOUND)
@@ -1129,6 +1137,22 @@ main (int argc, char **argv)
       exit (0);
     }
 
+#ifdef HAVE_PDUMPER
+  if (argmatch (argv, argc, "-fingerprint", "--fingerprint", 4, NULL, &skip_args))
+    {
+      if (initialized)
+        {
+          dump_fingerprint ("fingerprint", fingerprint);
+          exit (0);
+        }
+      else
+        {
+          fputs ("Not initialized\n", stderr);
+          exit (1);
+        }
+    }
+#endif
+
   emacs_wd = emacs_get_current_dir_name ();
 #ifdef HAVE_PDUMPER
   if (dumped_with_pdumper_p ())
diff --git a/src/pdumper.c b/src/pdumper.c
index b5b4050b93..c8d7378221 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -311,7 +311,7 @@ dump_reloc_set_offset (struct dump_reloc *reloc, dump_off offset)
     error ("dump relocation out of range");
 }
 
-static void
+void
 dump_fingerprint (char const *label,
 		  unsigned char const xfingerprint[sizeof fingerprint])
 {
diff --git a/src/pdumper.h b/src/pdumper.h
index c793fb4058..2028b44f81 100644
--- a/src/pdumper.h
+++ b/src/pdumper.h
@@ -50,6 +50,10 @@ enum { PDUMPER_NO_OBJECT = -1 };
 #define PDUMPER_REMEMBER_SCALAR(thing)                  \
   pdumper_remember_scalar (&(thing), sizeof (thing))
 
+extern void dump_fingerprint (const char *label,
+                              const unsigned char *xfingerprint);
+
+
 extern void pdumper_remember_scalar_impl (void *data, ptrdiff_t nbytes);
 
 INLINE void





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-11-16  1:03     ` Glenn Morris
@ 2020-11-20 15:07       ` Eli Zaretskii
  2021-02-27  1:40         ` Glenn Morris
  2021-07-21 13:51         ` Lars Ingebrigtsen
  0 siblings, 2 replies; 19+ messages in thread
From: Eli Zaretskii @ 2020-11-20 15:07 UTC (permalink / raw)
  To: Glenn Morris, Daniel Colascione; +Cc: schwab, 42790, lin.sun

> From: Glenn Morris <rgm@gnu.org>
> Cc: schwab@linux-m68k.org,  42790@debbugs.gnu.org,  eliz@gnu.org
> Date: Sun, 15 Nov 2020 20:03:57 -0500
> 
> I have also had problems with configure's transform argument being
> ignored for the pdmp file, and with the pdmp file not being found.
> 
> Here is a simple-minded proof-of-concept patch for installing the pdmp
> file with the fingerprint in the name. It needs cleaning up (compilation
> warnings; hexbuf stuff is awful; should look for FINGERPRINT.pdmp first,
> then fall back to less specific names, finishing with emacs.pdmp; etc).
> Hopefully people who know more about this stuff than me will feel like
> finishing this off...

I hope this gets cleaned up, because I think it would be good to have
this fixed for Emacs 27.2.

Volunteers are welcome.

TIA





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-11-20 15:07       ` Eli Zaretskii
@ 2021-02-27  1:40         ` Glenn Morris
  2021-02-27  7:22           ` Eli Zaretskii
  2021-07-21 13:51         ` Lars Ingebrigtsen
  1 sibling, 1 reply; 19+ messages in thread
From: Glenn Morris @ 2021-02-27  1:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: schwab, 42790, lin.sun

Eli Zaretskii wrote:

> I hope this gets cleaned up, because I think it would be good to have
> this fixed for Emacs 27.2.

No response; presumably it's now too late.
(FWIW I think it would be straightforward for someone whose C isn't
execrable like mine.)

I really think having some central list of "issues that should be fixed
before the next release" would help with this kind of thing.

The debbugs blocking mechanism has been used for this previously.
If you don't like it that's fine, please use whatever you prefer.
Eg monthly summary postings to emacs-devel, anything.





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2021-02-27  1:40         ` Glenn Morris
@ 2021-02-27  7:22           ` Eli Zaretskii
  2021-02-27 16:05             ` Daniel Colascione
  2021-02-27 18:21             ` Glenn Morris
  0 siblings, 2 replies; 19+ messages in thread
From: Eli Zaretskii @ 2021-02-27  7:22 UTC (permalink / raw)
  To: Glenn Morris; +Cc: schwab, 42790, lin.sun

> From: Glenn Morris <rgm@gnu.org>
> Cc: Daniel Colascione <dancol@dancol.org>,  42790@debbugs.gnu.org,  schwab@linux-m68k.org,  lin.sun@zoom.us
> Date: Fri, 26 Feb 2021 20:40:22 -0500
> 
> Eli Zaretskii wrote:
> 
> > I hope this gets cleaned up, because I think it would be good to have
> > this fixed for Emacs 27.2.
> 
> No response; presumably it's now too late.

Yes, pretty much.

> (FWIW I think it would be straightforward for someone whose C isn't
> execrable like mine.)
> 
> I really think having some central list of "issues that should be fixed
> before the next release" would help with this kind of thing.
> 
> The debbugs blocking mechanism has been used for this previously.
> If you don't like it that's fine, please use whatever you prefer.
> Eg monthly summary postings to emacs-devel, anything.

It's okay to use debbugs blocking, but the problem is, we have no real
mechanism to make sure the blocking problems will be worked on, and
the fact that some aren't is an indirect evidence that those problems
aren't acute.  So delaying a release indefinitely due to such problems
doesn't sound wise to me: we are already accused of having too long
release cycles.





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2021-02-27  7:22           ` Eli Zaretskii
@ 2021-02-27 16:05             ` Daniel Colascione
  2021-02-27 18:21             ` Glenn Morris
  1 sibling, 0 replies; 19+ messages in thread
From: Daniel Colascione @ 2021-02-27 16:05 UTC (permalink / raw)
  To: Eli Zaretskii, Glenn Morris; +Cc: schwab, 42790, lin.sun


On 2/27/21 2:22 AM, Eli Zaretskii wrote:
>> From: Glenn Morris <rgm@gnu.org>
>> Cc: Daniel Colascione <dancol@dancol.org>,  42790@debbugs.gnu.org,  schwab@linux-m68k.org,  lin.sun@zoom.us
>> Date: Fri, 26 Feb 2021 20:40:22 -0500
>>
>> Eli Zaretskii wrote:
>>
>>> I hope this gets cleaned up, because I think it would be good to have
>>> this fixed for Emacs 27.2.
>> No response; presumably it's now too late.
> Yes, pretty much.


Maybe for next release: look through *all* *.pdmp files in well-known 
directories and just use the first one with the correct fingerprint? 
Then the files can have whatever name you want.






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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2021-02-27  7:22           ` Eli Zaretskii
  2021-02-27 16:05             ` Daniel Colascione
@ 2021-02-27 18:21             ` Glenn Morris
  2021-02-27 18:49               ` Eli Zaretskii
  1 sibling, 1 reply; 19+ messages in thread
From: Glenn Morris @ 2021-02-27 18:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: schwab, 42790, lin.sun

Eli Zaretskii wrote:

> So delaying a release indefinitely due to such problems doesn't sound
> wise to me: we are already accused of having too long release cycles.

You control when a release is made. A flag in the bug database can't
prevent you from making a release. But if you don't have any mechanism
for communicating to people what you think the important issues are,
they are likely to get lost in the noise (certain individuals can report
a dozen trivial bugs a day). Personally I have no idea what issues
remain to be fixed before 27.2 can be released.






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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2021-02-27 18:21             ` Glenn Morris
@ 2021-02-27 18:49               ` Eli Zaretskii
  0 siblings, 0 replies; 19+ messages in thread
From: Eli Zaretskii @ 2021-02-27 18:49 UTC (permalink / raw)
  To: Glenn Morris; +Cc: schwab, 42790, lin.sun

> From: Glenn Morris <rgm@gnu.org>
> Cc: dancol@dancol.org,  42790@debbugs.gnu.org,  schwab@linux-m68k.org,  lin.sun@zoom.us
> Date: Sat, 27 Feb 2021 13:21:54 -0500
> 
> Eli Zaretskii wrote:
> 
> > So delaying a release indefinitely due to such problems doesn't sound
> > wise to me: we are already accused of having too long release cycles.
> 
> You control when a release is made. A flag in the bug database can't
> prevent you from making a release. But if you don't have any mechanism
> for communicating to people what you think the important issues are,
> they are likely to get lost in the noise (certain individuals can report
> a dozen trivial bugs a day).

I think I do have a mechanism for communicating that: the 2 mailing
lists we use, and the bug tracker.  What better mechanism can you
propose that will make sure the messages don't drown in the noise?
You proposed announcing on emacs-devel, but with the level of noise
present there lately, I'm not sure _I_ don't lose important messages
there; I have no reason to believe posting there will get the
attention of the unknown parties who ignored this particular bug since
it was reported.

> Personally I have no idea what issues remain to be fixed before 27.2
> can be released.

None.  We are all set.  The next tarball will be a RC.





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2020-11-20 15:07       ` Eli Zaretskii
  2021-02-27  1:40         ` Glenn Morris
@ 2021-07-21 13:51         ` Lars Ingebrigtsen
  2021-09-30  1:33           ` Glenn Morris
  1 sibling, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-21 13:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Glenn Morris, schwab, 42790, lin.sun

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

Eli Zaretskii <eliz@gnu.org> writes:

> I hope this gets cleaned up, because I think it would be good to have
> this fixed for Emacs 27.2.

I've reworked Glenn's patch for Emacs 28...  but this is only for
installed Emacsen?  (And his comments about it needing more work is
still true.)

So that bit of the patch isn't directly relevant for the subject of this
bug report, but I guess the addition of the "--fingerprint" bit is?  (So
that we can write to emacs-FINGERPRINT.pdmp before moving to the
numbered version?)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: hex.patch --]
[-- Type: text/x-diff, Size: 4133 bytes --]

diff --git a/Makefile.in b/Makefile.in
index 97d954b6ce..edca0e7cf3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -307,6 +307,7 @@ TRANSFORM =
 EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'`
 EMACS = ${EMACS_NAME}${EXEEXT}
 EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT}
+EMACS_PDMP = `./src/emacs${EXEEXT} --fingerprint 2>&1 | sed 's/.* //'`.pdmp
 
 # Subdirectories to make recursively.
 SUBDIR = $(NTDIR) lib lib-src src lisp
@@ -515,7 +516,7 @@ install-arch-dep:
 ifeq (${ns_self_contained},no)
 	${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifeq (${DUMPING},pdumper)
-	${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/emacs.pdmp
+	${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/${EMACS_PDMP}
 endif
 	-chmod 755 "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifndef NO_BIN_LINK
diff --git a/src/emacs.c b/src/emacs.c
index 866e43fda9..2f971880cc 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -133,6 +133,7 @@ #define MAIN_PROGRAM
 #endif
 
 #include "pdumper.h"
+#include "fingerprint.h"
 #include "epaths.h"
 
 static const char emacs_version[] = PACKAGE_VERSION;
@@ -255,6 +256,7 @@ #define MAIN_PROGRAM
 #ifdef HAVE_PDUMPER
     "\
 --dump-file FILE            read dumped state from FILE\n\
+--fingerprint               output fingerprint and exit\n\
 ",
 #endif
 #if SECCOMP_USABLE
@@ -830,6 +832,8 @@ load_pdump (int argc, char **argv)
   const char *const suffix = ".pdmp";
   int result;
   char *emacs_executable = argv[0];
+  ptrdiff_t hexbuf_size;
+  char *hexbuf;
   const char *strip_suffix =
 #if defined DOS_NT || defined CYGWIN
     ".exe"
@@ -927,9 +931,13 @@ load_pdump (int argc, char **argv)
   /* Look for "emacs.pdmp" in PATH_EXEC.  We hardcode "emacs" in
      "emacs.pdmp" so that the Emacs binary still works if the user
      copies and renames it.  */
+  hexbuf_size = 2 * sizeof fingerprint + 1;
+  hexbuf = xmalloc (hexbuf_size);
+  hexbuf_digest (hexbuf, (char *)fingerprint, sizeof fingerprint);
+  hexbuf[sizeof hexbuf] = '\0';
   needed = (strlen (path_exec)
 	    + 1
-	    + strlen (argv0_base)
+	    + strlen (hexbuf)
 	    + strlen (suffix)
 	    + 1);
   if (bufsize < needed)
@@ -938,7 +946,7 @@ load_pdump (int argc, char **argv)
       dump_file = xpalloc (NULL, &bufsize, needed - bufsize, -1, 1);
     }
   sprintf (dump_file, "%s%c%s%s",
-           path_exec, DIRECTORY_SEP, argv0_base, suffix);
+           path_exec, DIRECTORY_SEP, hexbuf, suffix);
 #if !defined (NS_SELF_CONTAINED)
   /* Assume the Emacs binary lives in a sibling directory as set up by
      the default installation configuration.  */
@@ -1387,6 +1395,23 @@ main (int argc, char **argv)
       exit (0);
     }
 
+#ifdef HAVE_PDUMPER
+  if (argmatch (argv, argc, "-fingerprint", "--fingerprint", 4,
+		NULL, &skip_args))
+    {
+      if (initialized)
+        {
+          dump_fingerprint ("fingerprint", (unsigned char *)fingerprint);
+          exit (0);
+        }
+      else
+        {
+          fputs ("Not initialized\n", stderr);
+          exit (1);
+        }
+    }
+#endif
+
   emacs_wd = emacs_get_current_dir_name ();
 #ifdef HAVE_PDUMPER
   if (dumped_with_pdumper_p ())
diff --git a/src/pdumper.c b/src/pdumper.c
index 7730ea3d06..0a97849047 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -312,7 +312,7 @@ dump_reloc_set_offset (struct dump_reloc *reloc, dump_off offset)
     error ("dump relocation out of range");
 }
 
-static void
+void
 dump_fingerprint (char const *label,
 		  unsigned char const xfingerprint[sizeof fingerprint])
 {
diff --git a/src/pdumper.h b/src/pdumper.h
index deec9af046..bc339c42da 100644
--- a/src/pdumper.h
+++ b/src/pdumper.h
@@ -50,6 +50,9 @@ #define PDUMPER_IGNORE(thing) ((void) &(thing))
 #define PDUMPER_REMEMBER_SCALAR(thing)                  \
   pdumper_remember_scalar (&(thing), sizeof (thing))
 
+extern void dump_fingerprint (const char *label,
+                              const unsigned char *xfingerprint);
+
 extern void pdumper_remember_scalar_impl (void *data, ptrdiff_t nbytes);
 
 INLINE void

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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2021-07-21 13:51         ` Lars Ingebrigtsen
@ 2021-09-30  1:33           ` Glenn Morris
  2021-09-30  6:47             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: Glenn Morris @ 2021-09-30  1:33 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: schwab, 42790, lin.sun

Lars Ingebrigtsen wrote:

> So that bit of the patch isn't directly relevant for the subject of this
> bug report, but I guess the addition of the "--fingerprint" bit is?  (So
> that we can write to emacs-FINGERPRINT.pdmp before moving to the
> numbered version?)

This bug report is about "emacs.pdmp" is not being a specific enough
name. The OP suggests adding program suffix (etc; "version info")
information into the name of the pdmp file. My suggestion is that a
better solution is to use the dump fingerprint in the name instead
(I think this has been suggested several times.)
So the patch directly addresses the problem in the original report.
I think it just needs some C polishing.





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2021-09-30  1:33           ` Glenn Morris
@ 2021-09-30  6:47             ` Lars Ingebrigtsen
  2021-10-11 12:04               ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-30  6:47 UTC (permalink / raw)
  To: Glenn Morris; +Cc: schwab, 42790, lin.sun

Glenn Morris <rgm@gnu.org> writes:

> This bug report is about "emacs.pdmp" is not being a specific enough
> name. The OP suggests adding program suffix (etc; "version info")
> information into the name of the pdmp file. My suggestion is that a
> better solution is to use the dump fingerprint in the name instead
> (I think this has been suggested several times.)

Yes, I think everybody agrees with that.

> So the patch directly addresses the problem in the original report.
> I think it just needs some C polishing.

Right.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file
  2021-09-30  6:47             ` Lars Ingebrigtsen
@ 2021-10-11 12:04               ` Lars Ingebrigtsen
  0 siblings, 0 replies; 19+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-11 12:04 UTC (permalink / raw)
  To: Glenn Morris; +Cc: schwab, 42790, lin.sun

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> So the patch directly addresses the problem in the original report.
>> I think it just needs some C polishing.
>
> Right.

I've now tested the patch (after a "make install"), and after a minor
tweak, it seems to work fine.  So I've now installed it on the trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2021-10-11 12:04 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10  3:21 bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-10  8:27 ` Andreas Schwab
2020-08-10  9:24   ` via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-16  1:03     ` Glenn Morris
2020-11-20 15:07       ` Eli Zaretskii
2021-02-27  1:40         ` Glenn Morris
2021-02-27  7:22           ` Eli Zaretskii
2021-02-27 16:05             ` Daniel Colascione
2021-02-27 18:21             ` Glenn Morris
2021-02-27 18:49               ` Eli Zaretskii
2021-07-21 13:51         ` Lars Ingebrigtsen
2021-09-30  1:33           ` Glenn Morris
2021-09-30  6:47             ` Lars Ingebrigtsen
2021-10-11 12:04               ` Lars Ingebrigtsen
2020-08-14 14:53 ` Lars Ingebrigtsen
2020-08-15  4:52   ` via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-15 10:42     ` Lars Ingebrigtsen
2020-08-15 10:47       ` Lars Ingebrigtsen
2020-08-16  0:30         ` via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).