unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: emacs-devel@gnu.org
Subject: More reliable byte compilation, take 45
Date: Mon, 04 Oct 2021 12:51:19 +0200	[thread overview]
Message-ID: <87sfxhm5aw.fsf@gnus.org> (raw)

Various schemes to make byte compilation more reliable has been mooted,
but none have been practical.

To recap: The problem is that if we change a macro in foo.el, and bar.el
uses that macro, bar.el won't be recompiled after changing the macro in
foo.el.

A defensive solution would be to recompile all libraries that require a
library, building a dependency tree from require/autoloads/etc, but the
problem is then that if you edit anything in subr.el, then you have to
recompile all the .el files, basically.  So it's not practical.

So we want a solution that's 1) fairly fast and 2) somewhat reliable.  A
100% solution isn't necessary -- just something that's less "well, just
say 'make bootstrap' then".

So here's the idea of the day:

make macro-recompile

would go through all the .el files and just look for "^\(defmacro ([^
\t\n]+)" (and defsubst and cl-defstruct and probably a couple of other
things, but not a whole lot more), and then do a sha256 of the region
from the start of the match and until the next "^(".  It would maintain
a database of these macro names/hashes.  If a macro changes its hash, it
would then just grep through all the .el files for the macro name, and
delete the .elc files where it fines matches.

The point here is to make it feasible to alter macros and see whether
there's any horrible fall-out immediately, with some confidence.  So it
has to be fast, and not result in too much recompilation.

So writing a little C helper program to do the hashing stuff might
possibly be the way to go here.

Does this sound feasible and useful?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




             reply	other threads:[~2021-10-04 10:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 10:51 Lars Ingebrigtsen [this message]
2021-10-04 15:36 ` More reliable byte compilation, take 45 Clément Pit-Claudel
2021-10-04 16:16   ` Lars Ingebrigtsen
2021-10-04 18:16   ` T.V Raman
2021-10-04 18:21     ` Eli Zaretskii
2021-10-04 19:18       ` Stefan Monnier
2021-10-04 19:51         ` Eli Zaretskii
2021-10-04 20:13           ` Stefan Monnier
2021-10-05 11:52             ` Eli Zaretskii
2021-10-05 13:27               ` Stefan Monnier
2021-10-05 14:06                 ` Adam Porter
2021-10-05 15:41                 ` Eli Zaretskii
2021-10-04 16:03 ` Steingold
2021-10-04 17:35   ` Lars Ingebrigtsen
2021-10-04 18:59     ` Steingold
2021-10-05  7:14       ` Lars Ingebrigtsen
2021-10-05 14:50         ` Steingold
2021-10-05 14:51   ` Steingold
2021-10-05 19:30     ` 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

  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=87sfxhm5aw.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.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 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).