all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: 44676@debbugs.gnu.org
Subject: bug#44676: [PATCH 2/4] Support native compilation of packages on install
Date: Fri, 20 Nov 2020 09:03:03 +0000	[thread overview]
Message-ID: <xjf8saw9z94.fsf_-_@sdf.org> (raw)
In-Reply-To: <CADwFkmn2UBGnoCP+9YRWDDYkLzW98hRegYuDpRO-k6qEZiyqxQ@mail.gmail.com> (Stefan Kangas's message of "Thu, 19 Nov 2020 14:34:52 -0800")

Stefan Kangas <stefan@marxist.se> writes:

> From cd2965916119dc60e3d3457fd96662d562430e16 Mon Sep 17 00:00:00 2001
> From: Stefan Kangas <stefan@marxist.se>
> Date: Thu, 19 Nov 2020 22:09:37 +0100
> Subject: [PATCH 2/4] Support native compilation of packages on install
>
> * lisp/emacs-lisp/package.el (package-unpack)
> (package--native-compile): Native compile packages on install, if the
> feature is available.  (Bug#44676)
> (package-native-compile): New defcustom.
> ---
>  etc/NEWS                   |  4 ++++
>  lisp/emacs-lisp/package.el | 17 +++++++++++++++++
>  2 files changed, 21 insertions(+)
>
> diff --git a/etc/NEWS b/etc/NEWS
> index 7aa5488250..8d90466312 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -823,6 +823,10 @@ equivalent to '(map (:sym sym))'.
>  
>  ** Package
>  
> +*** Native compile packages after installation.
> +This happens automatically but can be turned off by customizing the
> +user option `package-native-compile'.

This reminds me I've still not written a single NEWS entry for this
branch :/

>  +++
>  *** New commands to filter the package list.
>  The filter command key bindings are as follows:
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index a381ca01f3..b03a7c5321 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -389,6 +389,12 @@ package-selected-packages
>    :version "25.1"
>    :type '(repeat symbol))
>  
> +(defcustom package-native-compile t
> +  "Non-nil means to native compile packages on installation."
> +  :type '(boolean)
> +  :risky t
> +  :version "28.1")

I don't have a strong feeling but I'm really not convinced this should
be t by default.  Despite personal preferences the nil equivalent of
this is what we already do for vast majority of the .el distributed with
Emacs. WDYT?

>  (defcustom package-menu-async t
>    "If non-nil, package-menu will use async operations when possible.
>  Currently, only the refreshing of archive contents supports
> @@ -968,6 +974,8 @@ package-unpack
>          ;; E.g. for multi-package installs, we should first install all packages
>          ;; and then compile them.
>          (package--compile new-desc)
> +        (when package-native-compile
> +          (package--native-compile-async new-desc))
>          ;; After compilation, load again any files loaded by
>          ;; `activate-1', so that we use the byte-compiled definitions.
>          (package--load-files-for-activation new-desc :reload)))
> @@ -1052,6 +1060,15 @@ package--compile
>          (load-path load-path))
>      (byte-recompile-directory (package-desc-dir pkg-desc) 0 t)))
>  
> +(defun package--native-compile-async (pkg-desc)
> +  "Native compile installed package PKG-DESC asynchronously.
> +This assumes that `pkg-desc' has already been activated with
> +`package-activate-1'."
> +  (when (and (featurep 'nativecomp)
> +             (native-comp-available-p))
> +    (let ((warning-minimum-level :error))
> +      (native-compile-async (package-desc-dir pkg-desc) t))))
> +
>  ;;;; Inferring package from current buffer
>  (defun package-read-from-string (str)
>    "Read a Lisp expression from STR.

Otherwise LGTM

  Andrea





  parent reply	other threads:[~2020-11-20  9:03 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
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         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-11-20 20:07           ` bug#44676: [PATCH 2/4] " 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=xjf8saw9z94.fsf_-_@sdf.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=44676@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=stefan@marxist.se \
    /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.