[Glass] Instances of obsolete classes after stone upgrade

Johan Brichau johan at yesplan.be
Wed Jan 5 06:03:36 PST 2022


Hi Dale,

Reviving this thread since there still are some references to old compiled blocks left in the upgraded repository which I missed earlier on.
Although most were removed after executing the script to clean the session methods structure, I was still left with the list below.

Since these were referenced from an old class version of GsPackagePolicy, I ran the following as SystemUser:

	GsPackagePolicy classHistory removeVersion: GsPackagePolicy classHistory first

Which cleared the list.
Does this look like an expected/normal step I can/need to do?

Cheers,
Johan

------
    doit
    | obsoleteBlockClasses blockArrays |
    obsoleteBlockClasses := Array withAll: (ObsoleteClasses select: [ :object | object isClass and: [ object inheritsFrom: BlockClosure ] ]).
    blockArrays := SystemRepository listInstances: obsoleteBlockClasses.
    blockArrays do: [ :blockArray |
        blockArray do: [ :block |
            Transcript show: ('Instance {1} of {2} was defined in: {3}>>#{4}' format: { block asOop. block class name. block method inClass name. block method selector }) ] ].
    nil

--transcript--'Instance 8573185 of SimpleBlock was defined in: GsPackagePolicy class>>#initialize'
--transcript--'Instance 8600577 of ComplexVCBlock was defined in: GsPackagePolicy>>#buildSessionMethodDictionary'
--transcript--'Instance 8600833 of ComplexVCBlock was defined in: GsPackagePolicy>>#buildSessionMethodDictionary'
--transcript--'Instance 8582913 of ComplexBlock was defined in: GsPackagePolicy>>#removeSelector:fromCategoriesFor:'
--transcript--'Instance 8584193 of ComplexBlock was defined in: GsPackagePolicy>>#sessionMethodRemoveAllMethodsFor:'
--transcript--'Instance 8585473 of ComplexBlock was defined in: GsPackagePolicy>>#removeAllSubclassCodeFor:'
--transcript--'Instance 8587777 of ComplexBlock was defined in: GsPackagePolicy>>#setStamp:forBehavior:forMethod:'
--transcript--'Instance 8589057 of ComplexBlock was defined in: GsPackagePolicy>>#packagesDo:'
--transcript--'Instance 8591361 of ComplexBlock was defined in: GsPackagePolicy>>#copyCategoryDictFor:into:'
--transcript--'Instance 8592129 of ComplexBlock was defined in: GsPackagePolicy>>#selectorsFor:into:'
--transcript--'Instance 8592897 of ComplexBlock was defined in: GsPackagePolicy>>#categoryOfSelector:for:'
--transcript--'Instance 8593665 of ComplexBlock was defined in: GsPackagePolicy>>#compiledMethodAt:for:'
--transcript--'Instance 8594433 of ComplexBlock was defined in: GsPackagePolicy>>#includesSelector:for:'
--transcript--'Instance 8595201 of ComplexBlock was defined in: GsPackagePolicy>>#copyMethodDictFor:into:'
--transcript--'Instance 8596481 of ComplexBlock was defined in: GsPackagePolicy>>#removeAllMethodsFor:'
--transcript--'Instance 8597249 of ComplexBlock was defined in: GsPackagePolicy>>#removeMethodAt:for:'
--transcript--'Instance 8598529 of ComplexBlock was defined in: GsPackagePolicy>>#packageReverseDo:'
--transcript--'Instance 8600321 of ComplexBlock was defined in: GsPackagePolicy>>#buildSessionMethodDictionary'
--transcript--'Instance 8605185 of ComplexBlock was defined in: GsPackagePolicy>>#permitSessionMethodFor:selector:'
--transcript--'Instance 8605953 of ComplexBlock was defined in: GsPackagePolicy>>#pragmasForMethod:in:'
--transcript--'Instance 8606721 of ComplexBlock was defined in: GsPackagePolicy>>#stampForMethod:in:'
--transcript--'Instance 8607489 of ComplexBlock was defined in: GsPackagePolicy>>#setPragmas:forBehavior:forMethod:'
--transcript--'Instance 8610305 of ComplexBlock was defined in: GsPackagePolicy>>#sessionMethodRemoveMethodAt:for:'
--transcript--'Instance 8611073 of ComplexBlock was defined in: GsPackagePolicy>>#sessionMethodRemoveAllSubclassCodeFor:'
--transcript--'Instance 8611841 of ComplexBlock was defined in: GsPackagePolicy>>#removeCategory:for:'
--transcript--'Instance 8612609 of ComplexBlock was defined in: GsPackagePolicy>>#categoryNamesFor:into:'
--transcript--'Instance 8613377 of ComplexBlock was defined in: GsPackagePolicy>>#selectorsIn:for:into:'


> On 19 Nov 2021, at 23:39, Dale Henrichs <dale.henrichs at gemtalksystems.com> wrote:
> 
> Check.
> To be clear: it’s not in the post upgrade step of the GsDevKit code?
> It’s not that I missed it when copying them to our scripts…?
> The session method cleanup script I sent is NOT part of postUpgrade processing ...  I didn't think that the session methods structure could be a culprit for holding onto old GsMethod instances until you noticed the problem, so I've submitted an issue against GsDevKit_upgrade[1] which is used to drive the seasideImage upgrade process for 3.5.x and beyond ...
> 
> Dale
> 
> [1] https://github.com/GsDevKit/GsDevKit_upgrade/issues/21 <https://github.com/GsDevKit/GsDevKit_upgrade/issues/21>
> On Fri, Nov 19, 2021 at 12:40 PM Johan Brichau <johan at yesplan.be <mailto:johan at yesplan.be>> wrote:
> 
> 
> > On 19 Nov 2021, at 21:07, Dale Henrichs <dale.henrichs at gemtalksystems.com <mailto:dale.henrichs at gemtalksystems.com>> wrote:
> > 
> > With regards to dealing with block instances, I believe there should be a section in the release notes that provides scripts for finding a replacing obsolete block instances for use cases like SortedCollection, where the potentially obsolete block instance is stored in an instance variable ...
> 
> Yes, we apply the postconv script as mentioned in the upgrade instructions.
> We have some blocks left in our application code that require manual intervention and that’s why we also noticed the ones referenced by the GsMethod instances.
> 
> > And yes, the session method cleanup code should be included in your post upgradeSeasideImage processing along with "sort block" cleanup code ...
> 
> Check.
> To be clear: it’s not in the post upgrade step of the GsDevKit code?
> It’s not that I missed it when copying them to our scripts…?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/archives/glass/attachments/20220105/d3a3956f/attachment.htm>


More information about the Glass mailing list