Commit d5a18a93 authored by Philipp Stephani's avatar Philipp Stephani Committed by Paul Eggert

Remove build system name from deterministic dumps

* (DETERMINISTIC_DUMP): New configuration option.
* lisp/version.el (emacs-build-time): Add a comment to make the
build time deterministic if requested.
(emacs-build-system): Make variable deterministic if requested.
* src/emacs.c (main): Initialize `deterministic-dump' from the
configuration option.
(syms_of_emacs): New constant `deterministic-dump'.
* src/sysdep.c (init_system_name): Use a constant
if a deterministic dump is requested.
parent a59a4bd4
......@@ -546,6 +546,19 @@ AC_ARG_ENABLE(gtk-deprecation-warnings,
[Show Gtk+/Gdk deprecation warnings for Gtk+ >= 3.0])],
[Make dumping deterministic by removing system-specific
information from the dump, such as host names and
if test "x${enableval}" = xno ; then
[Set this to true to make dumping deterministic.])
[Set this to true to make dumping deterministic.])
dnl This used to use changequote, but, apart from 'changequote is evil'
dnl per the autoconf manual, we can speed up autoconf somewhat by quoting
dnl the great gob of text. Thus it's not processed for possible expansion.
......@@ -38,12 +38,13 @@ This variable first existed in version 19.23.")
"Minor version number of this version of Emacs.
This variable first existed in version 19.23.")
;; FIXME: The next variable should also be a constant if
;; `deterministic-dump' is t.
(defconst emacs-build-time (current-time)
"Time at which Emacs was dumped out.")
;; I think this should be obsoleted/removed. It's just one more meaningless
;; difference between different builds. It's usually not even an fqdn.
(defconst emacs-build-system (system-name)
(defconst emacs-build-system
(if deterministic-dump "elided" (system-name))
"Name of the system on which Emacs was built.")
(defvar motif-version-string)
......@@ -872,6 +872,9 @@ main (int argc, char **argv)
SET_BINARY (fileno (stdout));
#endif /* MSDOS */
Vdeterministic_dump = Qt;
/* Skip initial setlocale if LC_ALL is "C", as it's not needed in that case.
The build procedure uses this while dumping, to ensure that the
dumped Emacs does not have its system locale tables initialized,
......@@ -2532,6 +2535,13 @@ libraries; only those already known by Emacs will be loaded. */);
Vdynamic_library_alist = Qnil;
Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt);
DEFVAR_BOOL ("deterministic-dump", Vdeterministic_dump,
doc: /* If non-nil, attempt to make dumping deterministic by
avoiding sources of nondeterminism such as absolute file names, the
hostname, or timestamps. */);
Vdeterministic_dump = DETERMINISTIC_DUMP ? Qt : Qnil;
XSYMBOL (intern_c_string ("deterministic-dump"))->constant = 1;
Vlibrary_cache = Qnil;
staticpro (&Vlibrary_cache);
......@@ -1408,6 +1408,13 @@ setup_pty (int fd)
init_system_name (void)
if (DETERMINISTIC_DUMP && (might_dump || ! NILP (Vpurify_flag)))
/* If we're dumping, set the hostname to a literal so that the
dump is deterministic. */
Vsystem_name = build_pure_c_string ("elided");
char *hostname_alloc = NULL;
char *hostname;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment