GNU bug report logs - #43875
feature/native-comp; Fix another failure when eln-cache is removed

Previous Next

Package: emacs;

Reported by: Andrew Whatson <whatson <at> gmail.com>

Date: Fri, 9 Oct 2020 01:41:02 UTC

Severity: normal

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43875 in the body.
You can then email your comments to 43875 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#43875; Package emacs. (Fri, 09 Oct 2020 01:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrew Whatson <whatson <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 09 Oct 2020 01:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrew Whatson <whatson <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Andrew Whatson <whatson <at> gmail.com>
Subject: feature/native-comp; Fix another failure when eln-cache is removed
Date: Fri,  9 Oct 2020 11:38:09 +1000
	* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix typo in
	  name.  Attempt to create eln-cache directory before failing
	  with writability error.  Change error to be consistent.
---
 lisp/emacs-lisp/comp.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 763d44a23e..78f2ca696c 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2580,7 +2580,7 @@ comp-search-trampoline
    when (file-exists-p filename)
      do (cl-return filename)))
 
-(defun comp-tampoline-compile (subr-name)
+(defun comp-trampoline-compile (subr-name)
   "Synthesize and compile a trampoline for SUBR-NAME and return its filename."
   (let ((trampoline-sym (comp-trampoline-sym subr-name))
         (lambda-list (comp-make-lambda-list-from-subr
@@ -2608,9 +2608,13 @@ comp-tampoline-compile
                (comp-trampoline-filename subr-name)
                (concat dir
                        comp-native-version-dir))
-      when (file-writable-p f)
+      when (or (file-writable-p f)
+               (unwind-protect
+                   (progn
+                     (make-directory (file-name-directory f) t)
+                     t)))
         do (cl-return f)
-      finally (error "Can't find a writable directory in \
+      finally (error "Cannot find suitable directory for output in \
 `comp-eln-load-path'")))))
 
 ;;;###autoload
@@ -2621,7 +2625,7 @@ comp-subr-trampoline-install
     (let ((trampoline-sym (comp-trampoline-sym subr-name)))
       (cl-assert (subr-primitive-p (symbol-function subr-name)))
       (load (or (comp-search-trampoline subr-name)
-                (comp-tampoline-compile subr-name))
+                (comp-trampoline-compile subr-name))
             nil t)
       (cl-assert
        (subr-native-elisp-p (symbol-function trampoline-sym)))
-- 
2.28.0





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43875; Package emacs. (Fri, 09 Oct 2020 06:40:01 GMT) Full text and rfc822 format available.

Message #8 received at 43875 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Andrew Whatson <whatson <at> gmail.com>
Cc: 43875 <at> debbugs.gnu.org
Subject: Re: bug#43875: feature/native-comp; Fix another failure when
 eln-cache is removed
Date: Fri, 09 Oct 2020 06:39:11 +0000
Andrew Whatson <whatson <at> gmail.com> writes:

> 	* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix typo in
> 	  name.  Attempt to create eln-cache directory before failing
> 	  with writability error.  Change error to be consistent.

Hi Andrew,

thanks for the patch!

Could you remind me if your copyright paperwork was already done?

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43875; Package emacs. (Fri, 09 Oct 2020 07:52:02 GMT) Full text and rfc822 format available.

Message #11 received at 43875 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Whatson <whatson <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 43875 <at> debbugs.gnu.org
Subject: Re: bug#43875: feature/native-comp; Fix another failure when
 eln-cache is removed
Date: Fri, 9 Oct 2020 17:51:29 +1000
[Message part 1 (text/plain, inline)]
Yep it's all sorted!

On Fri, 9 Oct 2020, 4:39 pm Andrea Corallo, <akrl <at> sdf.org> wrote:

> Andrew Whatson <whatson <at> gmail.com> writes:
>
> >       * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix typo in
> >         name.  Attempt to create eln-cache directory before failing
> >         with writability error.  Change error to be consistent.
>
> Hi Andrew,
>
> thanks for the patch!
>
> Could you remind me if your copyright paperwork was already done?
>
> Thanks
>
>   Andrea
>
[Message part 2 (text/html, inline)]

Reply sent to Andrea Corallo <akrl <at> sdf.org>:
You have taken responsibility. (Sat, 10 Oct 2020 08:46:02 GMT) Full text and rfc822 format available.

Notification sent to Andrew Whatson <whatson <at> gmail.com>:
bug acknowledged by developer. (Sat, 10 Oct 2020 08:46:02 GMT) Full text and rfc822 format available.

Message #16 received at 43875-done <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Andrew Whatson <whatson <at> gmail.com>
Cc: 43875-done <at> debbugs.gnu.org
Subject: Re: bug#43875: feature/native-comp; Fix another failure when
 eln-cache is removed
Date: Sat, 10 Oct 2020 08:45:09 +0000
Andrew Whatson <whatson <at> gmail.com> writes:

> Yep it's all sorted!

Wonderful!

I've applied the patch as for the part related to the typo fix and
making the error homogeneous (85450f03be).

I've made a slightly different one (138990bbda) to address the problem
of the missing directory as it looks more correct to me (unwind-protect
would have not prevented the error to be catch-ed).

I've test it, as it works for me I'm closing.

Thanks for looking into this and submitting the patch!

  Andrea




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 07 Nov 2020 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 225 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.