[squeak-dev] Package unload status

Andreas Raab andreas.raab at gmx.de
Sun Jan 3 14:09:33 UTC 2010


Folks -

I've been going through various packages, and we're actually capable of 
unloading quite a bit of them cleanly by now. I've attached my unload 
script which (on a most recent updated trunk image with no additional 
packages loaded) will be able to unload the following packages:
- ReleaseBuilder, ScriptLoader
- 311Deprecated, 39Deprecated
- Universes, SMLoader, SMBase, Installer-Core
- VersionNumberTests, VersionNumber
- Services-Base, PreferenceBrowser, Nebraska
- CollectionsTests, GraphicsTests, KernelTests, MorphicTests
- MultilingualTests, NetworkTests, ToolsTests, TraitsTests
- XML-Parser, Traits
After these packages been unloaded there are no Undeclared references or 
obsolete behaviors or modified MC packages. There are several more 
candidate packages, some of which I could use some help with:

* Tests: The tests package is currently not unloadable because it 
includes ClassTestCase which is used from several other places. There is 
a fundamental question here whether we should aim for making all tests 
as well as SUnit unloadable or not. If the former, then we need to move 
tests out of packages like Files, System or MC in order to make them 
unloadable. If we're not shooting for making SUnit unloadable it may be 
worthwhile to promote ClassTestCase up to SUnit so that the Tests 
package becomes unloadable. Comments?

* Morphic-Extras: I don't understand the intent of this package. The 
name implies to me that it includes "extras" which I'd expect to be 
optional content that should be unloadable at will but the reality is 
that even attempting to unload it (I foolishly tried) blows up left and 
right. Question: Is the intention of Morphic-Extras to contain 
unloadable content? If so, it's not doing its job currently. If that's 
not the intention of Morphic-Extras, I'd appreciate a heads-up of what 
the rationale for the structure is.

* ST80: This is still a bit off but we're getting there. It can actually 
be unloaded but there are still several Undeclared variables and 
obsolete behaviors after unloading MVC. But the good news is that the 
system is still functioning (!) instead of horribly dying as it used to 
be. We could use a bit of additional help from people with an interest 
in this area.

Cheers,
   - Andreas
-------------- next part --------------
"Prepare unloading"
Flaps disableGlobalFlaps: false.
StandardScriptingSystem removeUnreferencedPlayers.
Project removeAllButCurrent.
#('Morphic-UserObjects' 'EToy-UserObjects' 'Morphic-Imported' )
	do: [:each | SystemOrganization removeSystemCategory: each].
Smalltalk at: #ServiceRegistry ifPresent:[:aClass|
	SystemChangeNotifier uniqueInstance
		noMoreNotificationsFor: aClass.
].
World removeAllMorphs.
"Go unloading"
#(	'ReleaseBuilder' 'ScriptLoader'
	'311Deprecated' '39Deprecated'
	'Universes' 'SMLoader' 'SMBase' 'Installer-Core'
	'VersionNumberTests' 'VersionNumber'
	'Services-Base' 'PreferenceBrowser' 'Nebraska'
	'CollectionsTests' 'GraphicsTests' 'KernelTests'  'MorphicTests' 
	'MultilingualTests' 'NetworkTests' 'ToolsTests' 'TraitsTests'
	'XML-Parser'
) do:[:pkgName| (MCPackage named: pkgName) unload].
"Traits use custom unload"
Smalltalk at: #Trait ifPresent:[:aClass| aClass unloadTraits].

"Post-unload cleanup"
Compiler recompileAll.
SystemOrganization removeEmptyCategories.
ChangeSet removeChangeSetsNamedSuchThat:[:cs | (cs == ChangeSet current) not].
Undeclared removeUnreferencedKeys.
StandardScriptingSystem initialize.
MCFileBasedRepository flushAllCaches.
MCDefinition clearInstances.
Behavior flushObsoleteSubclasses.
ChangeSet current clear.
ChangeSet current name: 'Unnamed1'.
Smalltalk flushClassNameCache.
Smalltalk at: #Browser ifPresent:[:br| br initialize].
DebuggerMethodMap voidMapCache.
DataStream initialize.
Smalltalk forgetDoIts.
AppRegistry removeObsolete.
FileServices removeObsolete.
Preferences removeObsolete.
TheWorldMenu removeObsolete.
Smalltalk garbageCollect.
Symbol compactSymbolTable.
TheWorldMainDockingBar updateInstances.


More information about the Squeak-dev mailing list