* Generate trampolines in a temporary directory if no other option is viable
* lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Use temporary file if no other option is viable.
This commit is contained in:
parent
1a64f326e0
commit
ce4a066ed1
1 changed files with 12 additions and 8 deletions
|
@ -3800,18 +3800,22 @@ Return the trampoline if found or nil otherwise."
|
||||||
(list (expand-file-name comp-native-version-dir
|
(list (expand-file-name comp-native-version-dir
|
||||||
native-compile-target-directory))
|
native-compile-target-directory))
|
||||||
(comp-eln-load-path-eff)))
|
(comp-eln-load-path-eff)))
|
||||||
|
with rel-filename = (comp-trampoline-filename subr-name)
|
||||||
for dir in dirs
|
for dir in dirs
|
||||||
for f = (expand-file-name
|
for abs-filename = (expand-file-name rel-filename dir)
|
||||||
(comp-trampoline-filename subr-name)
|
|
||||||
dir)
|
|
||||||
unless (file-exists-p dir)
|
unless (file-exists-p dir)
|
||||||
do (ignore-errors
|
do (ignore-errors
|
||||||
(make-directory dir t)
|
(make-directory dir t)
|
||||||
(cl-return f))
|
(cl-return abs-filename))
|
||||||
when (file-writable-p f)
|
when (file-writable-p abs-filename)
|
||||||
do (cl-return f)
|
do (cl-return abs-filename)
|
||||||
finally (error "Cannot find suitable directory for output in \
|
;; Default to some temporary directory if no better option was
|
||||||
`native-comp-eln-load-path'")))
|
;; found.
|
||||||
|
finally (cl-return
|
||||||
|
(expand-file-name
|
||||||
|
(make-temp-file-internal (file-name-sans-extension rel-filename)
|
||||||
|
0 ".eln" nil)
|
||||||
|
temporary-file-directory))))
|
||||||
|
|
||||||
(defun comp-trampoline-compile (subr-name)
|
(defun comp-trampoline-compile (subr-name)
|
||||||
"Synthesize compile and return a trampoline for SUBR-NAME."
|
"Synthesize compile and return a trampoline for SUBR-NAME."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue