[Top][All Lists]

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

Re: Recursive compilation?

From: Stefan Monnier
Subject: Re: Recursive compilation?
Date: Tue, 31 May 2011 18:52:17 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> The obvious "gotcha" here is that one probably shouldn't try to
> (recursively) byte-compile files in directories that we don't have write
> access to.  So if somebody has set their load-path to my directory, and
> I have an old .elc file there, then this function shouldn't try to
> compile that file, too.

Right, cyclic require loops can definitely happen in such cases.
But they're easy to break.

> The other caveat is that Makefiles typically first mark all files that
> are to be compiled, and then compile them.  This would then possibly
> lead to some files being compiled twice.  However, that could be worked
> around by `byte-compile-file-recursively' not compiling a file that it's
> been asked to compile if the .elc file is newer than the .el file.

It's also a problem with parallel make.

> I have a feeling that this won't be very difficult to implement, but it
> needs meddling with the C layer, since `require' is a C function.  But I
> think it would make compiling Emacs after a "bzr update" a lot less
> likely to break.

Another approach is to build a set of makefile dependencies from the
`require' calls.  I did that at some point in the past.  It wasn't too
hard to do.  But there are also the cases of preloaded files, as well as
autoloaded macros/functions.

I'm personally using a different hack which doesn't solve all those
problems either but is simple and doesn't suffer from as many problems
in my experience: prefer loading the .el file if it's more recent.


reply via email to

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