From 9f88a9c058fd9e1d34d68e6729f3d6105e291c41 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 6 Aug 2021 09:46:39 +0300 Subject: Make sure installed *.eln files have correct permissions * Makefile.in (install-eln): Add "umask 022" to ensure the *.eln files are accessible from the user's Emacs session. Suggested by Wilhelm Kirschbaum . (Bug#49864) --- Makefile.in | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index 97d954b6ce5..235b707673f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -789,6 +789,7 @@ install-etc: ### Install native compiled Lisp files. install-eln: lisp ifeq ($(HAVE_NATIVE_COMP),yes) + umask 022 ; \ find native-lisp -type d -exec $(MKDIR_P) "$(ELN_DESTDIR){}" \; ; \ find native-lisp -type f -exec ${INSTALL_DATA} "{}" "$(ELN_DESTDIR){}" \; endif -- cgit v1.2.3 From 6bec21243d20df015875ee8576bc722224480acb Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Mon, 27 Sep 2021 14:46:41 -0400 Subject: Make .eln files executable on Cygwin * Makefile.in (INSTALL_ELN): New variable, equal to $(INSTALL) on Cygwin and $(INSTALL_DATA) on other platforms. (install-eln): Use INSTALL_ELN instead of INSTALL_DATA. (Bug#50818) --- Makefile.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index 235b707673f..5fc1edc7a39 100644 --- a/Makefile.in +++ b/Makefile.in @@ -285,10 +285,16 @@ use_gamedir=$(gameuser)$(gamegroup) # not use an absolute path. So we must take care to always run # INSTALL-type commands from the directory containing the Makefile. # This explains (I think) the cd thisdir seen in several install rules. +SYSTEM_TYPE = @SYSTEM_TYPE@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_INFO = @INSTALL_INFO@ +ifeq ($(SYSTEM_TYPE),cygwin) + INSTALL_ELN = $(INSTALL) +else + INSTALL_ELN = $(INSTALL_DATA) +endif # By default, we uphold the dignity of our programs. INSTALL_STRIP = MKDIR_P = @MKDIR_P@ @@ -791,7 +797,7 @@ install-eln: lisp ifeq ($(HAVE_NATIVE_COMP),yes) umask 022 ; \ find native-lisp -type d -exec $(MKDIR_P) "$(ELN_DESTDIR){}" \; ; \ - find native-lisp -type f -exec ${INSTALL_DATA} "{}" "$(ELN_DESTDIR){}" \; + find native-lisp -type f -exec ${INSTALL_ELN} "{}" "$(ELN_DESTDIR){}" \; endif ### Build Emacs and install it, stripping binaries while installing them. -- cgit v1.2.3 From e81f1faca4382ed5c8f15fec84fb7c900a5468f9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 11 Oct 2021 14:03:26 +0200 Subject: Make the installed pmdp file use a fingerprint * Makefile.in (EMACS_PDMP): Use --fingerprint. * doc/emacs/cmdargs.texi (Action Arguments): Document --fingerprint. * src/emacs.c (load_pdump): Load the fingerprinted version of the pdmp file (bug#42790). (main): Support --fingerprint. * src/pdumper.c (dump_fingerprint): Make non-static. * src/pdumper.h: Declare dump_fingerprint. --- Makefile.in | 3 ++- doc/emacs/cmdargs.texi | 5 +++++ src/emacs.c | 31 +++++++++++++++++++++++++++++-- src/pdumper.c | 2 +- src/pdumper.h | 3 +++ 5 files changed, 40 insertions(+), 4 deletions(-) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index 5fc1edc7a39..c6c507fd42b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -313,6 +313,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 @@ -521,7 +522,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-${EMACS_PDMP} endif -chmod 755 "$(DESTDIR)${bindir}/$(EMACSFULL)" ifndef NO_BIN_LINK diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index d5177faea99..313682bdc33 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -185,6 +185,11 @@ successfully. @item --version @opindex --version Print Emacs version, then exit successfully. + +@item --fingerprint +@opindex --fingerprint +Print the Emacs ``fingerprint'', which is used to uniquely identify +the compiled version of Emacs. @end table @node Initial Options diff --git a/src/emacs.c b/src/emacs.c index 866e43fda94..cda7a9bf77f 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -133,6 +133,7 @@ extern char etext; #endif #include "pdumper.h" +#include "fingerprint.h" #include "epaths.h" static const char emacs_version[] = PACKAGE_VERSION; @@ -255,6 +256,7 @@ Initialization options:\n\ #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,15 @@ 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; + hexbuf = xmalloc (hexbuf_size + 1); + hexbuf_digest (hexbuf, (char *)fingerprint, sizeof fingerprint); + hexbuf[hexbuf_size] = '\0'; needed = (strlen (path_exec) + 1 + strlen (argv0_base) + + 1 + + strlen (hexbuf) + strlen (suffix) + 1); if (bufsize < needed) @@ -937,8 +947,8 @@ load_pdump (int argc, char **argv) xfree (dump_file); dump_file = xpalloc (NULL, &bufsize, needed - bufsize, -1, 1); } - sprintf (dump_file, "%s%c%s%s", - path_exec, DIRECTORY_SEP, argv0_base, suffix); + sprintf (dump_file, "%s%c%s-%s%s", + path_exec, DIRECTORY_SEP, argv0_base, 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 +1397,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 11c680d77b7..977f4fb2a85 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 deec9af046d..bc339c42da5 100644 --- a/src/pdumper.h +++ b/src/pdumper.h @@ -50,6 +50,9 @@ 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 -- cgit v1.2.3 From 0fe91bcfe2ba87be40050e214284a995a2a54900 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 12 Oct 2021 10:47:33 +0200 Subject: Change --fingerprint to output to stdout * src/pdumper.c (dump_fingerprint): Add argument OUTPUT, use it instead of stderr, update all uses. Don't print colon if LABEL is empty. * src/pdumper.h (dump_fingerprint): Adjust. * src/emacs.c (main): Print fingerprint to stdout, without label. * Makefile.in (EMACS_PDMP): Adjust. --- Makefile.in | 2 +- src/emacs.c | 5 +++-- src/pdumper.c | 11 ++++++----- src/pdumper.h | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index c6c507fd42b..300340c6e82 100644 --- a/Makefile.in +++ b/Makefile.in @@ -313,7 +313,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 +EMACS_PDMP = `./src/emacs${EXEEXT} --fingerprint`.pdmp # Subdirectories to make recursively. SUBDIR = $(NTDIR) lib lib-src src lisp diff --git a/src/emacs.c b/src/emacs.c index cda7a9bf77f..b178c6a06cf 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -933,7 +933,7 @@ load_pdump (int argc, char **argv) copies and renames it. */ hexbuf_size = 2 * sizeof fingerprint; hexbuf = xmalloc (hexbuf_size + 1); - hexbuf_digest (hexbuf, (char *)fingerprint, sizeof fingerprint); + hexbuf_digest (hexbuf, (char *) fingerprint, sizeof fingerprint); hexbuf[hexbuf_size] = '\0'; needed = (strlen (path_exec) + 1 @@ -1403,7 +1403,8 @@ main (int argc, char **argv) { if (initialized) { - dump_fingerprint ("fingerprint", (unsigned char *)fingerprint); + dump_fingerprint (stdout, "", + (unsigned char *) fingerprint); exit (0); } else diff --git a/src/pdumper.c b/src/pdumper.c index 977f4fb2a85..96fbd56a236 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -313,13 +313,14 @@ dump_reloc_set_offset (struct dump_reloc *reloc, dump_off offset) } void -dump_fingerprint (char const *label, +dump_fingerprint (FILE *output, char const *label, unsigned char const xfingerprint[sizeof fingerprint]) { enum { hexbuf_size = 2 * sizeof fingerprint }; char hexbuf[hexbuf_size]; hexbuf_digest (hexbuf, xfingerprint, sizeof fingerprint); - fprintf (stderr, "%s: %.*s\n", label, hexbuf_size, hexbuf); + fprintf (output, "%s%s%.*s\n", label, *label ? ": " : "", + hexbuf_size, hexbuf); } /* To be used if some order in the relocation process has to be enforced. */ @@ -4127,7 +4128,7 @@ types. */) ctx->header.fingerprint[i] = fingerprint[i]; const dump_off header_start = ctx->offset; - dump_fingerprint ("Dumping fingerprint", ctx->header.fingerprint); + dump_fingerprint (stderr, "Dumping fingerprint", ctx->header.fingerprint); dump_write (ctx, &ctx->header, sizeof (ctx->header)); const dump_off header_end = ctx->offset; @@ -5596,8 +5597,8 @@ pdumper_load (const char *dump_filename, char *argv0) desired[i] = fingerprint[i]; if (memcmp (header->fingerprint, desired, sizeof desired) != 0) { - dump_fingerprint ("desired fingerprint", desired); - dump_fingerprint ("found fingerprint", header->fingerprint); + dump_fingerprint (stderr, "desired fingerprint", desired); + dump_fingerprint (stderr, "found fingerprint", header->fingerprint); goto out; } diff --git a/src/pdumper.h b/src/pdumper.h index bc339c42da5..87de592b819 100644 --- a/src/pdumper.h +++ b/src/pdumper.h @@ -50,7 +50,7 @@ enum { PDUMPER_NO_OBJECT = -1 }; #define PDUMPER_REMEMBER_SCALAR(thing) \ pdumper_remember_scalar (&(thing), sizeof (thing)) -extern void dump_fingerprint (const char *label, +extern void dump_fingerprint (FILE *output, const char *label, const unsigned char *xfingerprint); extern void pdumper_remember_scalar_impl (void *data, ptrdiff_t nbytes); -- cgit v1.2.3 From 396d2d88afe254715eb3b09226e0353e72c47936 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 13 Oct 2021 11:14:59 -0700 Subject: Change release branch to emacs-28 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * admin/notes/git-workflow: * Makefile.in (PREFERRED_BRANCH): emacs-27 → emacs-28 --- Makefile.in | 2 +- admin/notes/git-workflow | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index 300340c6e82..ccb5d93f2f0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1165,7 +1165,7 @@ ChangeLog: ./$(emacslog) -o $(CHANGELOG) -n $(CHANGELOG_HISTORY_INDEX_MAX) # Check that we are in a good state for changing history. -PREFERRED_BRANCH = emacs-27 +PREFERRED_BRANCH = emacs-28 preferred-branch-is-current: git branch | grep -q '^\* $(PREFERRED_BRANCH)$$' unchanged-history-files: diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow index d109cdaa354..265a106bad5 100644 --- a/admin/notes/git-workflow +++ b/admin/notes/git-workflow @@ -16,14 +16,14 @@ Initial setup Then we want to clone the repository. We normally want to have both the current master and (if there is one) the active release branch -(eg emacs-27). +(eg emacs-28). mkdir ~/emacs cd ~/emacs git clone @git.sv.gnu.org:/srv/git/emacs.git master cd master git config push.default current -git worktree add ../emacs-27 emacs-27 +git worktree add ../emacs-28 emacs-28 You now have both branches conveniently accessible, and you can do "git pull" in them once in a while to keep updated. @@ -67,7 +67,7 @@ which will look like commit 958b768a6534ae6e77a8547a56fc31b46b63710b -cd ~/emacs/emacs-27 +cd ~/emacs/emacs-28 git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b and add "Backport:" to the commit string. Then @@ -109,7 +109,7 @@ up-to-date by doing a pull. Then start Emacs with emacs -l admin/gitmerge.el -f gitmerge You'll be asked for the branch to merge, which will default to -(eg) 'origin/emacs-27', which you should accept. Merging a local tracking +(eg) 'origin/emacs-28', which you should accept. Merging a local tracking branch is discouraged, since it might not be up-to-date, or worse, contain commits from you which are not yet pushed upstream. -- cgit v1.2.3