[Glass] Unloading Monticello packages: what's the best practice?

Johan Brichau johan at yesplan.be
Wed Jun 14 12:28:21 PDT 2023


Hey Dale,

Good point about using the `Metacello record` to figure out an unload order. This helps.

I originally thought it would have been the easiest strategy to unload the old version and load the new version, just like in a fresh load.
However, I did encounter a couple of other issues with subclasses and persistent instances, making that strategy more complicated.
It also takes a considerable amount of time unloading the packages.

So, I am now first selectively removing the packages I don’t want Metacello to reload, or which no longer exist in the latest version.
Then I load the latest version. This seems to work easier than I thought. It just requires me to look at the differences and find out where I missed some. Still doing that now.

Something that surprised me is that Metacello will reload a package that is in the image, even though a clean load of the same baseline will not load that same package.
For example, I have Seaside-Swazoo and friends loaded in our existing repositories but I no longer load those packages when using the latest Seaside version. 
Loading into a fresh repository does not load the Swazoo packages but loading in an existing repository does. So, I now remove them before loading.

Johan

> On 14 Jun 2023, at 19:00, Dale Henrichs <dale.henrichs at gemtalksystems.com> wrote:
> 
> I never added the unload method to Metacello, so I've never tried to seriously support unload (until Rowan) ... and relied upon the reload working ...
> 
>> I suppose you could derive the unload order by reversing the package load order for the project 
>>  | packageNames |
>>   packageNames := {}.
>>   (Metacello image project: 'Ston') record
>>     packageDirectivesDo: [ :each | packageNames add: each spec name ].
>>   packageNames
>>   anArray( 'STON-Core', 'STON-GemStone-Core', 'STON-UTF8-Core')
> 
> The script might get more complicated with required projects ... let me know if you need more help unwinding the load directive ... 
> 
> Dale
> 
> 
> On Wed, Jun 14, 2023 at 5:38 AM Johan Brichau via Glass <glass at lists.gemtalksystems.com <mailto:glass at lists.gemtalksystems.com>> wrote:
>> Hi,
>> 
>> I am preparing an upgrade of the Seaside version in existing GemStone repositories where it is more practical to unload the current (old) Seaside version and load the current one afterwards rather than loading the new one over the old one.
>> However, the code snippet below I currently came up with is terribly slow and does not work because not everything got remove. Probably because the unload requires a certain order… 
>> 
>> So, has anyone done this in a GemStone Glass/GsDevKit setup? What is the best way to do this?
>> 
>> Johan
>> 
>> | packages gofer |
>> packages := (MetacelloProjectRegistration registrationForClassNamed: 'ConfigurationOfSeaside3' ifAbsent: [ nil ])
>>  configurationProjectSpec loadPackageList.
>> 
>> packages do:[:p |
>>         Transcript show: 'Unload ', p; cr.
>>         gofer := Gofer new package: p; unload].
>> 
>> 
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com <mailto:Glass at lists.gemtalksystems.com>
>> https://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/archives/glass/attachments/20230614/2a638a28/attachment-0003.htm>


More information about the Glass mailing list