unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
blob dc328f03a85ee9dbdbd307c604b71e35bce20332 1256 bytes (raw)
name: gnu/packages/patches/emacs-native-comp-pin-packages.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
 
Index: emacs-29.4/src/lread.c
===================================================================
--- emacs-29.4.orig/src/lread.c
+++ emacs-29.4/src/lread.c
@@ -1668,9 +1668,34 @@ directories, make sure the PREDICATE fun
 
 #ifdef HAVE_NATIVE_COMP
 static bool
+permit_swap_for_eln (Lisp_Object src_name, Lisp_Object eln_name)
+{
+  char *src = SSDATA (src_name), *eln = SSDATA (eln_name);
+  size_t eln_ln = strlen (eln);
+
+  while (*src && *eln && *src == *eln)
+    {
+      ++src; ++eln; --eln_ln;
+    }
+
+  /* After stripping common prefixes, the first directory should be
+   * "lib/" (inside the Guix store) or "native-lisp" (inside Emacs build).
+   * Alternatively, if eln contains "eln-cache", it's likely the user's
+   * cache, which we will also permit. */
+
+  return
+    (eln_ln > 4 && !strncmp (eln, "lib/", 4)) ||
+    (eln_ln > 12 && !strncmp (eln, "native-lisp/", 12)) ||
+    strstr (eln, "eln-cache") != NULL;
+}
+
+static bool
 maybe_swap_for_eln1 (Lisp_Object src_name, Lisp_Object eln_name,
 		     Lisp_Object *filename, int *fd, struct timespec mtime)
 {
+  if (!permit_swap_for_eln (src_name, eln_name))
+    return false;
+
   struct stat eln_st;
   int eln_fd = emacs_open (SSDATA (ENCODE_FILE (eln_name)), O_RDONLY, 0);
 

debug log:

solving dc328f03a8 ...
found dc328f03a8 in https://yhetil.org/guix-bugs/01f9481f9ab86a21bc85e82a6f2a7e3457d2709e.1733679675.git.liliana.prikler@gmail.com/

applying [1/1] https://yhetil.org/guix-bugs/01f9481f9ab86a21bc85e82a6f2a7e3457d2709e.1733679675.git.liliana.prikler@gmail.com/
diff --git a/gnu/packages/patches/emacs-native-comp-pin-packages.patch b/gnu/packages/patches/emacs-native-comp-pin-packages.patch
new file mode 100644
index 0000000000..dc328f03a8

1:12: trailing whitespace.
 
1:38: space before tab in indent.
 		     Lisp_Object *filename, int *fd, struct timespec mtime)
1:45: trailing whitespace.
 
Checking patch gnu/packages/patches/emacs-native-comp-pin-packages.patch...
1:45: new blank line at EOF.
+
Applied patch gnu/packages/patches/emacs-native-comp-pin-packages.patch cleanly.
warning: 4 lines add whitespace errors.

index at:
100644 dc328f03a85ee9dbdbd307c604b71e35bce20332	gnu/packages/patches/emacs-native-comp-pin-packages.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 public inbox

	https://git.savannah.gnu.org/cgit/guix.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).