From unknown Tue Sep 09 00:44:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#44676 <44676@debbugs.gnu.org> To: bug#44676 <44676@debbugs.gnu.org> Subject: Status: [PATCH] Support native compilation of packages on install Reply-To: bug#44676 <44676@debbugs.gnu.org> Date: Tue, 09 Sep 2025 07:44:34 +0000 retitle 44676 [PATCH] Support native compilation of packages on install reassign 44676 emacs submitter 44676 Stefan Kangas severity 44676 wishlist tag 44676 fixed patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 21:38:28 2020 Received: (at submit) by debbugs.gnu.org; 16 Nov 2020 02:38:28 +0000 Received: from localhost ([127.0.0.1]:54699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keUPT-0007pL-Mw for submit@debbugs.gnu.org; Sun, 15 Nov 2020 21:38:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:52718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keUPR-0007pA-Kc for submit@debbugs.gnu.org; Sun, 15 Nov 2020 21:38:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keUPR-0005Od-DG for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 21:38:25 -0500 Received: from mail-ej1-f41.google.com ([209.85.218.41]:35296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1keUPP-0001mt-QI for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 21:38:25 -0500 Received: by mail-ej1-f41.google.com with SMTP id f23so22364619ejk.2 for ; Sun, 15 Nov 2020 18:38:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=XgHTWb4gHX8lZZ/ZsiVmS8wSmcYbJ5My/WJ9cE2R9+g=; b=sj04FN/VqmXMsAXFB4vtx9oZjqS0FgWDJ0qVkyzg0QP0f4U4dIG/q5Q+jBcsoRASMB SnleZZ+3/hxxuUnF59RWCqPb/bS6qP9qK9Abc71K+bF5vZR2pr/A5w9mLIwvnuzs2quZ dqBqq1OASdLx1z/MX/TtQAd3Zx/l0ZjByPCECcrUYHKXCIOiIDRdJJiqCr0wO8FYOl7W ixQg4MOvUYlusDGcp0TL/fyExDBMjmcnFM84z1N23LbakW/6cgID45WHHg5G5YRp7mn5 kbM79aSwC5PN16Mkeb+3mOGZ9k26lkqG9dJV6m+R+qq90kMS/SH68frAQvBM21Cq+zE8 Cbug== X-Gm-Message-State: AOAM533z/HulVGIR+pl+A7AHhEW56kEq0Ab0hr9MI3m9whdL96yijAeZ 99EMmlL15zAXtwlfZirmU5xwr2RiIKxM3wW+GzeqtjmP X-Google-Smtp-Source: ABdhPJyUScfuomHIjKrHHPawM65YrKD+oncGokcMe4Tp2z5VnS4FfTcWofhGoAW174tzZwSL71zykgYlQSDjGKaD6eI= X-Received: by 2002:a17:906:804:: with SMTP id e4mr12163122ejd.420.1605494301631; Sun, 15 Nov 2020 18:38:21 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 15 Nov 2020 18:38:20 -0800 From: Stefan Kangas X-Debbugs-CC: akrl@sdf.org MIME-Version: 1.0 Date: Sun, 15 Nov 2020 18:38:20 -0800 Message-ID: Subject: [PATCH] Support native compilation of packages on install To: bug-gnu-emacs@gnu.org Content-Type: multipart/mixed; boundary="00000000000089c1bf05b43045f5" Received-SPF: pass client-ip=209.85.218.41; envelope-from=stefankangas@gmail.com; helo=mail-ej1-f41.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/15 21:38:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) --00000000000089c1bf05b43045f5 Content-Type: text/plain; charset="UTF-8" Severity: wishlist Please find attach a patch to add support to package.el for native compilation of packages on installation. I've done some minimal testing and it seems to do the job. (This is intended for the native-comp branch.) --00000000000089c1bf05b43045f5 Content-Type: text/x-diff; charset="US-ASCII"; name="0001-Support-native-compilation-of-packages-on-install.patch" Content-Disposition: attachment; filename="0001-Support-native-compilation-of-packages-on-install.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: beebeeba4f985e23_0.1 RnJvbSA5YTBkYTIxYTY5ODliMjBmNTkzZWMyYjI3YTQ4ZWI0ZWY5MDU2MWI3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5AbWFyeGlzdC5zZT4KRGF0 ZTogTW9uLCAxNiBOb3YgMjAyMCAwMzoyODozOSArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIFN1cHBv cnQgbmF0aXZlIGNvbXBpbGF0aW9uIG9mIHBhY2thZ2VzIG9uIGluc3RhbGwKCiogb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2FkKSkpCkBAIC0xMDUyLDYgKzEwNTMsMTIgQEAgcGFja2FnZS0tY29tcGlsZQogICAgICAg ICAobG9hZC1wYXRoIGxvYWQtcGF0aCkpCiAgICAgKGJ5dGUtcmVjb21waWxlLWRpcmVjdG9yeSAo cGFja2FnZS1kZXNjLWRpciBwa2ctZGVzYykgMCB0KSkpCiAKKyhkZWZ1biBwYWNrYWdlLS1uYXRp dmUtY29tcGlsZSAocGtnLWRlc2MpCisgICh3aGVuIChhbmQgKGZlYXR1cmVwICduYXRpdmVjb21w KQorICAgICAgICAgICAgIChuYXRpdmUtY29tcC1hdmFpbGFibGUtcCkpCisgICAgKGxldCAoKHdh cm5pbmctbWluaW11bS1sZXZlbCA6ZXJyb3IpKQorICAgICAgKG5hdGl2ZS1jb21waWxlLWFzeW5j IChwYWNrYWdlLWRlc2MtZGlyIHBrZy1kZXNjKSB0ICdsYXRlKSkpKQorCiA7Ozs7IEluZmVycmlu ZyBwYWNrYWdlIGZyb20gY3VycmVudCBidWZmZXIKIChkZWZ1biBwYWNrYWdlLXJlYWQtZnJvbS1z dHJpbmcgKHN0cikKICAgIlJlYWQgYSBMaXNwIGV4cHJlc3Npb24gZnJvbSBTVFIuCi0tIAoyLjI5 LjIKCg== --00000000000089c1bf05b43045f5-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 16 10:12:35 2020 Received: (at 44676) by debbugs.gnu.org; 16 Nov 2020 15:12:36 +0000 Received: from localhost ([127.0.0.1]:56755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kegBH-0006OG-I6 for submit@debbugs.gnu.org; Mon, 16 Nov 2020 10:12:35 -0500 Received: from mx.sdf.org ([205.166.94.24]:64037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kegBF-0006O7-5E for 44676@debbugs.gnu.org; Mon, 16 Nov 2020 10:12:34 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AGFCVhA008538; Mon, 16 Nov 2020 15:12:32 GMT From: Andrea Corallo To: Stefan Kangas Subject: Re: bug#44676: [PATCH] Support native compilation of packages on install References: Date: Mon, 16 Nov 2020 15:12:31 +0000 In-Reply-To: (Stefan Kangas's message of "Sun, 15 Nov 2020 18:38:20 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: Hi Stefan, thanks for the patch > Severity: wishlist > > Please find attach a patch to add support to package.el for native > compilation of packages on installation. > > I've done some minimal testing and it seems to do the job. > > (This is intended for the native-comp branch.) > > From 9a0da21a6989b20f593ec2b27a48eb4ef90561b7 Mon Sep 17 00:00:00 2001 > From: Stefan Kangas > Date: Mon, 16 Nov 2020 03:28:39 +0100 > Subject: [PATCH] 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. > --- > lisp/emacs-lisp/package.el | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el > index a381ca01f3..54b42db181 100644 > --- a/lisp/emacs-lisp/package.el > +++ b/lisp/emacs-lisp/package.el > @@ -968,6 +968,7 @@ package-unpack > ;; E.g. for multi-package installs, we should first install all packages > ;; and then compile them. > (package--compile new-desc) > + (package--native-compile 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 +1053,12 @@ package--compile > (load-path load-path)) > (byte-recompile-directory (package-desc-dir pkg-desc) 0 t))) > > +(defun package--native-compile (pkg-desc) > + (when (and (featurep 'nativecomp) > + (native-comp-available-p)) > + (let ((warning-minimum-level :error)) > + (native-compile-async (package-desc-dir pkg-desc) t 'late)))) Late load assume the current bytecode is already loaded when the native load will happen. This because late load is designed to be issued when some bytecode file is loaded and no native code alternative is found. We should probably issue the async compilation here without late load and in case the bytecode is being loaded before native compilation was done just patch the kind of load stored into `comp-files-queue'. ATM if the stored load property and new one are not matching we complain (See comp.el:3528). So yeah non 100% straight forward :) That said I think we should have a customize to decided if we want package to eager command native compilation. I may never used some of the installed files and prefer the current solution for that, or maybe I may just like to have the compilation happening in a more diluted fashion and on demand (my personal taste). Thanks Andrea From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 18 09:41:18 2020 Received: (at 44676) by debbugs.gnu.org; 18 Nov 2020 14:41:18 +0000 Received: from localhost ([127.0.0.1]:34623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfOe6-0003ae-14 for submit@debbugs.gnu.org; Wed, 18 Nov 2020 09:41:18 -0500 Received: from mail-ej1-f44.google.com ([209.85.218.44]:39653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfOe2-0003aR-RC for 44676@debbugs.gnu.org; Wed, 18 Nov 2020 09:41:16 -0500 Received: by mail-ej1-f44.google.com with SMTP id s25so3083089ejy.6 for <44676@debbugs.gnu.org>; Wed, 18 Nov 2020 06:41:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=iW8xTPLlL4bKoMRA8ugI1ELR+/ZoZgw7B76+LrD4LNY=; b=MBxE2tfxA7Io6oVULimOm+SMYdwFwXcqY9aGVqMHdY6o/M6I0YcqM5/CXR4T6kz0Eh 1HTTRewQmUeKA7kKmVDiShoIIBuav+iI2wWRMUokENcFfpf+1PKAvM0P4SaFbBq2JrFy rVIEFohjOvjaC1RU74n1suEy4lY/Yy32bR3DgYnWsRAqevi103eTfbMgDnZN+isYg3cA cwRkFIySe/58Xkhi4BPlzx6FXRzKsEU6wOBeIx3z616q3StOjMbP3jp5adKLK1rqDvHW BFgBsXgNXdvnuTxQtal4Ldjsp7GfL77M7DEthiYTveCaGrEdFjXmKcESU5kDxVswd1CV if0w== X-Gm-Message-State: AOAM533xJ1sgw+ppG2+E50yN1+NMIf+zW6oBAJs1dM4GgiWvB1FBXKIk CupE4Cye50knOXwF2ocdRyShExuJugKyqOupmn0= X-Google-Smtp-Source: ABdhPJwd/jJTmngJQbRLgrD7b3NtqlX0nz8W3LeXEElbgOuXQjFSGEYkEiA2nF2Pl50oj2AfiiWqF0rPQqIDZYbFA9Q= X-Received: by 2002:a17:906:8058:: with SMTP id x24mr24779100ejw.272.1605710469034; Wed, 18 Nov 2020 06:41:09 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 18 Nov 2020 06:41:08 -0800 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Wed, 18 Nov 2020 06:41:08 -0800 Message-ID: Subject: Re: bug#44676: [PATCH] Support native compilation of packages on install To: Andrea Corallo Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Hi Andrea, Andrea Corallo writes: > Late load assume the current bytecode is already loaded when the native > load will happen. This because late load is designed to be issued when > some bytecode file is loaded and no native code alternative is found. Thanks, I had trouble figuring out what this parameter meant. Maybe we could improve its documentation. BTW, what is the purpose of the LOAD parameter here? Is it just a convenience feature to allow a user to load the file after compiling? I'm asking because that option was recently made obsolete for `byte-compile-file'. > We should probably issue the async compilation here without late load > and in case the bytecode is being loaded before native compilation was > done just patch the kind of load stored into `comp-files-queue'. ATM if > the stored load property and new one are not matching we complain (See > comp.el:3528). > > So yeah non 100% straight forward :) So when loading a byte-compiled file, Fload should check if there exists an entry for this file in `comp-files-queue', and if there is one, change its load property to `lazy'? Do I understand you correctly? Sorry if I'm not very clear, I'm still trying to understand all this. > That said I think we should have a customize to decided if we want > package to eager command native compilation. > > I may never used some of the installed files and prefer the current > solution for that, or maybe I may just like to have the compilation > happening in a more diluted fashion and on demand (my personal taste). OK, I'll add such an option. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 18 11:05:26 2020 Received: (at 44676) by debbugs.gnu.org; 18 Nov 2020 16:05:26 +0000 Received: from localhost ([127.0.0.1]:36184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfPxW-0008GK-Cf for submit@debbugs.gnu.org; Wed, 18 Nov 2020 11:05:26 -0500 Received: from mx.sdf.org ([205.166.94.24]:59827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfPxT-0008G8-2e for 44676@debbugs.gnu.org; Wed, 18 Nov 2020 11:05:25 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AIG5Jb8008816; Wed, 18 Nov 2020 16:05:19 GMT From: Andrea Corallo To: Stefan Kangas Subject: Re: bug#44676: [PATCH] Support native compilation of packages on install References: Date: Wed, 18 Nov 2020 16:05:19 +0000 In-Reply-To: (Stefan Kangas's message of "Wed, 18 Nov 2020 06:41:08 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > Hi Andrea, > > Andrea Corallo writes: > >> Late load assume the current bytecode is already loaded when the native >> load will happen. This because late load is designed to be issued when >> some bytecode file is loaded and no native code alternative is found. > > Thanks, I had trouble figuring out what this parameter meant. Maybe we > could improve its documentation. Absolutley. > BTW, what is the purpose of the LOAD parameter here? Is it just a > convenience feature to allow a user to load the file after compiling? > I'm asking because that option was recently made obsolete for > `byte-compile-file'. The main purpose of that parameter is to serve deferred compilation. When we want to replace bytecode function definitions we perform this special kind of load that I called 'late'. During this load instead of executing all top level forms of the original files we execute only function definitions (paying attention to have these effective only if the bytecode definition was not changed in the meanwhile). We should probably make this paramenter private (as for the syncronous variant `native-compile') as should be really for internal use only, WDYT? >> We should probably issue the async compilation here without late load >> and in case the bytecode is being loaded before native compilation was >> done just patch the kind of load stored into `comp-files-queue'. ATM if >> the stored load property and new one are not matching we complain (See >> comp.el:3528). >> >> So yeah non 100% straight forward :) > > So when loading a byte-compiled file, Fload should check if there exists > an entry for this file in `comp-files-queue', and if there is one, > change its load property to `lazy'? Do I understand you correctly? > Sorry if I'm not very clear, I'm still trying to understand all this. I think is simpler, we should from package just issue the compilation without any kind of 'load'. Then around comp.el:3528 instead of complaining in case of a compilation with late load issued on a file with no load property just fixup the missing the late load in `comp-files-queue'. This will cover the case where package ask for the compilation but before is completed the user load the elc and deferred compilation issue another compilation with late load. >> That said I think we should have a customize to decided if we want >> package to eager command native compilation. >> >> I may never used some of the installed files and prefer the current >> solution for that, or maybe I may just like to have the compilation >> happening in a more diluted fashion and on demand (my personal taste). > > OK, I'll add such an option. Great Thanks Andrea From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 19 17:35:02 2020 Received: (at 44676) by debbugs.gnu.org; 19 Nov 2020 22:35:02 +0000 Received: from localhost ([127.0.0.1]:41261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfsW5-0002IE-9P for submit@debbugs.gnu.org; Thu, 19 Nov 2020 17:35:02 -0500 Received: from mail-ed1-f45.google.com ([209.85.208.45]:38034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfsW3-0002Hy-CY for 44676@debbugs.gnu.org; Thu, 19 Nov 2020 17:35:00 -0500 Received: by mail-ed1-f45.google.com with SMTP id y4so7535864edy.5 for <44676@debbugs.gnu.org>; Thu, 19 Nov 2020 14:34:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=nE7UkUP8I4/bo6DoeUPHPQHOk0uPFE8ZQlLfHWBsFfU=; b=FVtOQd0STRuuVEip6S/Wk0Mm2h+95BIaZaOKfNrDYQgdjUMTEUXTKGLs6Myha9JDaG UrpHBU2gMeH33FZ6VxZB9CSXjYhg1hA3V+V7tC+9J2oplSW5oO7tYlXeLYlUr8qAPEiD UfJgB2EnzZ9U74nmhT+tKgHh7xg8wNNazemsDvi5s2H91tAigsRri5Gp84STU5HzBD7g 9QDwc1tUgeVrW7Ovnxf6Dw4eoXUhohsfFbI+2Yxm+IlTneNA1On69n4o7oJ/bw42Rcn5 tsrfIlFfif7IVXHqlyv9fnLxcyFVNuoNqenzqr1lOymetOrrbcRVs1FGchDx14hWKuDy f1Wg== X-Gm-Message-State: AOAM5309/OMlVm8Iw56A0+TCgGtPcUfesKLdGyhEzq2CUyJyU75rhdBc JLV3Nk0OEws3hVavDEHg9aih469eqMOf5QuQDwQ= X-Google-Smtp-Source: ABdhPJxIr+U0k1Tuzoff1zA1j7pYuC/Oi8BnThfs9AXbxqthSEqibWRnFE/3Nbv8uzPYp0bQe5FzcIX8/H6b57VwBx0= X-Received: by 2002:a05:6402:3089:: with SMTP id de9mr33684250edb.100.1605825293583; Thu, 19 Nov 2020 14:34:53 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 19 Nov 2020 14:34:52 -0800 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Thu, 19 Nov 2020 14:34:52 -0800 Message-ID: Subject: Re: bug#44676: [PATCH] Support native compilation of packages on install To: Andrea Corallo Content-Type: multipart/mixed; boundary="00000000000032384105b47d565b" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --00000000000032384105b47d565b Content-Type: text/plain; charset="UTF-8" Andrea Corallo writes: >> BTW, what is the purpose of the LOAD parameter here? > > The main purpose of that parameter is to serve deferred compilation. Thanks for the explanation, that clarifies things. This gets me thinking, could we change the LOAD parameter to be called LATE instead with valid values nil or non-nil? Or is there a specific reason why one would want to use LOAD set to t instead of just, say: (native-compile-async "foo.el") (load "foo.el") Maybe the above example is a bit contrived, but I'm mostly trying to understand if we have an opportunity to simplify the interface. Oh, and come to think of it, could we just rename "late" load to something more descriptive (for example "after-bytecode") or would that be tremendously ugly? :-) > I think is simpler, we should from package just issue the compilation > without any kind of 'load'. Then around comp.el:3528 instead of > complaining in case of a compilation with late load issued on a file > with no load property just fixup the missing the late load in > `comp-files-queue'. > > This will cover the case where package ask for the compilation but > before is completed the user load the elc and deferred compilation issue > another compilation with late load. OK, thanks. Please see my patches below. > When we want to replace bytecode function definitions we perform this > special kind of load that I called 'late'. During this load instead of > executing all top level forms of the original files we execute only > function definitions (paying attention to have these effective only if > the bytecode definition was not changed in the meanwhile). > > We should probably make this paramenter private (as for the syncronous > variant `native-compile') as should be really for internal use only, > WDYT? Yes, that sounds very reasonable. See the fourth patch below. --00000000000032384105b47d565b Content-Type: text/x-diff; charset="US-ASCII"; name="0001-compile-async-Don-t-error-out-if-late-loading-after-.patch" Content-Disposition: attachment; filename="0001-compile-async-Don-t-error-out-if-late-loading-after-.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 2b2a29a3ba965244_0.1 RnJvbSA1YzdlNDE0Zjk5OTYyYTllMTQ4MWExMzExZmE5NjdmM2M3ZGY0YjY5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5AbWFyeGlzdC5zZT4KRGF0 ZTogVGh1LCAxOSBOb3YgMjAyMCAyMjoxMDoyMCArMDEwMApTdWJqZWN0OiBbUEFUQ0ggMS80XSBj b21waWxlLWFzeW5jOiBEb24ndCBlcnJvciBvdXQgaWYgbGF0ZSBsb2FkaW5nIGFmdGVyCiBub3Jt YWwgbG9hZAoKKiBsaXNwL2VtYWNzLWxpc3AvY29tcC5lbCAobmF0aXZlLWNvbXBpbGUtYXN5bmMp OiBVcGRhdGUKY29tcC1maWxlcy1xdWV1ZSB3aGVuIGFuIGV4cGxpY2l0IGxhdGUgbG9hZCBpcyBz cGVjaWZpZWQuICAoQnVnIzQ0Njc2KQotLS0KIGxpc3AvZW1hY3MtbGlzcC9jb21wLmVsIHwgMTQg KysrKysrLS0tLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA2IGluc2VydGlvbnMoKyksIDggZGVsZXRp b25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9lbWFjcy1saXNwL2NvbXAuZWwgYi9saXNwL2VtYWNz LWxpc3AvY29tcC5lbAppbmRleCBjYzU5MjJjNjFjLi5hOWEwNzUzNWE0IDEwMDY0NAotLS0gYS9s aXNwL2VtYWNzLWxpc3AvY29tcC5lbAorKysgYi9saXNwL2VtYWNzLWxpc3AvY29tcC5lbApAQCAt MzUxMS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GxvYWQgKGNkciBlbnRyeSkpKQor ICAgICAgICAgICAgKGNsLXN1YnN0aXR1dGUgKGNvbnMgZmlsZSBsb2FkKSAoY2FyIGVudHJ5KSBj b21wLWZpbGVzLXF1ZXVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6a2V5ICMnY2FyIDp0 ZXN0ICMnc3RyaW5nPSkpCiAgICAgICAgIDs7IE1ha2Ugc3VyZSB3ZSBhcmUgbm90IGFscmVhZHkg Y29tcGlsaW5nIGBmaWxlJyAoYnVnIzQwODM4KS4KICAgICAgICAgKHVubGVzcyAob3IgKGdldGhh c2ggZmlsZSBjb21wLWFzeW5jLWNvbXBpbGF0aW9ucykKICAgICAgICAgICAgICAgICAgICAgOzsg QWxzbyBleGNsdWRlIGZpbGVzIGZyb20gZGVmZXJyZWQgY29tcGlsYXRpb24gaWYKLS0gCjIuMjku MgoK --00000000000032384105b47d565b Content-Type: text/x-diff; charset="US-ASCII"; name="0002-Support-native-compilation-of-packages-on-install.patch" Content-Disposition: attachment; filename="0002-Support-native-compilation-of-packages-on-install.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 2b2a29a3ba965244_0.2 RnJvbSBjZDI5NjU5MTYxMTlkYzYwZTNkMzQ1N2ZkOTY2NjJkNTYyNDMwZTE2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5AbWFyeGlzdC5zZT4KRGF0 ZTogVGh1LCAxOSBOb3YgMjAyMCAyMjowOTozNyArMDEwMApTdWJqZWN0OiBbUEFUQ0ggMi80XSBT dXBwb3J0IG5hdGl2ZSBjb21waWxhdGlvbiBvZiBwYWNrYWdlcyBvbiBpbnN0YWxsCgoqIGxpc3Av ZW1hY3MtbGlzcC9wYWNrYWdlLmVsIChwYWNrYWdlLXVucGFjaykKKHBhY2thZ2UtLW5hdGl2ZS1j b21waWxlKTogTmF0aXZlIGNvbXBpbGUgcGFja2FnZXMgb24gaW5zdGF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Ug dGhlIGJ5dGUtY29tcGlsZWQgZGVmaW5pdGlvbnMuCiAgICAgICAgIChwYWNrYWdlLS1sb2FkLWZp bGVzLWZvci1hY3RpdmF0aW9uIG5ldy1kZXNjIDpyZWxvYWQpKSkKQEAgLTEwNTIsNiArMTA2MCwx NSBAQCBwYWNrYWdlLS1jb21waWxlCiAgICAgICAgIChsb2FkLXBhdGggbG9hZC1wYXRoKSkKICAg ICAoYnl0ZS1yZWNvbXBpbGUtZGlyZWN0b3J5IChwYWNrYWdlLWRlc2MtZGlyIHBrZy1kZXNjKSAw IHQpKSkKIAorKGRlZnVuIHBhY2thZ2UtLW5hdGl2ZS1jb21waWxlLWFzeW5jIChwa2ctZGVzYykK KyAgIk5hdGl2ZSBjb21waWxlIGluc3RhbGxlZCBwYWNrYWdlIFBLRy1ERVNDIGFzeW5jaHJvbm91 c2x5LgorVGhpcyBhc3N1bWVzIHRoYXQgYHBrZy1kZXNjJyBoYXMgYWxyZWFkeSBiZWVuIGFjdGl2 YXRlZCB3aXRoCitgcGFja2FnZS1hY3RpdmF0ZS0xJy4iCisgICh3aGVuIChhbmQgKGZlYXR1cmVw ICduYXRpdmVjb21wKQorICAgICAgICAgICAgIChuYXRpdmUtY29tcC1hdmFpbGFibGUtcCkpCisg ICAgKGxldCAoKHdhcm5pbmctbWluaW11bS1sZXZlbCA6ZXJyb3IpKQorICAgICAgKG5hdGl2ZS1j b21waWxlLWFzeW5jIChwYWNrYWdlLWRlc2MtZGlyIHBrZy1kZXNjKSB0KSkpKQorCiA7Ozs7IElu ZmVycmluZyBwYWNrYWdlIGZyb20gY3VycmVudCBidWZmZXIKIChkZWZ1biBwYWNrYWdlLXJlYWQt ZnJvbS1zdHJpbmcgKHN0cikKICAgIlJlYWQgYSBMaXNwIGV4cHJlc3Npb24gZnJvbSBTVFIuCi0t IAoyLjI5LjIKCg== --00000000000032384105b47d565b Content-Type: text/x-diff; charset="US-ASCII"; name="0003-lisp-emacs-lisp-comp.el-native-compile-async-Doc-fix.patch" Content-Disposition: attachment; filename="0003-lisp-emacs-lisp-comp.el-native-compile-async-Doc-fix.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 2b2a29a3ba965244_0.3 RnJvbSBiZDU3MGYwM2EzYjNkY2I1NDZiMDJlODNmYWYyNjNmMjdlODJkMDVjIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5AbWFyeGlzdC5zZT4KRGF0 ZTogVGh1LCAxOSBOb3YgMjAyMCAyMjoxMToxNyArMDEwMApTdWJqZWN0OiBbUEFUQ0ggMy80XSAq IGxpc3AvZW1hY3MtbGlzcC9jb21wLmVsIChuYXRpdmUtY29tcGlsZS1hc3luYyk6IERvYwogZml4 LgoKLS0tCiBsaXNwL2VtYWNzLWxpc3AvY29tcC5lbCB8IDI1ICsrKysrKysrKysrKysrKysrKysr LS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCAyMCBpbnNlcnRpb25zKCspLCA1IGRlbGV0aW9ucygtKQoK ZGlmZiAtLWdpdCBhL2xpc3AvZW1hY3MtbGlzcC9jb21wLmVsIGIvbGlzcC9lbWFjcy1saXNwL2Nv bXAuZWwKaW5kZXggYTlhMDc1MzVhNC4uZTQ4YTFjZmMxOCAxMDA2NDQKLS0tIGEvbGlzcC9lbWFj cy1saXNwL2NvbXAuZWwKKysrIGIvbGlzcC9lbWFjcy1saXNwL2NvbXAuZWwKQEAgLTM0ODksMTMg KzM0ODksMjggQEAgYmF0Y2gtYnl0ZS1uYXRpdmUtY29tcGlsZS1mb3ItYm9vdHN0cmFwCiAoZGVm dW4gbmF0aXZlLWNvbXBpbGUtYXN5bmMgKHBhdGhzICZvcHRpb25hbCByZWN1cnNpdmVseSBsb2Fk KQogICAiQ29tcGlsZSBQQVRIUyBhc3luY2hyb25vdXNseS4KIFBBVEhTIGlzIG9uZSBwYXRoIG9y IGEgbGlzdCBvZiBwYXRocyB0byBmaWxlcyBvciBkaXJ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vZiB0aGUgb3JpZ2luYWwgZmlsZXMsIG9ubHkgZnVuY3Rp b24gZGVmaW5pdGlvbnMgYXJlCitsb2FkZWQgKHBheWluZyBhdHRlbnRpb24gdG8gaGF2ZSB0aGVz ZSBlZmZlY3RpdmUgb25seSBpZiB0aGUKK2J5dGVjb2RlIGRlZmluaXRpb24gd2FzIG5vdCBjaGFu Z2VkIGluIHRoZSBtZWFud2hpbGUpLiIKICAgKGNvbXAtZW5zdXJlLW5hdGl2ZS1jb21waWxlcikK ICAgKHVubGVzcyAobWVtYmVyIGxvYWQgJyhuaWwgdCBsYXRlKSkKLSAgICAoZXJyb3IgIkxPQUQg bXVzdCBiZSBuaWwgdCBvciAnbGF0ZSIpKQorICAgIChlcnJvciAiTE9BRCBtdXN0IGJlIG5pbCwg dCBvciAnbGF0ZSIpKQogICAodW5sZXNzIChsaXN0cCBwYXRocykKICAgICAoc2V0ZiBwYXRocyAo bGlzdCBwYXRocykpKQogICAobGV0IChmaWxlcykKLS0gCjIuMjkuMgoK --00000000000032384105b47d565b Content-Type: text/x-diff; charset="US-ASCII"; name="0004-Make-load-argument-of-native-compile-async-internal.patch" Content-Disposition: attachment; filename="0004-Make-load-argument-of-native-compile-async-internal.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 2b2a29a3ba965244_0.4 RnJvbSAzZDc0MjdmZjU5ZTkwMTg3MmZlN2YzNGQxYzI4Zjc3ZTQ4ZDg2YzAzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5AbWFyeGlzdC5zZT4KRGF0 ZTogVGh1LCAxOSBOb3YgMjAyMCAyMjoxODo1MCArMDEwMApTdWJqZWN0OiBbUEFUQ0ggNC80XSBN YWtlIGxvYWQgYXJndW1lbnQgb2YgbmF0aXZlLWNvbXBpbGUtYXN5bmMgaW50ZXJuYWwKCiogbGlz cC9lbWFjcy1saXNwL2NvbXAuZWwgKG5hdGl2ZS0tY29tc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nov 20 03:45:50 2020 Received: (at 44676) by debbugs.gnu.org; 20 Nov 2020 08:45:50 +0000 Received: from localhost ([127.0.0.1]:41920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kg23B-0002bE-Ml for submit@debbugs.gnu.org; Fri, 20 Nov 2020 03:45:50 -0500 Received: from mx.sdf.org ([205.166.94.24]:52793) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kg23A-0002b5-2z for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 03:45:48 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AK8jkjj017371; Fri, 20 Nov 2020 08:45:46 GMT From: Andrea Corallo To: Stefan Kangas Subject: Re: bug#44676: [PATCH] Support native compilation of packages on install References: Date: Fri, 20 Nov 2020 08:45:46 +0000 In-Reply-To: (Stefan Kangas's message of "Thu, 19 Nov 2020 14:34:52 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > Andrea Corallo writes: > >>> BTW, what is the purpose of the LOAD parameter here? >> >> The main purpose of that parameter is to serve deferred compilation. > > Thanks for the explanation, that clarifies things. > > This gets me thinking, could we change the LOAD parameter to be called > LATE instead with valid values nil or non-nil? Or is there a specific > reason why one would want to use LOAD set to t instead of just, say: That depends if we want to remove the normal load as an option. > (native-compile-async "foo.el") > (load "foo.el") The issue is that this does a different thing, if foo.el was never byte compiled you will endup with only the non compiled (nor byte or native) definitions as the load happes before the async compilation has finished. I understand and share your motivation of simplifying the interface, OTOH I think for the user might be handy to say compile and load when finished without having to rely on the comp-async hooks. > Maybe the above example is a bit contrived, but I'm mostly trying to > understand if we have an opportunity to simplify the interface. > > Oh, and come to think of it, could we just rename "late" load to > something more descriptive (for example "after-bytecode") or would that > be tremendously ugly? :-) I'd prefer to keep it as late. Late load is a mechanism that is not strictly related to bytecode (even if now we issue it in relation to that) and in the code is referred as late-load in multiple palces I believe. Also late is shorter than after-bytecode :) >> I think is simpler, we should from package just issue the compilation >> without any kind of 'load'. Then around comp.el:3528 instead of >> complaining in case of a compilation with late load issued on a file >> with no load property just fixup the missing the late load in >> `comp-files-queue'. >> >> This will cover the case where package ask for the compilation but >> before is completed the user load the elc and deferred compilation issue >> another compilation with late load. > > OK, thanks. Please see my patches below. > >> When we want to replace bytecode function definitions we perform this >> special kind of load that I called 'late'. During this load instead of >> executing all top level forms of the original files we execute only >> function definitions (paying attention to have these effective only if >> the bytecode definition was not changed in the meanwhile). >> >> We should probably make this paramenter private (as for the syncronous >> variant `native-compile') as should be really for internal use only, >> WDYT? > > Yes, that sounds very reasonable. See the fourth patch below. > Following up with patch comments. Thanks Andrea From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 20 03:56:01 2020 Received: (at 44676) by debbugs.gnu.org; 20 Nov 2020 08:56:01 +0000 Received: from localhost ([127.0.0.1]:42023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kg2D3-0002tM-FA for submit@debbugs.gnu.org; Fri, 20 Nov 2020 03:56:01 -0500 Received: from mx.sdf.org ([205.166.94.24]:52166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kg2D1-0002tC-O2 for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 03:56:00 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AK8tw53009957; Fri, 20 Nov 2020 08:55:58 GMT From: Andrea Corallo To: Stefan Kangas Subject: Re: bug#44676: [PATCH 1/4] Support native compilation of packages on install References: Date: Fri, 20 Nov 2020 08:55:58 +0000 In-Reply-To: (Stefan Kangas's message of "Thu, 19 Nov 2020 14:34:52 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > From 5c7e414f99962a9e1481a1311fa967f3c7df4b69 Mon Sep 17 00:00:00 2001 > From: Stefan Kangas > Date: Thu, 19 Nov 2020 22:10:20 +0100 > Subject: [PATCH 1/4] compile-async: Don't error out if late loading after > normal load > > * lisp/emacs-lisp/comp.el (native-compile-async): Update > comp-files-queue when an explicit late load is specified. (Bug#44676) > --- > lisp/emacs-lisp/comp.el | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el > index cc5922c61c..a9a07535a4 100644 > --- a/lisp/emacs-lisp/comp.el > +++ b/lisp/emacs-lisp/comp.el > @@ -3511,14 +3511,12 @@ native-compile-async > (list "Path not a file nor directory" path))))) > (dolist (file files) > (if-let ((entry (cl-find file comp-files-queue :key #'car :test #'string=))) > - ;; When no load is specified (plain async compilation) we > - ;; consider valid the one previously queued, otherwise we > - ;; check for coherence (bug#40602). > - (cl-assert (or (null load) > - (eq load (cdr entry))) > - nil "Trying to queue %s with LOAD %s but this is already \ > -queued with LOAD %" > - file load (cdr entry)) > + ;; Most likely the byte-compiler has requested a late load, I'd mention "deferred compilation" in place of "byte-compiler" as I believe is more accurate. This is the mechanism that triggers it and also the customize that controls it. > + ;; so update `comp-files-queue' to reflect that. > + (unless (or (null load) > + (eq load (cdr entry))) > + (cl-substitute (cons file load) (car entry) comp-files-queue > + :key #'car :test #'string=)) > ;; Make sure we are not already compiling `file' (bug#40838). > (unless (or (gethash file comp-async-compilations) > ;; Also exclude files from deferred compilation if > -- > 2.29.2 LGTM, okay with that nit. Thanks Andrea From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 20 04:03:09 2020 Received: (at 44676) by debbugs.gnu.org; 20 Nov 2020 09:03:09 +0000 Received: from localhost ([127.0.0.1]:42035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kg2Jx-00034y-73 for submit@debbugs.gnu.org; Fri, 20 Nov 2020 04:03:09 -0500 Received: from mx.sdf.org ([205.166.94.24]:51680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kg2Jt-00034o-SH for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 04:03:08 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AK933J1025180; Fri, 20 Nov 2020 09:03:04 GMT From: Andrea Corallo To: Stefan Kangas Subject: Re: bug#44676: [PATCH 2/4] Support native compilation of packages on install References: Date: Fri, 20 Nov 2020 09:03:03 +0000 In-Reply-To: (Stefan Kangas's message of "Thu, 19 Nov 2020 14:34:52 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > From cd2965916119dc60e3d3457fd96662d562430e16 Mon Sep 17 00:00:00 2001 > From: Stefan Kangas > 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 20 04:06:26 2020 Received: (at 44676) by debbugs.gnu.org; 20 Nov 2020 09:06:26 +0000 Received: from localhost ([127.0.0.1]:42041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kg2N7-00039n-O5 for submit@debbugs.gnu.org; Fri, 20 Nov 2020 04:06:25 -0500 Received: from mx.sdf.org ([205.166.94.24]:51388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kg2N6-00039f-1q for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 04:06:24 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AK96NYl024756; Fri, 20 Nov 2020 09:06:23 GMT From: Andrea Corallo To: Stefan Kangas Subject: Re: bug#44676: [PATCH 3/4] Support native compilation of packages on install References: Date: Fri, 20 Nov 2020 09:06:23 +0000 In-Reply-To: (Stefan Kangas's message of "Thu, 19 Nov 2020 14:34:52 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > From bd570f03a3b3dcb546b02e83faf263f27e82d05c Mon Sep 17 00:00:00 2001 > From: Stefan Kangas > Date: Thu, 19 Nov 2020 22:11:17 +0100 > Subject: [PATCH 3/4] * lisp/emacs-lisp/comp.el (native-compile-async): Doc > fix. > > --- > lisp/emacs-lisp/comp.el | 25 ++++++++++++++++++++----- > 1 file changed, 20 insertions(+), 5 deletions(-) > > diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el > index a9a07535a4..e48a1cfc18 100644 > --- a/lisp/emacs-lisp/comp.el > +++ b/lisp/emacs-lisp/comp.el > @@ -3489,13 +3489,28 @@ batch-byte-native-compile-for-bootstrap > (defun native-compile-async (paths &optional recursively load) > "Compile PATHS asynchronously. > PATHS is one path or a list of paths to files or directories. > -`comp-async-jobs-number' specifies the number of (commands) to > -run simultaneously. If RECURSIVELY, recurse into subdirectories > -of given directories. > -LOAD can be nil t or 'late." > + > +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. > + > +LOAD can also be the symbol `late'. This is used internally if > +the byte code has already been loaded when this function is > +called. It means that we requests the special kind of load, > +necessary in that situation, called \"late\" loading. > + > +During a \"late\" load instead of executing all top level forms > +of the original files, only function definitions are > +loaded (paying attention to have these effective only if the > +bytecode definition was not changed in the meanwhile)." > (comp-ensure-native-compiler) > (unless (member load '(nil t late)) > - (error "LOAD must be nil t or 'late")) > + (error "LOAD must be nil, t or 'late")) > (unless (listp paths) > (setf paths (list paths))) > (let (files) LGTM thanks for the nice clean-up From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 20 15:03:34 2020 Received: (at 44676) by debbugs.gnu.org; 20 Nov 2020 20:03:34 +0000 Received: from localhost ([127.0.0.1]:44329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgCd4-0004x9-4t for submit@debbugs.gnu.org; Fri, 20 Nov 2020 15:03:34 -0500 Received: from mail-ej1-f43.google.com ([209.85.218.43]:44862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgCd1-0004ww-Be for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 15:03:32 -0500 Received: by mail-ej1-f43.google.com with SMTP id y17so14511103ejh.11 for <44676@debbugs.gnu.org>; Fri, 20 Nov 2020 12:03:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=k2Boy+bRwJuUsmAtNu5sadxXNlZcbJqPct6ahbWZ3Zg=; b=KqK6ykC+vbzlYxeyFhM5/IF34trY8iQc0pTIKBN9WzH8rCAaiTVoGSV737K9GgLY85 Jdt+WR7xZ7X2m20Dxc1BMu56n3WfCRlgL1+PkKekslTUK1ETJ8+ArECOF9MJo9b1GOcI aObv3V1dwRMJNGyV6nmhJsb3iyZHJf7RCLXXh2UXbxk5FhQUpTlFSbr1wRIuOFNz88PQ oWDVkl3likdli5OwRFiH872OmzJ5rOJssKID+SzmuFjCgI33fjT4xpyYJpJCsUBeYaNS 09ngwtTrfVlW7B1LClD0rahbFn3sNS+c8ActwHYSHhXuL9kCi2J5uccc5k56284yPhE5 01Iw== X-Gm-Message-State: AOAM530Se5PqMTiaI3Q6fijH3bJK4GUixLInLGEKv9gVKtbfmNKOOpyD d5TmzIbzCuYaVg6ZUDAJwheKA9QVLqcJYOoji/Y= X-Google-Smtp-Source: ABdhPJyoEQ73GfXh0PzruaaHjbVtoVlloggSYXABmaImSQpqshRGhZiLXpvsb4NpmqmE0Xe9irQhU8kTHWgIbq1PybA= X-Received: by 2002:a17:906:11d0:: with SMTP id o16mr9675915eja.25.1605902605552; Fri, 20 Nov 2020 12:03:25 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 20 Nov 2020 12:03:24 -0800 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Fri, 20 Nov 2020 12:03:24 -0800 Message-ID: Subject: Re: bug#44676: [PATCH] Support native compilation of packages on install To: Andrea Corallo Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Andrea Corallo writes: >> (native-compile-async "foo.el") >> (load "foo.el") > > The issue is that this does a different thing, if foo.el was never byte > compiled you will endup with only the non compiled (nor byte or native) > definitions as the load happes before the async compilation has finished. So the eln wouldn't be loaded once it is done compiling, unless you specify the explicit LOAD parameter? If this is the case, I think I agree with you that we should definitely keep the LOAD parameter. 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. > I'd prefer to keep it as late. Late load is a mechanism that is not > strictly related to bytecode (even if now we issue it in relation to > that) and in the code is referred as late-load in multiple palces I > believe. Also late is shorter than after-bytecode :) OK, sounds good to me. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 20 15:07:50 2020 Received: (at 44676) by debbugs.gnu.org; 20 Nov 2020 20:07:50 +0000 Received: from localhost ([127.0.0.1]:44339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgChC-00053m-5n for submit@debbugs.gnu.org; Fri, 20 Nov 2020 15:07:50 -0500 Received: from mail-ej1-f49.google.com ([209.85.218.49]:37321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgChA-00053Z-7W for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 15:07:48 -0500 Received: by mail-ej1-f49.google.com with SMTP id f20so14558089ejz.4 for <44676@debbugs.gnu.org>; Fri, 20 Nov 2020 12:07:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=0m0UtrFDIEtymYnUOUuNQ1j07xYxyvRR3KtOb2np7o0=; b=tAZ20QX/MImrh+KuQC/oFjI6QSFqvi251/mrCray7KmCdu0hW/sHyLMAvzoZFHSl7V 0qYK7uT++D2nE8qJd/96WGa4tRtvJl+6ZsBTirHqtXswvnseKylmINZjK4ZYVuuoIBCl kgPr8NNoFT+YdaCAYsFAn+QpMeKbkkmUMUxeN9EAUjhwe2xYyV1VGxWP0Ac2Z0GA9DwD tU5pqIrsMEa5V+b99yM8hK9y37nVULFjNHOMm5r3hefykvfcr1kaV7SSbl5OsnppUjxQ kVMGAQ5YhQTKftA3YbmOihrCdaKdXAHgxD0J6UaCTOA7ltkfUv+HQTnMFTAMqrL96+1e MDLA== X-Gm-Message-State: AOAM531o7pV134mPEKGwrlotVJ7x4wcDMGRAynAgliVPKCpkYNU/Jzya /nO7VuFaQgDubm8Rs+Mx1HwTkXOLGMaP+wVNmWcdX342 X-Google-Smtp-Source: ABdhPJwLf4MeI4K2ZDkZGIqBqY5E61L0sBvheGR13mR4hRpoNOnIvxv7LKhQMFDtH89ZQRFI60y+wmT6UgqR9BmCyj8= X-Received: by 2002:a17:906:8058:: with SMTP id x24mr35322222ejw.272.1605902862655; Fri, 20 Nov 2020 12:07:42 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 20 Nov 2020 12:07:42 -0800 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Fri, 20 Nov 2020 12:07:42 -0800 Message-ID: Subject: Re: bug#44676: [PATCH 2/4] Support native compilation of packages on install To: Andrea Corallo Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Andrea Corallo writes: >> +(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? I don't have a strong opinion. Since I recompile Emacs frequently, I would likely want to set this to nil, but I assume most users would just use whatever comes with their distro. So perhaps a t value makes more sense for most users. That said, I'm happy with introducing the variable set to a nil value. We have time to change it later when we can think about it some more, and get experience with it. So I'll change it as you suggest (and update the NEWS entry accordingly). > Otherwise LGTM Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 20 15:13:00 2020 Received: (at 44676) by debbugs.gnu.org; 20 Nov 2020 20:13:00 +0000 Received: from localhost ([127.0.0.1]:44348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgCmC-0005CO-7V for submit@debbugs.gnu.org; Fri, 20 Nov 2020 15:13:00 -0500 Received: from mx.sdf.org ([205.166.94.24]:52465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgCmA-0005CF-2u for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 15:12:58 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AKKCuxm011380; Fri, 20 Nov 2020 20:12:56 GMT From: Andrea Corallo To: Stefan Kangas Subject: Re: bug#44676: [PATCH] Support native compilation of packages on install References: Date: Fri, 20 Nov 2020 20:12:56 +0000 In-Reply-To: (Stefan Kangas's message of "Fri, 20 Nov 2020 12:03:24 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > Andrea Corallo writes: > >>> (native-compile-async "foo.el") >>> (load "foo.el") >> >> The issue is that this does a different thing, if foo.el was never byte >> compiled you will endup with only the non compiled (nor byte or native) >> definitions as the load happes before the async compilation has finished. > > So the eln wouldn't be loaded once it is done compiling, unless you > specify the explicit LOAD parameter? Correct, either you or deferred compilation has to call async-native-compile specifying the load. > If this is the case, I think I > agree with you that we should definitely keep the LOAD parameter. > > 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. Thanks Andrea From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 20 15:16:07 2020 Received: (at 44676) by debbugs.gnu.org; 20 Nov 2020 20:16:07 +0000 Received: from localhost ([127.0.0.1]:44354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgCpC-0005Hu-Np for submit@debbugs.gnu.org; Fri, 20 Nov 2020 15:16:06 -0500 Received: from mx.sdf.org ([205.166.94.24]:52193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgCpB-0005Hn-6w for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 15:16:06 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AKKG49S029741; Fri, 20 Nov 2020 20:16:04 GMT From: Andrea Corallo To: Stefan Kangas Subject: Re: bug#44676: [PATCH 2/4] Support native compilation of packages on install References: Date: Fri, 20 Nov 2020 20:16:04 +0000 In-Reply-To: (Stefan Kangas's message of "Fri, 20 Nov 2020 12:07:42 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > Andrea Corallo writes: > >>> +(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? > > I don't have a strong opinion. > > Since I recompile Emacs frequently, I would likely want to set this to > nil, but I assume most users would just use whatever comes with their > distro. So perhaps a t value makes more sense for most users. > > That said, I'm happy with introducing the variable set to a nil value. > We have time to change it later when we can think about it some more, > and get experience with it. So I'll change it as you suggest (and > update the NEWS entry accordingly). My suggestion is to start with nil for coherency, we can always change the default later if we feel. Andrea From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 20 16:10:55 2020 Received: (at 44676) by debbugs.gnu.org; 20 Nov 2020 21:10:55 +0000 Received: from localhost ([127.0.0.1]:44396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgDgF-0006cC-E7 for submit@debbugs.gnu.org; Fri, 20 Nov 2020 16:10:55 -0500 Received: from mail-ed1-f50.google.com ([209.85.208.50]:43945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgDgB-0006bw-5d for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 16:10:53 -0500 Received: by mail-ed1-f50.google.com with SMTP id q16so10915170edv.10 for <44676@debbugs.gnu.org>; Fri, 20 Nov 2020 13:10:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=3wxaMULTzTpS3rvZ/ClHYCSUyN68r9RabKq+3FwBRGk=; b=EJdr3JNolOfvIRAv3BR4PO+iphE6HVDPboCOYoiNs9ydBQmUAeaJZ0JCiYHuk0ik3A XbVHL4enzVJQRHy1RStwoml0CP6CxRiXux6jnHbOGXqcmTGqHnE1lyj4f7cxH2uXn63q 57wpDp6br8FOk22njxOtAiahaG/lLVI0cGu813kaLCVzVBkoVGEzpLil2o9hTlfQdZE/ Aj9vUgQ1kHX542ypT7o7wJDh/yc1BTPAY450Q7J7gf9Mwio+FcH0RRXlqzpPA+4NckmD OmDsN3rjMDzcLbAJdr4SCELov98FnyxpiC10yQsoLZjuytI3kUSYOtgcoEWO3hqY9Ddc vldg== X-Gm-Message-State: AOAM533JLbjm8RiqZUqmI02QeRJNCBTcTqOyGCaw0XVge9tsBxbx2emV dy5IGi+cSejrcx7rXkIVnyqzllVf/gv/S1qxltY= X-Google-Smtp-Source: ABdhPJxliBH87GjRn06cv4TlJw9Zfku0kNGd2qvDWuLAxycAnOz4CvBF0h2k7CAGKBVrTDoHTvYNtBz7JnYWSuLSt4o= X-Received: by 2002:aa7:d888:: with SMTP id u8mr38157960edq.210.1605906645488; Fri, 20 Nov 2020 13:10:45 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 20 Nov 2020 13:10:44 -0800 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Fri, 20 Nov 2020 13:10:44 -0800 Message-ID: Subject: Re: bug#44676: [PATCH] Support native compilation of packages on install To: Andrea Corallo Content-Type: multipart/mixed; boundary="00000000000025bdad05b4904703" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --00000000000025bdad05b4904703 Content-Type: text/plain; charset="UTF-8" Andrea Corallo 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? --00000000000025bdad05b4904703 Content-Type: text/x-diff; charset="US-ASCII"; name="0004-Make-load-argument-of-native-compile-async-internal.patch" Content-Disposition: attachment; filename="0004-Make-load-argument-of-native-compile-async-internal.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 9c8eab648f79207f_0.1 RnJvbSA2YWMyMDIzMGZhZTJiNzAwZDMwMWNkMzUyMzhiMjgzZjI4N2E2ZTgxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5AbWFyeGlzdC5zZT4KRGF0 ZTogVGh1LCAxOSBOb3YgMjAyMCAyMjoxODo1MCArMDEwMApTdWJqZWN0OiBbUEFUQ0ggNC80XSBN YWtlIGxvYWQgYXJndW1lbnQgb2YgbmF0aXZlLWNvbXBpbGUtYXN5bmMgaW50ZXJuYWwKCiogbGlz cC9lbWFjcy1saXNwL2NvbXAuZWwgKG5hdGl2ZS0tY29tcGlsZS1hc3luYy1pbnRlcm5hbCk6IE5l dwpkZWZ1biBleHRyYWN0ZWQgZnJvbSBuYXRpdmUtY29tcGlsZS1hc3luYy4KKG5hdGl2ZS1jb21w aWxlLWFzeW5jKTogUmVtb3ZlIGxvYWQgYXJndW1lbnQgYW5kIHVzZSBhYm92ZSBuZXcgZGVmd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KaW5kZXggNmRkZmFkNTI4Yi4uODlmOGE0ZjNjZCAxMDA2NDQKLS0t IGEvc3JjL2NvbXAuYworKysgYi9zcmMvY29tcC5jCkBAIC00Njc3LDEzICs0Njc3LDEzIEBAIG1h eWJlX2RlZmVyX25hdGl2ZV9jb21waWxhdGlvbiAoTGlzcF9PYmplY3QgZnVuY3Rpb25fbmFtZSwK ICAgICAgIC8qIENvbXAgYWxyZWFkeSBsb2FkZWQuICAqLwogICAgICAgaWYgKCFOSUxQIChkZWxh eWVkX3NvdXJjZXMpKQogCXsKLQkgIENBTExOIChGZnVuY2FsbCwgaW50ZXJuX2Nfc3RyaW5nICgi bmF0aXZlLWNvbXBpbGUtYXN5bmMiKSwKKwkgIENBTExOIChGZnVuY2FsbCwgaW50ZXJuX2Nfc3Ry aW5nICgibmF0aXZlLS1jb21waWxlLWFzeW5jLWludGVybmFsIiksCiAJCSBkZWxheWVkX3NvdXJj ZXMsIFFuaWwsIFFsYXRlKTsKIAkgIGRlbGF5ZWRfc291cmNlcyA9IFFuaWw7CiAJfQogICAgICAg RnB1dGhhc2ggKGZ1bmN0aW9uX25hbWUsIGRlZmluaXRpb24sIFZjb21wX2RlZmVycmVkX3BlbmRp bmdfaCk7Ci0gICAgICBDQUxMTiAoRmZ1bmNhbGwsIGludGVybl9jX3N0cmluZyAoIm5hdGl2ZS1j b21waWxlLWFzeW5jIiksIHNyYywgUW5pbCwKLQkgICAgIFFsYXRlKTsKKyAgICAgIENBTExOIChG ZnVuY2FsbCwgaW50ZXJuX2Nfc3RyaW5nICgibmF0aXZlLS1jb21waWxlLWFzeW5jLWludGVybmFs IiksCisJICAgICBzcmMsIFFuaWwsIFFsYXRlKTsKICAgICB9CiAgIGVsc2UKICAgICB7Ci0tIAoy LjI5LjIKCg== --00000000000025bdad05b4904703-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 20 17:56:09 2020 Received: (at 44676) by debbugs.gnu.org; 20 Nov 2020 22:56:09 +0000 Received: from localhost ([127.0.0.1]:44480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgFK4-0002oR-OQ for submit@debbugs.gnu.org; Fri, 20 Nov 2020 17:56:09 -0500 Received: from mx.sdf.org ([205.166.94.24]:51094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgFK1-0002oE-En for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 17:56:06 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AKMu2xe006492; Fri, 20 Nov 2020 22:56:03 GMT From: Andrea Corallo To: Stefan Kangas Subject: Re: bug#44676: [PATCH 4/4] Support native compilation of packages on install References: Date: Fri, 20 Nov 2020 22:56:02 +0000 In-Reply-To: (Stefan Kangas's message of "Fri, 20 Nov 2020 13:10:44 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > Andrea Corallo 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? Hi Stefan, > From 6ac20230fae2b700d301cd35238b283f287a6e81 Mon Sep 17 00:00:00 2001 > From: Stefan Kangas > 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) For constistency with `native--compile' and the other functions in the file containing -- I'd go for `native--compile-async' here. > "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))) Nit, for my taste I'd rather use let or &aux, or probably just put `(not (not load))` directly in the following function call. > + (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 > { Sorry for the nit picking. LGTM with these two. Thanks Andrea From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 20 22:26:29 2020 Received: (at 44676) by debbugs.gnu.org; 21 Nov 2020 03:26:29 +0000 Received: from localhost ([127.0.0.1]:44701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgJXh-0005Bl-40 for submit@debbugs.gnu.org; Fri, 20 Nov 2020 22:26:29 -0500 Received: from mail-ej1-f54.google.com ([209.85.218.54]:34479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgJXe-0005BP-Nt for 44676@debbugs.gnu.org; Fri, 20 Nov 2020 22:26:27 -0500 Received: by mail-ej1-f54.google.com with SMTP id o9so15672459ejg.1 for <44676@debbugs.gnu.org>; Fri, 20 Nov 2020 19:26:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=eLQuT/BCo0sbw36ViafZLLPtuW2MZ9FHo6NZ5epUARg=; b=Z6OCCx8Jog+yIMwJ+V8v7BlxnK7ArA1/GKxm/97p95TF4lJDnZy3XNBildY2duMya/ NdAScIk/AH5qF1IRubeX31EOsicTkeyGMTDwmSFuywxYfzOvsxyak5ql+e4x//JvuFz2 1E6jM8ghwRHJ72WkIEr2ITRmEW8kfgWnmh2N/rC3eb2VNdcFwJH4RGna9qxqgpo62Cp6 qn8P7j2WEgWW9xwwQGaWmG4yTmsj534lwDikZNqjWggZpEpBKMz3W0rZN2XemJtDyMU4 97ZlDrdv0FLDb5wkvLwvVYVBYrsGkV3go04h9kcU8OberiVR01khqmmIiI9gODLEN10T ijhQ== X-Gm-Message-State: AOAM531Du9HpH6v5ZtQ6+PRHjiGtKx05YG7n3i/FT2GHk4y//a2Txzds 2dvkM+U3zk6p67RXJc3Ay+ceYk6ZCKY3S89/2/M= X-Google-Smtp-Source: ABdhPJx67XfQ+iHn219PRP+5Us64/S8PSEuaM7FlxJGqOrEFT+1I5ehkME3mV5E4THO0TLFG32dbspkAIqtS7De/oXY= X-Received: by 2002:a17:906:8058:: with SMTP id x24mr36599580ejw.272.1605929180968; Fri, 20 Nov 2020 19:26:20 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 20 Nov 2020 19:26:20 -0800 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Fri, 20 Nov 2020 19:26:20 -0800 Message-ID: Subject: Re: bug#44676: [PATCH 4/4] Support native compilation of packages on install To: Andrea Corallo Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) tags 44676 fixed close 44676 thanks Andrea Corallo writes: > Sorry for the nit picking. LGTM with these two. Your comments are appreciated and welcome. I've now fixed your comments and pushed to feature/native-comp. Closing this bug. Thanks! From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 21 06:38:29 2020 Received: (at 44676) by debbugs.gnu.org; 21 Nov 2020 11:38:29 +0000 Received: from localhost ([127.0.0.1]:45011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgRDp-0004aF-BH for submit@debbugs.gnu.org; Sat, 21 Nov 2020 06:38:29 -0500 Received: from mx.sdf.org ([205.166.94.24]:53440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgRDn-0004a5-Um for 44676@debbugs.gnu.org; Sat, 21 Nov 2020 06:38:28 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0ALBcNPl013563; Sat, 21 Nov 2020 11:38:23 GMT From: Andrea Corallo To: Stefan Kangas Subject: Re: bug#44676: [PATCH 4/4] Support native compilation of packages on install References: Date: Sat, 21 Nov 2020 11:38:23 +0000 In-Reply-To: (Stefan Kangas's message of "Fri, 20 Nov 2020 19:26:20 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44676 Cc: 44676@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Great, thanks Andrea From unknown Tue Sep 09 00:44:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 19 Dec 2020 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator