From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Speeding up the bootstrap build - a quick hack. Date: Wed, 19 Jan 2022 16:50:11 +0000 Message-ID: References: <83pmopunzl.fsf@gnu.org> <83y23cu9bl.fsf@gnu.org> <835yqgt0bf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10509"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 19 17:54:05 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nAEDl-0002Vw-Oi for ged-emacs-devel@m.gmane-mx.org; Wed, 19 Jan 2022 17:54:05 +0100 Original-Received: from localhost ([::1]:44728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAEDk-0000VN-5X for ged-emacs-devel@m.gmane-mx.org; Wed, 19 Jan 2022 11:54:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAEA5-0007XS-FQ for emacs-devel@gnu.org; Wed, 19 Jan 2022 11:50:20 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:10792 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1nAEA2-0006bD-SU for emacs-devel@gnu.org; Wed, 19 Jan 2022 11:50:16 -0500 Original-Received: (qmail 9557 invoked by uid 3782); 19 Jan 2022 16:50:12 -0000 Original-Received: from acm.muc.de (p4fe15af9.dip0.t-ipconnect.de [79.225.90.249]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 19 Jan 2022 17:50:11 +0100 Original-Received: (qmail 20799 invoked by uid 1000); 19 Jan 2022 16:50:11 -0000 Content-Disposition: inline In-Reply-To: <835yqgt0bf.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284994 Archived-At: Hello, Eli. On Wed, Jan 19, 2022 at 13:46:44 +0200, Eli Zaretskii wrote: > > Date: Wed, 19 Jan 2022 11:10:32 +0000 > > Cc: Stefan Monnier , emacs-devel@gnu.org > > From: Alan Mackenzie > > > No, we need two consecutive shell commands under the same target: one > > > with no-native-compile set, the other without it. > > No, this would not work. It is essential to have all seven compile-first > > files byte compiled before we start native compiling any of them. That > > is what halves the time taken for the compile-to-native of comp.el. > The following single command in src/Makefile.in > $(MAKE) -C ../lisp compile-first EMACS="$(bootstrap_exe)" > compiles all of the seven dwarfs in one go, so I'm not sure what you > mean by "would not work". Please elaborate. > > I don't think we can avoid two separate targets for each of these source > > files. > I don't think you understood my proposal, because this reason makes no > sense to me. You're right, I didn't. Maybe I understand it now. The idea is to leave lisp/Makefile.in unchanged, and make all the alterations in src/Makefile.in. The segment of code you cite above builds all of compile-first in one invocation, so there's no need to worry about mixtures of interpreted source and .elc. So, we duplicate that bit of code, setting the Emacs variable no-native-compile on the command line of the first occurrence. This will cause the byte compilation of all of compile-first. After this bit of new code, we use 'touch' to set the date of these new *.elc's back to the distant past. This will ensure that these *.el's get built again in the next step. The second duplicate of the old bit of make code will build the .eln's, using the ("very old") .elc's which are still available inside Emacs. It should do this reasonably quickly, because it is using *.elc's. Yes, I agree that this approach is more elegant and surely easier to maintain than my original hack, if it can be made to work (which it surely can). I will look at this this evening. Thanks for the suggestion. -- Alan Mackenzie (Nuremberg, Germany).