Subject: bug#78416: closed (Re: bug#78416: [PATCH] * src/lread.c (get-load-suffixes): Avoid module suffix with compressed suffix)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 24 May 2025 09:48:02 +0000

Your bug report

#78416: [PATCH] * src/lread.c (get-load-suffixes): Avoid module suffix with compressed suffix

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
78416: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78416
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#78416: [PATCH] * src/lread.c (get-load-suffixes): Avoid module suffix with compressed suffix
From: Eli Zaretskii <[email-masked]>
To: Lin Sun <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Sat, 24 May 2025 12:46:51 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Lin Sun <[email-masked]>
> CC: "[email-masked]" <[email-masked]>, "[email-masked]"
> 	<[email-masked]>, "[email-masked]" <[email-masked]>
> Date: Wed, 21 May 2025 20:43:15 +0000
> 
> From: Eli Zaretskii <[email-masked]>
> Sent: Saturday, May 17, 2025 06:57 AM
> 
> > Thanks, but I think you've misunderstood the comments.  We should only
> > ignore the ".gz" suffix.  Ignoring other suffixes would be a potential
> > regression, because there's nothing wrong in trying to load a file
> > called, say, foobar.so.abc.  The current code supports that, and I see
> > no reason to drop that support.
> 
> > The ".gz" suffix gets in the way because dynamic loaders cannot load
> > such compressed shared libraries.
> 
> > So the condition for not appending a suffix from
> > load-file-rep-suffixes should also test the value of 'ext', and only
> > refuse to append it if it compares equal with ".gz".
> 
> Yes, you're right.
> 
> According to the document of "load-file-rep-suffixes", the "jka-compr-load-suffixes" is used for the compressed suffixes.
> So I attach a new patch, the patch will seek the "jka-compr-load-suffixes" to determine the compressed suffixes for emacs module and skip it.
> Please check the attached patch for details. Thank you.

Thanks, I installed this on the master branch, and I'm closing the
bug.

P.S. Please see how I modified the commit log message, and try to
follow this style in the future.

Subject: [PATCH] * src/lread.c (get-load-suffixes): Avoid module suffix with compressed suffix
From: Lin Sun <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Wed, 14 May 2025 06:21:09 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

The Emacs (with module) will try load module with compressed suffix ".gz", for example, (require 'X) will trigger emacs try load file X.dll, X.dll.gz... on windows, but the "X.dll.gz" does not loadable, it affects performance especially on windows.

This patch make the (get-load-suffixes) function return result contains the ".dll" but avoid the ".dll.gz". 

Please help review the patch. Thank you.

From 25e18bb0722c822201a2cdd1a6eb9b54e66de838 Mon Sep 17 00:00:00 2001
From: Lin Sun <[email-masked]>
Date: Wed, 14 May 2025 06:30:34 +0000
Subject: [PATCH] * src/lread.c (get-load-suffixes): Avoid module suffix with
 compressed suffix

---
 src/lread.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/lread.c b/src/lread.c
index 95c9e711130..f4dbae6bab0 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1204,6 +1204,14 @@ DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
     {
       Lisp_Object exts = Vload_file_rep_suffixes;
       Lisp_Object suffix = XCAR (suffixes);
+#ifdef HAVE_MODULES
+      if (suffix_p(suffix, MODULES_SUFFIX))
+	continue;
+#ifdef MODULES_SECONDARY_SUFFIX
+      else if (suffix_p (suffix, MODULES_SECONDARY_SUFFIX))
+	continue;
+#endif
+#endif
       FOR_EACH_TAIL (exts)
 	lst = Fcons (concat2 (suffix, XCAR (exts)), lst);
     }
-- 
2.34.1