unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Stefan Kangas <stefankangas@gmail.com>, emacs-devel@gnu.org
Subject: Re: master 2772ebe366: Do not prune native-compiled system directories (bug#59658)
Date: Thu, 1 Dec 2022 17:56:25 +0100	[thread overview]
Message-ID: <CAAeL0SRzRw=bysczQ=0oFLnG=SLyusiX2BcHkeEDuTsqEr1sSw@mail.gmail.com> (raw)
In-Reply-To: <83mt87iobw.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 44 bytes --]

I'll install this if everyone's ok with it.

[-- Attachment #1.2: Type: text/html, Size: 143 bytes --]

[-- Attachment #2: comp-tests.patch --]
[-- Type: application/octet-stream, Size: 3871 bytes --]

diff --git i/test/lisp/emacs-lisp/comp-tests.el w/test/lisp/emacs-lisp/comp-tests.el
index 082b641fe3..418c729694 100644
--- i/test/lisp/emacs-lisp/comp-tests.el
+++ w/test/lisp/emacs-lisp/comp-tests.el
@@ -32,15 +32,19 @@ with-test-native-compile-prune-cache
   (declare (indent 0) (debug t))
   `(ert-with-temp-directory testdir
-     (setq testdir (expand-file-name "eln-cache" testdir))
-     (make-directory testdir)
-     (let* ((c1 (expand-file-name "29.0.50-cur" testdir))
-            (c2 (expand-file-name "29.0.50-old" testdir))
-            (native-comp-eln-load-path (list testdir))
-            (comp-native-version-dir "29.0.50-cur"))
-       (dolist (d (list c1 c2))
-         (make-directory d)
-         (with-temp-file (expand-file-name "some.eln" d) (insert "foo"))
-         (with-temp-file (expand-file-name "some.eln.tmp" d) (insert "foo")))
-       ,@body)))
+     (let ((usr-cache (expand-file-name "eln-usr-cache" testdir))
+	   (sys-cache (expand-file-name "eln-sys-cache" testdir)))
+       (make-directory usr-cache)
+       (make-directory sys-cache)
+       (let* ((c1 (expand-file-name "29.0.50-cur" usr-cache))
+              (c2 (expand-file-name "29.0.50-old" usr-cache))
+	      (s1 (expand-file-name "29.0.50-cur" sys-cache))
+	      (s2 (expand-file-name "preloaded" s1))
+              (native-comp-eln-load-path (list usr-cache sys-cache))
+              (comp-native-version-dir "29.0.50-cur"))
+	 (dolist (d (list c1 c2 s1 s2))
+           (make-directory d)
+           (with-temp-file (expand-file-name "some.eln" d) (insert "foo"))
+           (with-temp-file (expand-file-name "some.eln.tmp" d) (insert "foo")))
+	 ,@body))))
 
 (ert-deftest test-native-compile-prune-cache ()
@@ -48,7 +52,8 @@ test-native-compile-prune-cache
   (with-test-native-compile-prune-cache
     (native-compile-prune-cache)
-    (should (file-directory-p c1))
-    (should (file-regular-p (expand-file-name "some.eln" c1)))
-    (should (file-regular-p (expand-file-name "some.eln.tmp" c1)))
+    (dolist (d (list c1 s1 s2))
+      (should (file-directory-p d))
+      (should (file-regular-p (expand-file-name "some.eln" d)))
+      (should (file-regular-p (expand-file-name "some.eln.tmp" d))))
     (should-not (file-directory-p c2))
     (should-not (file-regular-p (expand-file-name "some.eln" c2)))
@@ -58,20 +63,22 @@ test-native-compile-prune-cache/delete-only-eln
   (skip-unless (featurep 'native-compile))
   (with-test-native-compile-prune-cache
-    (with-temp-file (expand-file-name "keep1.txt" c1) (insert "foo"))
-    (with-temp-file (expand-file-name "keep2.txt" c2) (insert "foo"))
+    (dolist (d (list c1 c2 s1 s2))
+      (with-temp-file (expand-file-name "keep.txt" d) (insert "foo")))
     (native-compile-prune-cache)
-    (should (file-regular-p (expand-file-name "keep1.txt" c1)))
-    (should (file-regular-p (expand-file-name "keep2.txt" c2)))))
+    (dolist (d (list c1 c2 s1 s2))
+      (should (file-regular-p (expand-file-name "keep.txt" d))))))
 
 (ert-deftest test-native-compile-prune-cache/dont-delete-in-parent-of-cache ()
   (skip-unless (featurep 'native-compile))
   (with-test-native-compile-prune-cache
-    (let ((f1 (expand-file-name "../some.eln" testdir))
-          (f2 (expand-file-name "some.eln" testdir)))
-      (with-temp-file f1 (insert "foo"))
-      (with-temp-file f2 (insert "foo"))
+    (let ((f1 (expand-file-name "../some.eln" usr-cache))
+          (f2 (expand-file-name "some.eln" usr-cache))
+	  (f3 (expand-file-name "../some.eln" sys-cache))
+	  (f4 (expand-file-name "some.eln" sys-cache)))
+      (dolist (f (list f1 f2 f3 f4))
+	(with-temp-file f (insert "foo")))
       (native-compile-prune-cache)
-      (should (file-regular-p f1))
-      (should (file-regular-p f2)))))
+      (dolist (f (list f1 f2 f3 f4))
+	(should (file-regular-p f))))))
 
 ;;; comp-tests.el ends here

  reply	other threads:[~2022-12-01 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <166965402487.18442.18379860639913355185@vcs2.savannah.gnu.org>
     [not found] ` <20221128164705.366A7C004B6@vcs2.savannah.gnu.org>
2022-11-30 17:34   ` master 2772ebe366: Do not prune native-compiled system directories (bug#59658) Stefan Kangas
2022-12-01  1:05     ` Juanma Barranquero
2022-12-01  3:49       ` Stefan Kangas
2022-12-01  3:57         ` Juanma Barranquero
2022-12-01  7:18         ` Eli Zaretskii
2022-12-01 16:56           ` Juanma Barranquero [this message]
2022-12-03 11:25             ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAeL0SRzRw=bysczQ=0oFLnG=SLyusiX2BcHkeEDuTsqEr1sSw@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).