aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolás Bértolo2020-05-08 14:04:06 -0300
committerAndrea Corallo2020-05-23 09:36:52 +0100
commit60b326ef112b6196cccf8bf9508df9e6622285cb (patch)
tree94000122eb6e518dc43c5840e64860fe9ec88eab
parent21aef26a4c0234c3af6e3fdd269292a726aa0f48 (diff)
downloademacs-60b326ef112b6196cccf8bf9508df9e6622285cb.tar.gz
emacs-60b326ef112b6196cccf8bf9508df9e6622285cb.zip
* 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.
-rw-r--r--lisp/emacs-lisp/comp.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 9fe614f9e94..e5d3be6eed0 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2337,6 +2337,10 @@ display a message."
2337 (_ (progn 2337 (_ (progn
2338 (comp-log "\n") 2338 (comp-log "\n")
2339 (comp-log (prin1-to-string expr)))) 2339 (comp-log (prin1-to-string expr))))
2340 (temp-file (make-temp-file
2341 (concat "emacs-async-comp-"
2342 (file-name-base source-file) "-")
2343 nil ".el" (prin1-to-string expr)))
2340 (load1 load) 2344 (load1 load)
2341 (process (make-process 2345 (process (make-process
2342 :name (concat "Compiling: " source-file) 2346 :name (concat "Compiling: " source-file)
@@ -2344,13 +2348,14 @@ display a message."
2344 :command (list 2348 :command (list
2345 (expand-file-name invocation-name 2349 (expand-file-name invocation-name
2346 invocation-directory) 2350 invocation-directory)
2347 "--batch" "--eval" (prin1-to-string expr)) 2351 "--batch" "-l" temp-file)
2348 :sentinel 2352 :sentinel
2349 (lambda (process _event) 2353 (lambda (process _event)
2350 (run-hook-with-args 2354 (run-hook-with-args
2351 'comp-async-cu-done-hook 2355 'comp-async-cu-done-hook
2352 source-file) 2356 source-file)
2353 (accept-process-output process) 2357 (accept-process-output process)
2358 (ignore-errors (delete-file temp-file))
2354 (when (and load1 2359 (when (and load1
2355 (zerop (process-exit-status process))) 2360 (zerop (process-exit-status process)))
2356 (native-elisp-load 2361 (native-elisp-load