unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lynn Winebarger <owinebar@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: akrl@sdf.org, michael.albinus@gmx.de, emacs-devel@gnu.org,
	 monnier@iro.umontreal.ca
Subject: Re: Native-compilation build process (was Re: Loading tramp for dump goes into infinite regress)
Date: Wed, 3 Aug 2022 23:33:56 -0400	[thread overview]
Message-ID: <CAM=F=bD53RX9v8Kt2ifAm0fQ=bO7agyuF=fCWiFhngMJwWvGKw@mail.gmail.com> (raw)
In-Reply-To: <831qtx5mn5.fsf@gnu.org>

On Wed, Aug 3, 2022 at 12:15 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Lynn Winebarger <owinebar@gmail.com>
> > Date: Wed, 3 Aug 2022 10:53:12 -0400
> > Cc: Andrea Corallo <akrl@sdf.org>, Michael Albinus <michael.albinus@gmx.de>,
> >       emacs-devel <emacs-devel@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca>
> >
> > > Why are you running "make" only in 'src'?  Some necessary parts of the
> > > build must also run "make" in 'lisp' and in other places.
> >
> > I'm replicating the 3 stage build process Stefan Monnier (added to the
> > cc list) described by invoking a shell script from site-load, when
> > dump-mode is set to pdump.
>
> Well, Stefan definitely didn't mean for you to shoot yourself in the
> foot.  Isn't it possible to run these 2 stages from the top-level
> Makefile?
Not that I can tell - I don't  know what targets I would use from the
top level, but I do know that "emacs.pdmp" and "src/emacs.pdmp"
produce an "unknown target" response.
In any case, I  don't believe I have shot myself in the foot.  I was
just able to produce and use a dump with
* 698 libraries in the preloaded-file-list
    * 136 files listed in lisp.mk
    * 521 files listed in site-load.mk (the file I generate from site-load)
    * I'm not sure where the remainder are from
* 426 native compilation units in "all-loaded-comp-units-h"
* 1126 eln files under native-lisp/28.1-<hash>/preloaded - none appear
directly in 28.1-<hash>
* 1504 elc files under lisp
* 1557 el files under lisp
I'm not sure why some of the files were byte compiled but not native
compiled (or at least, not loaded in the dump).  But at the end of
site-load I loaded cus-start (with dump-mode set to nil), cus-load,
and finally cus-edit.  The result of running customize is promising in
terms of (lack of) lag, but I won't really know if it works until I've
added all the additional site-lisp files in the mix.
My solution was to allow the dump to contain a string with the
absolute path.  That works for my purposes.  When I have something I
want to install permanently, I'll specify the final location as well.
Or I might just create a dump only intended to be run from the
installed location.
I think my total modifications to the distribution source are in the
range of maybe 50 lines of C and a handful of changes of "defconst" to
"defvar" in the lisp source files.  Since one of the goals of this
particular exercise is to be able to minimize the local maintenance of
patches, I consider it to be a win.  Keep in mind I don't control the
rest of the build tools on this system, so autoconf etc may change
without my input.  That's why I rather not do anything that touches
the configure script(s) or Makefile.in.  I'd rather modify the shell
script to accomodate any changes in the process or set of targets
post-configure, and rely on the emacs maintainers expert knowledge of
the configuration process to deal with any changes in the build
toolset.

One change I had to make was to set native-comp-deferred-compilation to nil:
make -C ../lisp EMACS=../src/emacs-1 compile-target
TARGETS="${SL_TARGETS}" BYTE_COMPILE_EXTRA_FLAGS="--eval '(setq
comp-file-preloaded-p t native-comp-deferred-compilation nil)'"
Otherwise I would end up with hundreds of lingering emacs processes
doing something with an argument that was something like
"subr-int-native-comp-<blah>-call-interactively-<hash>...".  The
recursively invoked make process for Stefan's "stage 2" would
nominally complete, but the resulting dump would have a random number
of native compilation units loaded.
Hopefully that's useful information for someone.

> > In any case, once loadup determines there are native compile units
> > loaded while preparing for the dump, either they all should have the
> > names fixed up, or an error should be signaled.
>
> The names cannot be fixed up, because the build doesn't know how.
> These two variables get their values from the configure script, where
> the user specifies where the package will be installed.  Without that,
> the build cannot know their values.

