From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#44676: [PATCH] Support native compilation of packages on install Date: Wed, 18 Nov 2020 16:05:19 +0000 Message-ID: References: Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38714"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 44676@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 18 17:06:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfPyD-0009rs-Dm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Nov 2020 17:06:09 +0100 Original-Received: from localhost ([::1]:54964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfPyC-0007s0-FL for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Nov 2020 11:06:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfPy6-0007rh-1L for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2020 11:06:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52871) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfPy5-0000F5-O2 for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2020 11:06:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kfPy5-0008HN-JF for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2020 11:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Nov 2020 16:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44676 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 44676-submit@debbugs.gnu.org id=B44676.160571552631768 (code B ref 44676); Wed, 18 Nov 2020 16:06:01 +0000 Original-Received: (at 44676) by debbugs.gnu.org; 18 Nov 2020 16:05:26 +0000 Original-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 Original-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 Original-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 In-Reply-To: (Stefan Kangas's message of "Wed, 18 Nov 2020 06:41:08 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193627 Archived-At: 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