all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: Dependency graph for Emacs Lisp files
Date: Thu, 01 Aug 2019 09:00:59 -0400	[thread overview]
Message-ID: <jwv4l31uk70.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <8736ilnmp7.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Thu, 01 Aug 2019 13:34:44 +0200")

> 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




  parent reply	other threads:[~2019-08-01 13:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 11:34 Dependency graph for Emacs Lisp files Lars Ingebrigtsen
2019-08-01 12:07 ` Phillip Lord
2019-08-01 12:16   ` Lars Ingebrigtsen
2019-08-01 12:41     ` Noam Postavsky
2019-08-01 13:18       ` Lars Ingebrigtsen
2019-08-01 13:10     ` Phillip Lord
2019-08-01 13:16       ` Lars Ingebrigtsen
2019-08-01 13:24         ` Andreas Schwab
2019-08-01 15:29         ` Stefan Monnier
2019-08-01 15:57           ` Lars Ingebrigtsen
2019-08-01 13:00 ` Stefan Monnier [this message]
2019-08-01 13:26   ` Lars Ingebrigtsen
2019-08-01 15:27     ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=jwv4l31uk70.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.