all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob f461bc8a78a06f2e9b93369b757f539097537ec4 3904 bytes (raw)
name: gnu/packages/patches/emacs-native-comp-fix-filenames.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
 
Upstream hashes both the absolute file name and the content of a file
to derive the name for the natively compiled files.  This breaks the
staged install used in guix, as any $GUIX_PROFILE is distinct from
the build directory.

Index: emacs-29.1/src/comp.c
===================================================================
--- emacs-29.1.orig/src/comp.c
+++ emacs-29.1/src/comp.c
@@ -4399,8 +4399,8 @@ FILENAME must exist, and if it's a symli
 If FILENAME is compressed, it must have the \".gz\" extension,
 and Emacs must have been compiled with zlib; the file will be
 uncompressed on the fly to hash its contents.
-Value includes the original base name, followed by 2 hash values,
-one for the file name and another for its contents, followed by .eln.  */)
+Value includes the original base name, followed by a hash of its
+content, followed by .eln.  */)
   (Lisp_Object filename)
 {
   CHECK_STRING (filename);
@@ -4423,64 +4423,26 @@ one for the file name and another for it
   filename = Fw32_long_file_name (filename);
 #endif
 
-  Lisp_Object content_hash = comp_hash_source_file (filename);
-
-  if (suffix_p (filename, ".gz"))
-    filename = Fsubstring (filename, Qnil, make_fixnum (-3));
-
-  /* We create eln filenames with an hash in order to look-up these
+  /* We create eln filenames with a hash in order to look-up these
      starting from the source filename, IOW have a relation
 
-     /absolute/path/filename.el + content ->
-     eln-cache/filename-path_hash-content_hash.eln.
+     filename.el + content -> eln-cache/filename-content_hash.eln.
 
      'dlopen' can return the same handle if two shared with the same
      filename are loaded in two different times (even if the first was
      deleted!).  To prevent this scenario the source file content is
-     included in the hashing algorithm.
+     included in the hashing algorithm.  */
 
-     As at any point in time no more then one file can exist with the
-     same filename, should be possible to clean up all
-     filename-path_hash-* except the most recent one (or the new one
-     being recompiled).
-
-     As installing .eln files compiled during the build changes their
-     absolute path we need an hashing mechanism that is not sensitive
-     to that.  For this we replace if match PATH_DUMPLOADSEARCH or
-     *PATH_REL_LOADSEARCH with '//' before computing the hash.  */
+  Lisp_Object content_hash = comp_hash_source_file (filename);
+  Lisp_Object separator = build_string ("-");
 
-  if (NILP (loadsearch_re_list))
-    {
-      Lisp_Object sys_re =
-	concat2 (build_string ("\\`[[:ascii:]]+"),
-		 Fregexp_quote (build_string ("/" PATH_REL_LOADSEARCH "/")));
-      Lisp_Object dump_load_search =
-	Fexpand_file_name (build_string (PATH_DUMPLOADSEARCH "/"), Qnil);
-#ifdef WINDOWSNT
-      dump_load_search = Fw32_long_file_name (dump_load_search);
-#endif
-      loadsearch_re_list = list2 (sys_re, Fregexp_quote (dump_load_search));
-    }
+  if (suffix_p (filename, ".gz"))
+    filename = Fsubstring (filename, Qnil, make_fixnum (-3));
 
-  Lisp_Object lds_re_tail = loadsearch_re_list;
-  FOR_EACH_TAIL (lds_re_tail)
-    {
-      Lisp_Object match_idx =
-	Fstring_match (XCAR (lds_re_tail), filename, Qnil, Qnil);
-      if (BASE_EQ (match_idx, make_fixnum (0)))
-	{
-	  filename =
-	    Freplace_match (build_string ("//"), Qt, Qt, filename, Qnil);
-	  break;
-	}
-    }
-  Lisp_Object separator = build_string ("-");
-  Lisp_Object path_hash = comp_hash_string (filename);
   filename = concat2 (Ffile_name_nondirectory (Fsubstring (filename, Qnil,
 							   make_fixnum (-3))),
 		      separator);
-  Lisp_Object hash = concat3 (path_hash, separator, content_hash);
-  return concat3 (filename, hash, build_string (NATIVE_ELISP_SUFFIX));
+  return concat3 (filename, content_hash, build_string (NATIVE_ELISP_SUFFIX));
 }
 
 DEFUN ("comp-el-to-eln-filename", Fcomp_el_to_eln_filename,

debug log:

solving f461bc8a78 ...
found f461bc8a78 in https://yhetil.org/guix/f38d16e04962f76bc74503a105065c1a30d51ff7.1700314926.git.liliana.prikler@gmail.com/

applying [1/1] https://yhetil.org/guix/f38d16e04962f76bc74503a105065c1a30d51ff7.1700314926.git.liliana.prikler@gmail.com/
diff --git a/gnu/packages/patches/emacs-native-comp-fix-filenames.patch b/gnu/packages/patches/emacs-native-comp-fix-filenames.patch
new file mode 100644
index 0000000000..f461bc8a78

1:30: trailing whitespace.
 
1:39: trailing whitespace.
 
1:43: trailing whitespace.
 
1:49: trailing whitespace.
 
1:61: trailing whitespace.
 
Checking patch gnu/packages/patches/emacs-native-comp-fix-filenames.patch...
Applied patch gnu/packages/patches/emacs-native-comp-fix-filenames.patch cleanly.
warning: squelched 4 whitespace errors
warning: 9 lines add whitespace errors.

index at:
100644 f461bc8a78a06f2e9b93369b757f539097537ec4	gnu/packages/patches/emacs-native-comp-fix-filenames.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.