[asdf-devel] Unexpected behavior when loading different versions of a system

Robert Goldman rpgoldman at sift.info
Fri Sep 2 03:39:52 UTC 2011

On 9/1/11 Sep 1 -10:07 PM, Robert Goldman wrote:
> OK, I have investigated, and I see what's wrong.  The ABSOLUTE-PATHNAME
> slot of COMPONENT acts like a kind of cache (it's filled by resolving
> the RELATIVE-PATHNAME), but it is not being cleared when the system is
> reloaded.
> I have a proposed patch that involves a REINITIALIZE-INSTANCE :AFTER
> method on COMPONENT, and it seems to fix the problem.  I am just
> finishing up a test case (as usual, the bugs in the test script are
> harder to find than the bugs in ASDF!), and expect to push a fix tonight
> or tomorrow morning.

Hm.  I spoke too soon --- that modification only kicks the problem down
the road.  Here is what it fixes:  it fixes the fact that the
ABSOLUTE-PATHNAME of the FOO system is not updated when you load a new
system definition in a new file.

UNFORTUNATELY, there are other  problems with reusing the COMPONENT
objects when you reload the definition of a system with the same name.

Here's the new problem:  when we reload Xach's foo system, we get a new
definition with files "a" and "b."  Unfortunately, when ASDF reads this
new definition, it first says "Oh, file a in system foo --- I have seen
that before, and it's already loaded."  So when I tell ASDF to load foo
(again), it says "a is already loaded, I need only load b."
Unfortunately, that is not true --- the OLD "a" component is already
loaded, but the NEW one has not been loaded.

I am not entirely sure why we reuse the same COMPONENT objects when we
reload the system definition.  Arguably, the conservative thing to do
would be to say "a new system definition has been loaded, all bets are
off about whether the load-op (or any other operation) of existing
components has been satisfactorily completed," and simply blow away the
old child components of the parent.  Yes, this would lead to some
unnecessary recompiles in the more common cases of interactive
development, where the system definition has only changed in a minor
way, but it would fix these really bad cases where the system definition
has really invalidated all dependency information.

[Indeed, Faré and I had in the past discussed the possibility that when
a new system definition for an existing system is loaded, we should
simply regard the entire system as "dirty" and always rebuild everything
in it.]

This is a REALLY big change to the behavior of ASDF, so I would like to
hear some comments before proposing a patch.


More information about the asdf-devel mailing list