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.bugs Subject: bug#70246: 30.0.50; Update INSTALL for native compilation Date: Sun, 07 Apr 2024 17:52:13 +0300 Message-ID: <86v84tz0ma.fsf@gnu.org> References: <87plv29pro.fsf@gmx.net> <86il0t1z96.fsf@gnu.org> <87r0fhpf52.fsf@gmx.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1212"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70246@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 07 16:53:10 2024 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 1rtTtN-000AdX-Qm for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Apr 2024 16:53:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtTtB-0002ea-BO; Sun, 07 Apr 2024 10:52:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtTtA-0002eR-8q for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2024 10:52:56 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rtTt9-00060X-Vu for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2024 10:52:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rtTtG-0001Uu-PK for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2024 10:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Apr 2024 14:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70246 X-GNU-PR-Package: emacs Original-Received: via spool by 70246-submit@debbugs.gnu.org id=B70246.17125015555603 (code B ref 70246); Sun, 07 Apr 2024 14:53:02 +0000 Original-Received: (at 70246) by debbugs.gnu.org; 7 Apr 2024 14:52:35 +0000 Original-Received: from localhost ([127.0.0.1]:44311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtTsl-0001Rn-Re for submit@debbugs.gnu.org; Sun, 07 Apr 2024 10:52:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtTsk-0001RP-8L for 70246@debbugs.gnu.org; Sun, 07 Apr 2024 10:52:30 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtTsX-0005tT-Rd; Sun, 07 Apr 2024 10:52:17 -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=2DwJkEPKUTfUdl0tpxcBYkAzWuhdHq0vPMaB/s/SC0Y=; b=bBnAsVEKx6tk g60MiYY2mLP5gH4bg/ync/lMcOZsWvN+RA2crv1KFTwMUF7HU7HRoeLu7T6xTVN0Ti9nN7N6chta/ 2YSee7MD28joX+4MmJCBqk4h1221K32gnp1OQFCEmK/OwYCjNDxX1x4UJtDRZtARQzTz+Z0XUhh3k +fD4oTrHAt21kCBSGkugnzWul8NX2G2utGYP5q1BdwfNm3O9xkVyGIY4LEWXHDwiCxUrp/I3yO6+0 RAACbEqnox8a6f/ghehvDZkd5wJxtsOxz39KWpdtjZWvcc64ZvWDp4/Fi/okJL9I1WbXGVJqHtyYN VEB1hTLH642y+PMKhno+pw==; In-Reply-To: <87r0fhpf52.fsf@gmx.net> (message from Stephen Berman on Sun, 07 Apr 2024 13:48:41 +0200) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282874 Archived-At: > From: Stephen Berman > Cc: 70246@debbugs.gnu.org > Date: Sun, 07 Apr 2024 13:48:41 +0200 > > On Sun, 07 Apr 2024 09:08:05 +0300 Eli Zaretskii wrote: > > > Thanks. This LGTM, except the changes to item 6: there, I would only > > mention the possibility of building out of the source tree. Whether > > running uninstalled is possible in this case depends where is the > > build tree relative to the source tree, so I'd rather not describe all > > the gory details there because they are too complex to explain (what > > you wrote is inaccurate); > > There was a mistake at the end of 6b; what I meant to write is "but the > ../lib-src and ../native-lisp directories in the build directory > (because the compiled files in these directories are > machine-dependent)." If there were any other inaccuracies in what I > wrote, can you please point them out to me (for my own edification)? See below. > > I'd just say that running uninstalled is > > fully supported only when Emacs is built in the source tree. > > So instead of having 6{a,b,c} as in my patch, are the following > additions to the current version (at the end of the first paragraph of > 6) ok? > > ======================================================================= > , ../native-lisp (if built with support for native compilation). > > If you build Emacs in a directory separate from the source directory > ("out-of-tree"), run 'make' in the build directory. Then you can > execute the 'src/emacs' file under that directory "in place". However, > running Emacs uninstalled is fully supported only when it is built in > the source tree. > ======================================================================= Yes, but see below. > But, again for my own edification, can you elaborate what "fully > supported" means here? It means that (a) Emacs will find all the files it needs for running, which includes programs and files in lib-src/, Lisp *.el/*.elc/*.eln files, Info files, and files in the etc/ subdirectory in the tree from which it is run; and (b) when any of the source files are edited and Emacs is rebuilt, the next invocation will use the updated files, including recompiling the *.eln files as needed. > I've been running Emacs uninstalled from a build > directory outside of the source tree for many years, and that statement > suggests my builds are deficient (though perhaps only in unobvious ways > that are not crucial for using Emacs), and if so, I'd like to know how > and why. What Emacs does at startup to decide where its files are installed is complex and hard to explain without describing the entire algorithm (which is both inappropriate for INSTALL and subject to change without notice). If you are interested, look in emacs.c:init_cmdargs and lread.c:load_path_default. The bottom line is that the Lisp and Info files will be taken from the source tree, not from the build tree. So if you have more than one build from the same source tree, then they all share the Lisp and Info files. Therefore, if you modify anything in the source tree, you must rebuild all the out-of-tree builds, otherwise those you don't rebuild will be inconsistent with the modified sources. > >> +'/usr/local/share/emacs/VERSION/native-lisp' holds the natively compiled > >> + pre-loaded Emacs Lisp files. > > > > This is incorrect: native-lisp is installed under /usr/lib/emacs/VERSION, > > not under /usr/share/emacs/VERSION. > > I guess you meant /usr/local/lib/emacs/VERSION for the default location? Yes. > +By default, Emacs natively compiles only pre-loaded Lisp files during > +the build process; other Lisp files are natively compiled > +"just-in-time", i.e, when they are loaded in the running Emacs. If you ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "when they are first time loaded into the running Emacs". > 6) Run 'make' in the top directory of the Emacs distribution to finish > -building Emacs in the standard way. The final executable file is > -named 'src/emacs'. You can execute this file "in place" without > -copying it, if you wish; then it automatically uses the sibling > -directories ../lisp, ../lib-src, ../info. > +building Emacs in the standard way. The final executable file is named > +'src/emacs'. You can execute this file "in place" without copying it, > +if you wish; then it automatically uses the sibling directories ../lisp, > +../lib-src, ../info, ../native-lisp (if built with support for native > +compilation). > + > +If you build Emacs in a directory separate from the source directory > +("out-of-tree"), run 'make' in the build directory. Then you can > +execute the 'src/emacs' file under that directory "in place". However, > +running Emacs uninstalled is fully supported only when it is built in > +the source tree. I think the last sentence should be better phrased as However, running Emacs uninstalled in this case will still use the ../lisp and ../info subdirectories of the source tree, while using the ../lib-src and ../native-lisp subdirectories from the build tree. > +'/usr/local/lib/emacs/VERSION/native-lisp' holds the natively compiled > + pre-loaded Emacs Lisp files. The above also contains the other Lisp files if using the "--with-native-compilation=aot" configure-time option. > +'~/.emacs.d/eln-cache/' holds the remaining natively compiled Lisp files. Instead of "remaining" I'd say "just-in-time natively compiled Lisp files". Thanks.