[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 60b326e 3/4: * Workaround the 32768 chars command li
From: |
Andrea Corallo |
Subject: |
feature/native-comp 60b326e 3/4: * Workaround the 32768 chars command line limit in Windows. |
Date: |
Sat, 23 May 2020 06:42:22 -0400 (EDT) |
branch: feature/native-comp
commit 60b326ef112b6196cccf8bf9508df9e6622285cb
Author: Nicolás Bértolo <address@hidden>
Commit: Andrea Corallo <address@hidden>
* Workaround the 32768 chars command line limit in Windows.
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Pass the
compilation commands through a temporary file that is loaded by the
child process. This is also done all other operating systems, even
those that support long command lines. It should not be a problem
since libgccjit uses temporary files too.
---
lisp/emacs-lisp/comp.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 9fe614f..e5d3be6 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2337,6 +2337,10 @@ display a message."
(_ (progn
(comp-log "\n")
(comp-log (prin1-to-string expr))))
+ (temp-file (make-temp-file
+ (concat "emacs-async-comp-"
+ (file-name-base source-file) "-")
+ nil ".el" (prin1-to-string expr)))
(load1 load)
(process (make-process
:name (concat "Compiling: " source-file)
@@ -2344,13 +2348,14 @@ display a message."
:command (list
(expand-file-name invocation-name
invocation-directory)
- "--batch" "--eval" (prin1-to-string
expr))
+ "--batch" "-l" temp-file)
:sentinel
(lambda (process _event)
(run-hook-with-args
'comp-async-cu-done-hook
source-file)
(accept-process-output process)
+ (ignore-errors (delete-file temp-file))
(when (and load1
(zerop (process-exit-status
process)))
(native-elisp-load