emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dependency graph for Emacs Lisp files


From: Stefan Monnier
Subject: Re: Dependency graph for Emacs Lisp files
Date: Thu, 01 Aug 2019 09:00:59 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> So would it make a sense to add something that, along the lines of the
> stuff that gathers autoloads, creates a dependency.el file (by just
> doing `re-search-forward "(require '"' on all the files), and that would
> use this to delete .elc files before compiling the lisp directory, based
> on whether something "up" in the dependency chain has changed?

Many years ago, I wrote a quick scripts which added dependency rules to
the lisp/Makefile based on a quick search for "^(require ".

The result was rather disappointing:
1- lots of cycles
2- incomplete dependencies (mostly due to autoloads).
3- too many dependencies, resulting in excessive recompilation for
   my taste

I believe (1) has improved over the years, but I'm sure there's still
a fair bit of that.  Make didn't like them back then, and I don't think
it likes them more now.  So we'd need some way to fix that (I guess we
could add some annotations in the source code to "ignore" some
dependencies).

For (2), I think a better option is to generate the dependencies as
a side-effect of compilation using after-load-functions: we should be
able to collect reliably all the dependencies this way, regardless of
how the files get loaded.

Regarding (3), I'm not sure how to deal with that.  The problem is all
the (require 'foo) which are only really needed at run time.  There are
various ways we could try and tackle the problem, but they all seem to
be way too invasive.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]