Subject: Re: circular dependencies in elisp files and make

From: Eli Zaretskii <[email-masked]>
Date: Sat, 13 May 2023 11:46:13 +0300

> Date: Sat, 13 May 2023 14:34:06 +0700
> Cc: [email-masked], [email-masked], [email-masked],
>  [email-masked], [email-masked], [email-masked]
> From: Max Nikulin <[email-masked]>
> 
> 1. A script reads dependency files (if they exist) created during 
> previous build and removes stale .elc files.

This will break if the updated files have different dependencies.  You
need to recreate the dependencies each build.

Also, it is not clear what is the plan for the macros.  If one of the
macros used during byte compilation changes in incompatible ways,
trying to byte-compile using Emacs which preloaded the previous
(outdated) definition of the macro will fail.  So some changes need
also to generate a new Emacs binary, not just byte-compile in the
right order.

> 2. Normal "make" pass that takes into account dependency between files 
> for ordering of compile commands. Dependency files are created or 
> updated as a side-effect of compilation.
> 
> Likely it is reasonable to split stage 2 into steps similar to current 
> targets like main-first and mark most of files as dependent on a target 
> that (throw its dependencies) compiles files required for byte compilation.

What is the plan for the various autoloads files?  They depend on all
the files, and many (all?) files depend on them.