That's your call, I'm just pointing out above that it's usually better
to signal an error when it happens (not  supplying the arguments you
are stating as a requirement) than to signal an error over the
subsequent symptoms of the actual error (in this case, the attempt to
load the incoherent eln file).  I just don't understand why you would
ever want emacs to produce a dump file that will never be loadable
according to the requirements you are enforcing.  Are we actually in
disagreement on that?

> > There could be a flag to
> > dump an image with only the (relative) final installation paths
> > recorded, or it could just be a build that will always be run in place
> > (e.g. an ordinary user build).
>
> Many users never install Emacs, or at least never install some of its
> versions.

I don't doubt that, but this point is a little humorous given the
evident number of daily users of the latest commit in the master
trunk.

>
> Anyway, this is a non-starter: we won't give up this useful
> functionality.

I never said anything about giving it up.  That's distinct from not
making it a hard requirement.
I'm just clarifying the point I made. I don't expect your position to
change, but I'd prefer the rejection to be of what I actually
suggested.

Thanks,
Lynn



  reply	other threads:[~2022-08-04  3:33 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24  0:47 Loading tramp for dump goes into infinite regress Lynn Winebarger
2022-07-24  7:55 ` Michael Albinus
2022-07-24 12:05   ` Lynn Winebarger
2022-07-24 12:23     ` Eli Zaretskii
2022-07-24 13:30       ` Lynn Winebarger
2022-07-24 13:34         ` Eli Zaretskii
2022-07-24 14:05           ` Lynn Winebarger
2022-07-24 14:09             ` Eli Zaretskii
2022-07-24 14:28               ` Lynn Winebarger
2022-07-24 16:00             ` Lynn Winebarger
2022-07-24 16:20               ` Lynn Winebarger
2022-07-24 16:31                 ` Eli Zaretskii
2022-07-25 12:49                   ` Lynn Winebarger
2022-07-25 13:56                     ` Eli Zaretskii
2022-07-26 11:24                       ` Lynn Winebarger
2022-07-27  0:58                         ` Lynn Winebarger
2022-07-27  2:48                           ` Lynn Winebarger
2022-07-27  8:31                             ` Lynn Winebarger
2022-08-09 12:29                       ` Lynn Winebarger
2022-08-09 12:36                         ` Po Lu
2022-08-09 13:22                           ` Lynn Winebarger
2022-08-09 13:42                             ` Po Lu
2022-08-09 15:55                               ` Lynn Winebarger
2022-07-25 16:54                     ` Stefan Monnier
2022-07-25 17:05                       ` Stefan Monnier
2022-07-26  0:28                       ` Lynn Winebarger
2022-07-26  1:10                         ` Lynn Winebarger
2022-08-06  6:07                       ` Lynn Winebarger
2022-08-06 12:57                         ` Lynn Winebarger
2022-08-06 15:39                           ` Lynn Winebarger
2022-08-06 20:23                             ` Working fully native-compiled "mega dump" (was Re: Loading tramp for dump goes into infinite regress) Lynn Winebarger
2022-08-06 20:52                               ` Lynn Winebarger
2022-07-25 20:11                     ` Loading tramp for dump goes into infinite regress Andrea Corallo
2022-07-31 20:22                       ` Lynn Winebarger
2022-08-03  9:58                         ` Lynn Winebarger
2022-08-03 12:22                           ` Eli Zaretskii
2022-08-03 14:53                             ` Native-compilation build process (was Re: Loading tramp for dump goes into infinite regress) Lynn Winebarger
2022-08-03 16:15                               ` Eli Zaretskii
2022-08-04  3:33                                 ` Lynn Winebarger [this message]
2022-08-05  1:57                                   ` Lynn Winebarger
2022-07-24 16:23               ` Loading tramp for dump goes into infinite regress Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAM=F=bD53RX9v8Kt2ifAm0fQ=bO7agyuF=fCWiFhngMJwWvGKw@mail.gmail.com' \
    --to=owinebar@gmail.com \
    --cc=akrl@sdf.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).