Re: build broken: no defun org-float-time. A workaround.

From:

Alan Mackenzie

Subject:

Re: build broken: no defun org-float-time. A workaround.

Date:

Tue, 8 Sep 2009 18:17:35 +0000

User-agent:

Mutt/1.5.9i

Hi, everybody,
On Tue, Sep 08, 2009 at 12:48:50PM -0400, Stefan Monnier wrote:
> >> Always run `make bootstrap' if you don't want to deal with these issues.
> > That's horrible. It's very slow, and if the build breaks for any
> > other reason (careless commission), you haven't even got the bulk of
> > your old build left.
> The problem is that we don't have the necessary code right now to
> generate the needed dependency graph, so wile "cvs update; make" often
> works, it sometimes fails for lack of dependency info, in which case
> "make bootstrap" works around the problem.
How about this for a workaround? Before doing any byte compilation, you
scan the .../lisp directory for stale .elc files, and rename them all.
That way, the byte compiler is forced to load the new .el files in
response to `require', and the like. At the end of the process, you
either delete or unrename the stale files as appropriate.
Here's a script I've hacked together which does this. Is it easy to
implement this idea in the makefiles?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#! /bin/bash
##############################################################################
#
# m a k e - e m a c s . s h
#
# Invoke make, having first renamed stale .elc files to prevent them being
# loaded spuriously by the byte compiler. Afterwards, delete or restore each
# renamed file appropriately.
#
# Call this script from the top level of an Emacs tree.
##############################################################################
OLD=ksiwrjcy
STALES=$(for f in `find . -name '*.el'` ; do
if [ -f ${f}c -a ${f}c -ot $f ] ; then echo ${f}c ; fi
done)
echo "Stale files: $STALES" >&2
sleep 3
echo
for f in $STALES ; do mv ${f}{,.$OLD} ; done
make
for f in $STALES ; do
if [ -f $f ]
then rm ${f}.$OLD
else mv ${f}{.$OLD,}
echo $f wasn\'t remade >&2
fi
done
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> Stefan
--
Alan Mackenzie (Nuremberg, Germany).