Subject: Re: bug#74382: `compile-first` Make rule is no longer using `load-prefer-newer`

From: Konstantin Kharlamov <[email-masked]>
Date: Sun, 17 Nov 2024 01:54:48 +0300

On Sat, 2024-11-16 at 22:00 +0200, Eli Zaretskii wrote:
> > Cc: [email-masked], [email-masked]
> > From: Konstantin Kharlamov <[email-masked]>
> > Date: Sat, 16 Nov 2024 21:43:41 +0300
> > 
> > > I don't think this is related to what lisp/Makefile does.  When
> > > macroexp.el is updated, builds are known to fail until you remove
> > > macroexp.elc (or bootstrap).
> > 
> > Okay, but why you need to remove macroexp.elc
> 
> Because macroexp.el contains macros, which might have been already
> expanded in the .elc file(s).
> 
> > isn't it the build system job to rebuild it when it's changed?
> 
> It's impractical, because we have many files with macros.  Tracking
> all of those dependencies would mean that changes in any file will
> trigger unnecessary recompilation of many other files.  If you don't
> mind spending that time waiting for the build, just "make bootstrap"
> every time you update from Git, and you will have that.

Unless I'm missing something, the problem seems to be with one exact
file, macroexpand.elc, and not with others. So the algorithm is simple:
if `macroexpand.el` was modified, remove its elc file. You don't need
to track any dependencies.