[squeak-dev] Class with obsolete superclass not removed by MCPackageLoader
forums.jakob at resfarm.de
Sun Oct 31 09:56:09 UTC 2021
I have trouble with the Tonel tests in Squeak trunk. During the
smalltalkCI run, Tonel unloads itself before loading the fresh version
for testing. However for class TonelFileSystemUtils the base class
TonelFileUtils gets removed first, so TonelFileSystemUtils now
inherits from AnObsoleteTonelFileSystemUtils. This later causes
TonelFileSystemUtils not to be unloaded when its package gets
unloaded! That in turn means when TonelFileSystemUtils is supposed to
be loaded again for the tests, its class initialize method is not run
because it does not change, so a class variable in TonelFileUtils
stays uninitialized and tests fail.
In MCPackageLoader>>analyze, there is this:
sorter := self sorterForItems: removals.
removals := sorter orderedItems reversed.
Before these lines, removals contains the MCClassDefinition of
TonelFileSystemUtils, but sorter orderedItems does no longer contain
it, so the MCClassDefinition gets ejected from the removals and the
class is later not removed.
Neither variables nondeferred nor deferred in the MCDependencySorter
include the class definition. But required contains
MCClassDefinition(TonelFileSystemUtils)). Of course,
AnObsoleteTonelFileUtils never gets added to the provisions because it
does not exist in any Environment anymore (see
I believe this is a bug because absent base classes should not prevent
the removal of a class, correct?
Of course I will now try to fix the unload order in that Tonel script
to solve my practical problem, but that does not fix MCPackageLoader
More information about the Squeak-dev