From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: native compilation units Date: Tue, 07 Jun 2022 13:53:57 +0300 Message-ID: <83tu8w7ni2.fsf@gnu.org> References: <83o7z6849m.fsf@gnu.org> <831qw191b0.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37054"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, akrl@sdf.org, emacs-devel@gnu.org To: Lynn Winebarger Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 07 13:31:52 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 1nyXRA-0009Pp-K2 for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Jun 2022 13:31:52 +0200 Original-Received: from localhost ([::1]:44118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyXR9-0002iO-2b for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Jun 2022 07:31:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyWqd-0000se-Ta for emacs-devel@gnu.org; Tue, 07 Jun 2022 06:54:08 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyWqd-0003QX-Fg; Tue, 07 Jun 2022 06:54:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6en6ujplvof7lxPWRWzaNhur5uznGDRtNqaUdL8cXoQ=; b=Mj7wjcsSmhmK KMIf9J76duTca1VlY9Q4YtnHqBj5OeHOroohu6xDA9boWRbsoSPebl72UIPeLFasGIxZ56Kn1aRTw RzDgqndkhX8qDYgcr+uYVzUDBaNOAthT1vm4cfPh5iye6cusJYYP29wvqQQvrwZbUvLsJxJNIGAQ6 grPT/9QXY4Fz0z1VAqffxNGOvj2I7jrptUArxwqDaa+G90XWUq09Fkd4pyFmOPq9fQIlNEVGqtLqR po8zb/6yuq9fmr/ozMmp0KSnuvjMyFuKCAFJY+CVsyVFYArsFvDPQvIXLiRuekz9kXLHGajUlCw7Z gS7JTV1EuUYOjArN7qGQbw==; Original-Received: from [87.69.77.57] (port=3031 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyWqc-00021L-7h; Tue, 07 Jun 2022 06:54:07 -0400 In-Reply-To: (message from Lynn Winebarger on Mon, 6 Jun 2022 22:14:00 -0400) 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:290846 Archived-At: > From: Lynn Winebarger > Date: Mon, 6 Jun 2022 22:14:00 -0400 > Cc: Stefan Monnier , Andrea Corallo , emacs-devel@gnu.org > > > Of course, there is: that function is what is invoked when building a > > release tarball, where the *.elc files are already present. See > > lisp/Makefile.in. > > > > That's what I expected was the case, but the question is whether it "should" > > check for those .elc files and create them only if they do not exist, as opposed > > to batch-byte+native-compile, which creates both unconditionally. Or perhaps > > just note the possible hiccup in the docstring for batch-native-compile? > > You are describing a different function. batch-native-compile was > explicitly written to support the build of a release tarball, where > the *.elc files are always present, and regenerating them is just a > waste of cycles, and also runs the risk of creating a .elc file that > is not fully functional, due to some peculiarity of the platform or > the build environment. > > Ok - I'm not sure why only generating the .elc in the case that it does not already exist is inconsistent with the > restriction you describe. Because this function is for the case where producing *.elc files is not wanted. > Ignoring that, according to https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/comp.el the > signature and docstring are: > > (defun batch-native-compile (&optional for-tarball) "Perform batch native compilation of remaining > command-line arguments. > > Native compilation equivalent of `batch-byte-compile'. > Use this from the command line, with `-batch'; it won't work > in an interactive Emacs session. > Optional argument FOR-TARBALL non-nil means the file being compiled > as part of building the source tarball, in which case the .eln file > will be placed under the native-lisp/ directory (actually, in the > last directory in `native-comp-eln-load-path')." > If the restriction you describe is the intent, why not > (1) make "for-tarball" non-optional and remove that argument, and > (2) put that intent in the documentation so we would know not to use it Because that function could be used in contexts other than building a release tarball, and I see no need to restrict it. And I don't think I understand the use case you want to support. When is it useful to produce *.eln files for all the *.el files, but *.elc files only for those *.el files that were modified or for which *.elc doesn't exist? > > However, since the eln file can be generated without the elc file, it also begs the question > > of why the use of the eln file is conditioned on the existence of the elc file in the > > first place. Are there situations where the eln file would be incorrect to use > > without the byte-compiled file in place? > > Andrea was asked this question several times and explained his design, > you can find it in the archives. Basically, native compilation is > driven by byte compilation, and is a kind of side effect of it. > > I understood that already - the question was why the .elc file, as an artifact, was required to exist in addition > to the .eln file. Where do you see that requirement?