From: Stefan Kangas <stefan@marxist.se>
To: Andrea Corallo <akrl@sdf.org>
Cc: 44676@debbugs.gnu.org
Subject: bug#44676: [PATCH] Support native compilation of packages on install
Date: Fri, 20 Nov 2020 13:10:44 -0800 [thread overview]
Message-ID: <CADwFkm=HGNODLJvP+RAkmnGHn6qc=FBNEeLMUUTsmNrDe6KHBA@mail.gmail.com> (raw)
In-Reply-To: <xjfo8jr948n.fsf@sdf.org>
[-- Attachment #1: Type: text/plain, Size: 289 bytes --]
Andrea Corallo <akrl@sdf.org> writes:
>> However, perhaps we could make the LOAD parameter a simple boolean in
>> the user-facing `native-compile-async' function? I.e., we hide away
>> `late' for internal use only.
>
> Agree that's probably the best option.
How does the attached look?
[-- Attachment #2: 0004-Make-load-argument-of-native-compile-async-internal.patch --]
[-- Type: text/x-diff, Size: 2743 bytes --]
From 6ac20230fae2b700d301cd35238b283f287a6e81 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Thu, 19 Nov 2020 22:18:50 +0100
Subject: [PATCH 4/4] Make load argument of native-compile-async internal
* lisp/emacs-lisp/comp.el (native--compile-async-internal): New
defun extracted from native-compile-async.
(native-compile-async): Remove load argument and use above new defun.
* src/comp.c (maybe_defer_native_compilation): Use above new
defun. (Bug#44676)
---
lisp/emacs-lisp/comp.el | 20 ++++++++++++++++++--
src/comp.c | 6 +++---
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 2f1e8965c1..9bebc5ff1b 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -3485,8 +3485,7 @@ batch-byte-native-compile-for-bootstrap
(`(,tempfile . ,target-file)
(rename-file tempfile target-file t))))))
-;;;###autoload
-(defun native-compile-async (paths &optional recursively load)
+(defun native--compile-async-internal (paths &optional recursively load)
"Compile PATHS asynchronously.
PATHS is one path or a list of paths to files or directories.
@@ -3553,6 +3552,23 @@ native-compile-async
(when (zerop (comp-async-runnings))
(comp-run-async-workers))))
+;;;###autoload
+(defun native-compile-async (paths &optional recursively load)
+ "Compile PATHS asynchronously.
+PATHS is one path or a list of paths to files or directories.
+
+If optional argument RECURSIVELY is non-nil, recurse into
+subdirectories of given directories.
+
+If optional argument LOAD is non-nil, request to load the file
+after compiling.
+
+The variable `comp-async-jobs-number' specifies the number
+of (commands) to run simultaneously."
+ ;; Normalize: we only want to pass t or nil, never e.g. 'late.
+ (setq load (not (not load)))
+ (native--compile-async-internal paths recursively load))
+
(provide 'comp)
;;; comp.el ends here
diff --git a/src/comp.c b/src/comp.c
index 6ddfad528b..89f8a4f3cd 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4677,13 +4677,13 @@ maybe_defer_native_compilation (Lisp_Object function_name,
/* Comp already loaded. */
if (!NILP (delayed_sources))
{
- CALLN (Ffuncall, intern_c_string ("native-compile-async"),
+ CALLN (Ffuncall, intern_c_string ("native--compile-async-internal"),
delayed_sources, Qnil, Qlate);
delayed_sources = Qnil;
}
Fputhash (function_name, definition, Vcomp_deferred_pending_h);
- CALLN (Ffuncall, intern_c_string ("native-compile-async"), src, Qnil,
- Qlate);
+ CALLN (Ffuncall, intern_c_string ("native--compile-async-internal"),
+ src, Qnil, Qlate);
}
else
{
--
2.29.2
next prev parent reply other threads:[~2020-11-20 21:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 2:38 bug#44676: [PATCH] Support native compilation of packages on install Stefan Kangas
2020-11-16 15:12 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-18 14:41 ` Stefan Kangas
2020-11-18 16:05 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-19 22:34 ` Stefan Kangas
2020-11-20 8:45 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-20 20:03 ` Stefan Kangas
2020-11-20 20:12 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-20 21:10 ` Stefan Kangas [this message]
2020-11-20 22:56 ` bug#44676: [PATCH 4/4] " Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-21 3:26 ` Stefan Kangas
2020-11-21 11:38 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-20 8:55 ` bug#44676: [PATCH 1/4] " Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-20 9:03 ` bug#44676: [PATCH 2/4] " Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-20 20:07 ` Stefan Kangas
2020-11-20 20:16 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-20 9:06 ` bug#44676: [PATCH 3/4] " 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADwFkm=HGNODLJvP+RAkmnGHn6qc=FBNEeLMUUTsmNrDe6KHBA@mail.gmail.com' \
--to=stefan@marxist.se \
--cc=44676@debbugs.gnu.org \
--cc=akrl@sdf.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.