unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43875: feature/native-comp; Fix another failure when eln-cache is removed
@ 2020-10-09  1:38 Andrew Whatson
  2020-10-09  6:39 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Whatson @ 2020-10-09  1:38 UTC (permalink / raw)
  To: 43875; +Cc: Andrew Whatson

	* 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






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#43875: feature/native-comp; Fix another failure when eln-cache is removed
  2020-10-09  1:38 bug#43875: feature/native-comp; Fix another failure when eln-cache is removed Andrew Whatson
@ 2020-10-09  6:39 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-10-09  7:51   ` Andrew Whatson
  0 siblings, 1 reply; 4+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-09  6:39 UTC (permalink / raw)
  To: Andrew Whatson; +Cc: 43875

Andrew Whatson <whatson@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#43875: feature/native-comp; Fix another failure when eln-cache is removed
  2020-10-09  6:39 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-09  7:51   ` Andrew Whatson
  2020-10-10  8:45     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Whatson @ 2020-10-09  7:51 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: 43875

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

Yep it's all sorted!

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

> Andrew Whatson <whatson@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
>

[-- Attachment #2: Type: text/html, Size: 899 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#43875: feature/native-comp; Fix another failure when eln-cache is removed
  2020-10-09  7:51   ` Andrew Whatson
@ 2020-10-10  8:45     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 4+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-10  8:45 UTC (permalink / raw)
  To: Andrew Whatson; +Cc: 43875-done

Andrew Whatson <whatson@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-10  8:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09  1:38 bug#43875: feature/native-comp; Fix another failure when eln-cache is removed Andrew Whatson
2020-10-09  6:39 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-09  7:51   ` Andrew Whatson
2020-10-10  8:45     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).