unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Whatson <whatson@gmail.com>
To: 43875@debbugs.gnu.org
Cc: Andrew Whatson <whatson@gmail.com>
Subject: bug#43875: feature/native-comp; Fix another failure when eln-cache is removed
Date: Fri,  9 Oct 2020 11:38:09 +1000	[thread overview]
Message-ID: <20201009013808.3450325-1-whatson@gmail.com> (raw)

	* 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






             reply	other threads:[~2020-10-09  1:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09  1:38 Andrew Whatson [this message]
2020-10-09  6:39 ` bug#43875: feature/native-comp; Fix another failure when eln-cache is removed 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

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=20201009013808.3450325-1-whatson@gmail.com \
    --to=whatson@gmail.com \
    --cc=43875@debbugs.gnu.org \
    /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).