Metacello / metacello

Metacello is a package management system for Smalltalk
MIT License
87 stars 43 forks source link

Fix Metacello for Squeak 6.0beta #552

Closed LinqLover closed 2 years ago

LinqLover commented 2 years ago

Eliminates dependency on Squeak 60Deprecated by removing obsolete extension on BlockContext. This fixes Metacello/Squeak CI and loading Metacello into Squeak 6.0beta image. BlockContext has been deprecated since Squeak 5.2 is no longer available in Squeak 6.0. See 60Deprecated-pre.5.

/cc @marceltaeumel @tom95 - if one of you approves this, I will merge this. :-)

j4yk commented 2 years ago

Looks correct to me starting from Squeak 5.2. My only doubt is whether it will not break if older Squeak images attempt to load the Metacello master. Compatibility could be ensured by just moving the methods to a compatibility package, and conditionally loading that via the baseline.

j4yk commented 2 years ago

...on the other hand, I just tried to install Metacello in Squeak 5.1 and out of the box it fails anyway:

Could not resolve: ConfigurationOfMetacelloPreview [ConfigurationOfMetacelloPreview] in C:\Squeak\Squeak5.1-16548-64bit-All-in-One\Squeak5.1-16548-64bit-All-in-One.app\Contents\Resources\package-cache github://Metacello/metacello:configuration ERROR: 'GoferRepositoryError: primitiveSSLCreate failed' ``` 22 May 2022 11:45:38.495702 am VM: Win32 - Smalltalk Image: Squeak5.1 [latest update: #16548] SecurityManager state: Restricted: false FileAccess: true SocketAccess: true Working Dir C:\Squeak\Squeak5.1-16548-64bit-All-in-One\Squeak5.1-16548-64bit-All-in-One.app\Contents\Resources Trusted Dir C:\Squeak\Squeak5.1-16548-64bit-All-in-One\Squeak5.1-16548-64bit-All-in-One.app\Contents\Resources\Jakob Untrusted Dir C:\Users\Jakob\Documents\My Squeak MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)>>retryingResolvePackageSpecReferences:gofer: Receiver: a MetacelloFetchingMCSpecLoader(explicit load : ConfigurationOfMetacelloPreview) Arguments and temporary variables: < Receiver's instance variables: spec: spec name: 'ConfigurationOfMetacelloPreview'; repository: 'github://Me...etc... operator: nil loaderPolicy: a MetacelloLoaderPolicy disablePackageCache: false [] in MetacelloFetchingMCSpecLoader>>linearLoadPackageSpec:gofer: Receiver: a MetacelloFetchingMCSpecLoader(explicit load : ConfigurationOfMetacelloPreview) Arguments and temporary variables: packageSpec: spec name: 'ConfigurationOfMetacelloPreview'; repository: 'gith...etc... gofer: a MetacelloGofer references: nil nearestReference: nil cachedReference: nil externalReference: nil loadedVersionInfos: nil mcVersion: #(nil) Receiver's instance variables: spec: spec name: 'ConfigurationOfMetacelloPreview'; repository: 'github://Me...etc... operator: nil loaderPolicy: a MetacelloLoaderPolicy disablePackageCache: false [] in MetacelloSqueakPlatform>>do:displaying: Receiver: a MetacelloSqueakPlatform Arguments and temporary variables: < Receiver's instance variables: bypassProgressBars: false bypassGoferLoadUpdateCategories: false [] in [] in MorphicUIManager>>displayProgress:at:from:to:during: Receiver: a MorphicUIManager Arguments and temporary variables: < Receiver's instance variables: builderClass: MorphicToolBuilder BlockClosure>>on:do: Receiver: [closure] in [] in MorphicUIManager>>displayProgress:at:from:to:during: Arguments and temporary variables: exceptionOrExceptionSet: ProgressNotification handlerAction: [closure] in [] in MorphicUIManager>>displayProgress:at:from:to:during:...etc... handlerActive: true Receiver's instance variables: outerContext: [] in MorphicUIManager>>displayProgress:at:from:to:during: startpc: 146 numArgs: 0 [] in MorphicUIManager>>displayProgress:at:from:to:during: Receiver: a MorphicUIManager Arguments and temporary variables: < Receiver's instance variables: builderClass: MorphicToolBuilder BlockClosure>>ensure: Receiver: [closure] in MorphicUIManager>>displayProgress:at:from:to:during: Arguments and temporary variables: aBlock: [closure] in MorphicUIManager>>displayProgress:at:from:to:during: complete: nil returnValue: nil Receiver's instance variables: outerContext: MorphicUIManager>>displayProgress:at:from:to:during: startpc: 139 numArgs: 0 MorphicUIManager>>displayProgress:at:from:to:during: Receiver: a MorphicUIManager Arguments and temporary variables: titleString: 'Fetching ConfigurationOfMetacelloPreview' aPoint: 374@194 minVal: 0 maxVal: 2 workBlock: [closure] in MetacelloSqueakPlatform>>do:displaying: progress: [closure] in SystemProgressMorph>>position:label:min:max: result: #(nil) Receiver's instance variables: builderClass: MorphicToolBuilder ProgressInitiationException>>defaultResumeValue Receiver: ProgressInitiationException: Arguments and temporary variables: Receiver's instance variables: messageText: nil tag: nil signalContext: ProgressInitiationException(Exception)>>signal handlerContext: nil outerContext: nil workBlock: [closure] in MetacelloSqueakPlatform>>do:displaying: maxVal: 2 minVal: 0 aPoint: 374@194 progressTitle: 'Fetching ConfigurationOfMetacelloPreview' ProgressInitiationException(Exception)>>resume Receiver: ProgressInitiationException: Arguments and temporary variables: Receiver's instance variables: messageText: nil tag: nil signalContext: ProgressInitiationException(Exception)>>signal handlerContext: nil outerContext: nil workBlock: [closure] in MetacelloSqueakPlatform>>do:displaying: maxVal: 2 minVal: 0 aPoint: 374@194 progressTitle: 'Fetching ConfigurationOfMetacelloPreview' ProgressInitiationException>>defaultAction Receiver: ProgressInitiationException: Arguments and temporary variables: Receiver's instance variables: messageText: nil tag: nil signalContext: ProgressInitiationException(Exception)>>signal handlerContext: nil outerContext: nil workBlock: [closure] in MetacelloSqueakPlatform>>do:displaying: maxVal: 2 minVal: 0 aPoint: 374@194 progressTitle: 'Fetching ConfigurationOfMetacelloPreview' UndefinedObject>>handleSignal: Receiver: nil Arguments and temporary variables: exception: ProgressInitiationException: Receiver's instance variables: nil MethodContext(ContextPart)>>handleSignal: Receiver: BlockClosure>>on:do: Arguments and temporary variables: exception: ProgressInitiationException: handlerActive: true val: nil Receiver's instance variables: sender: SmalltalkEditor(TextEditor)>>evaluateSelectionAndDo: pc: 32 stackp: 3 method: (BlockClosure>>#on:do: "a CompiledMethod(1831095)") closureOrNil: nil receiver: [closure] in SmalltalkEditor(TextEditor)>>evaluateSelectionAndDo: MethodContext(ContextPart)>>handleSignal: Receiver: BlockClosure>>on:do: Arguments and temporary variables: exception: ProgressInitiationException: handlerActive: true val: nil Receiver's instance variables: sender: MetacelloScriptEngine>>handleNotificationsForAction: pc: 32 stackp: 3 method: (BlockClosure>>#on:do: "a CompiledMethod(1831095)") closureOrNil: nil receiver: [closure] in MetacelloScriptEngine>>handleNotificationsForAction: MethodContext(ContextPart)>>handleSignal: Receiver: BlockClosure>>on:do: Arguments and temporary variables: exception: ProgressInitiationException: handlerActive: true val: nil Receiver's instance variables: sender: [] in MetacelloScriptEngine>>handleNotificationsForAction: pc: 32 stackp: 3 method: (BlockClosure>>#on:do: "a CompiledMethod(1831095)") closureOrNil: nil receiver: [closure] in [] in MetacelloScriptEngine>>load:onProjectDownGrade:onProjectUpgrade:...etc... ProgressInitiationException(Exception)>>signal Receiver: ProgressInitiationException: Arguments and temporary variables: Receiver's instance variables: messageText: nil tag: nil signalContext: ProgressInitiationException(Exception)>>signal handlerContext: nil outerContext: nil workBlock: [closure] in MetacelloSqueakPlatform>>do:displaying: maxVal: 2 minVal: 0 aPoint: 374@194 progressTitle: 'Fetching ConfigurationOfMetacelloPreview' ProgressInitiationException>>display:at:from:to:during: Receiver: ProgressInitiationException: Arguments and temporary variables: argString: 'Fetching ConfigurationOfMetacelloPreview' argPoint: 374@194 argMinVal: 0 argMaxVal: 2 argWorkBlock: [closure] in MetacelloSqueakPlatform>>do:displaying: Receiver's instance variables: messageText: nil tag: nil signalContext: ProgressInitiationException(Exception)>>signal handlerContext: nil outerContext: nil workBlock: [closure] in MetacelloSqueakPlatform>>do:displaying: maxVal: 2 minVal: 0 aPoint: 374@194 progressTitle: 'Fetching ConfigurationOfMetacelloPreview' ProgressInitiationException class>>display:at:from:to:during: Receiver: ProgressInitiationException Arguments and temporary variables: aString: 'Fetching ConfigurationOfMetacelloPreview' aPoint: 374@194 minVal: 0 maxVal: 2 workBlock: [closure] in MetacelloSqueakPlatform>>do:displaying: Receiver's instance variables: superclass: Notification methodDict: a MethodDictionary(#defaultAction->(ProgressInitiationException>>#d...etc... format: 65546 instanceVariables: #('workBlock' 'maxVal' 'minVal' 'aPoint' 'progressTitle') organization: ('handling' defaultAction defaultResumeValue) ('initialize-releas...etc... subclasses: nil name: #ProgressInitiationException classPool: a Dictionary(#PreferredProgressBarPosition->nil ) sharedPools: nil environment: Smalltalk category: #'ToolBuilder-Kernel' ByteString(String)>>displayProgressAt:from:to:during: Receiver: 'Fetching ConfigurationOfMetacelloPreview' Arguments and temporary variables: aPoint: 374@194 minVal: 0 maxVal: 2 workBlock: [closure] in MetacelloSqueakPlatform>>do:displaying: Receiver's instance variables: 'Fetching ConfigurationOfMetacelloPreview' --- The full stack --- MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)>>retryingResolvePackageSpecReferences:gofer: [] in MetacelloFetchingMCSpecLoader>>linearLoadPackageSpec:gofer: [] in MetacelloSqueakPlatform>>do:displaying: [] in [] in MorphicUIManager>>displayProgress:at:from:to:during: BlockClosure>>on:do: [] in MorphicUIManager>>displayProgress:at:from:to:during: BlockClosure>>ensure: MorphicUIManager>>displayProgress:at:from:to:during: ProgressInitiationException>>defaultResumeValue ProgressInitiationException(Exception)>>resume ProgressInitiationException>>defaultAction UndefinedObject>>handleSignal: MethodContext(ContextPart)>>handleSignal: MethodContext(ContextPart)>>handleSignal: MethodContext(ContextPart)>>handleSignal: ProgressInitiationException(Exception)>>signal ProgressInitiationException>>display:at:from:to:during: ProgressInitiationException class>>display:at:from:to:during: ByteString(String)>>displayProgressAt:from:to:during: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MetacelloSqueakPlatform>>do:displaying: MetacelloFetchingMCSpecLoader>>linearLoadPackageSpec:gofer: MetacelloPackageSpec>>loadUsing:gofer: [] in MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)>>linearLoadPackageSpecs:repositories: Array(SequenceableCollection)>>do: MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)>>linearLoadPackageSpecs:repositories: [] in MetacelloFetchingMCSpecLoader>>explicitLoadPackageSpecs:repositories: BlockClosure>>ensure: MetacelloLoaderPolicy>>pushLoadDirective:during: MetacelloLoaderPolicy>>pushExplicitLoadDirectivesDuring:for: MetacelloFetchingMCSpecLoader>>explicitLoadPackageSpecs:repositories: MetacelloPackageSpec>>explicitLoadUsing: MetacelloPackageSpec>>load MetacelloScriptEngine>>getConfigurationUnconditionalLoad: MetacelloScriptEngine>>getConfigurationProjectUnconditionalLoad: MetacelloMCProject>>projectForScriptEngine:unconditionalLoad: MetacelloMCProject(MetacelloProject)>>projectForScriptEngine: MetacelloMCConfigurationOfProjectSpec(MetacelloMCProjectSpec)>>versionForScriptEngine: [] in [] in MetacelloScriptEngine>>load:onProjectDownGrade:onProjectUpgrade: BlockClosure>>on:do: [] in MetacelloScriptEngine>>handleNotificationsForAction: BlockClosure>>on:do: MetacelloScriptEngine>>handleNotificationsForAction: [] in MetacelloScriptEngine>>load:onProjectDownGrade:onProjectUpgrade: BlockClosure>>ensure: MetacelloProjectRegistration class>>copyRegistryRestoreOnErrorWhile: MetacelloScriptEngine>>load:onProjectDownGrade:onProjectUpgrade: MetacelloScriptEngine>>load: [] in MetacelloScriptApiExecutor(MetacelloScriptExecutor)>>execute: [] in MetacelloScriptApiExecutor>>executeString:do: Array(SequenceableCollection)>>do: MetacelloScriptApiExecutor>>executeString:do: ByteString(String)>>execute:against: MetacelloScriptApiExecutor(MetacelloScriptExecutor)>>execute: Metacello>>execute Metacello>>load UndefinedObject>>DoIt Compiler>>evaluateCue:ifFail: Compiler>>evaluateCue:ifFail:logged: Compiler>>evaluate:in:to:notifying:ifFail:logged: [] in SmalltalkEditor(TextEditor)>>evaluateSelectionAndDo: BlockClosure>>on:do: -- and more not shown -- ```
LinqLover commented 2 years ago

Thanks for the feedback! Hm, this looks more like an unrelated VM error ...

@dalehenrich How much backward compatibility should Metacello support for older Squeak versions? The CI only runs on 5.2 and never.

dalehenrich commented 2 years ago

Backward compatibility is ultimately up to you. Even thought the CI might run only on newer versions of Squeak .. Metacello itself should continue to function on older versions as long as those older versions are still being used ... My approach is to use platform conditional code to preserve backward compatibility as I hate to have Metacello break for anyone :)

LinqLover commented 2 years ago

Alright, if we can maintain compatibility, I will do so.

Here are some notes from trying to load Metacello into older Squeak versions:

Apart from that, I could not figure out where a BlockContext would ever have been created (did not find any real senders of ContextPart >> #blockCopy:), so I will just assume that it needs to be supported.

LinqLover commented 2 years ago

Ah! Now I got the same SSL error as you @j4yk. In my case, using the latest VM rather than the 5.1 helped ...

LinqLover commented 2 years ago

Please review the addition of the new compatibility package. :-)

LinqLover commented 2 years ago

@dalehenrich unrelated question: Is there any reason why the installation instructions for Metacello send #get and #load to different Metacello instances? Is the only reason to keep the exception handler local to the loading phase?

dalehenrich commented 2 years ago

http://seaside.gemstone.com/ss

@LinqLover Vmware retained the gemstone.com domain name when we split off (10 years ago or so) and for a number of years they forwarded all requests to gemtalksystems.com. They stopped doing that about 5 years ago(?) and at the time I made a pass through large chunks of GLASS/GsDevKit ecosystem fixing those references ... so it's not surprising that I missed some, especially in older versions of platforms that I didn't have direct access to ...

BlockContext

Not quite sure about the that one ... If it's not sent then it isn't needed

ConfigurationOfMetacelloPreview

The EOCD errors occur when something happens to interrupt the download of an .mcz file ... and the remedy is to retry ... Metacello makes 3 attempts to donwload mcz files, since these types errors were much more common in the old days ... in fact there is a facility within Metacello where it will cycle through a sequence of different Monticello repositories in an effort to find a server that was up or download an mcz file without error :)

unrelated question: Is there any reason why the installation instructions for Metacello send #get and #load to different Metacello instances? Is the only reason to keep the exception handler local to the loading phase?

I don't recall my logic :) If I were to guess, I'd think that by making it two separate statements, it would be clearer to the folks not familiar with Metacello that once you've done a get, it isn't required as part of the load expression and folks who know what they are doing can optimize the expressions as they see fit :)

LinqLover commented 2 years ago

Thank you Dale! :-)

@LinqLover Vmware retained the gemstone.com domain name when we split off (10 years ago or so) and for a number of years they forwarded all requests to gemtalksystems.com. They stopped doing that about 5 years ago(?) and at the time I made a pass through large chunks of GLASS/GsDevKit ecosystem fixing those references ... so it's not surprising that I missed some, especially in older versions of platforms that I didn't have direct access to ...

It's not a mistake of Metacello, but of Squeak itself. I will bring up that topic on the squeak-dev mailing list.

LinqLover commented 2 years ago

I don't recall my logic :) If I were to guess, I'd think that by making it two separate statements, it would be clearer to the folks not familiar with Metacello that once you've done a get, it isn't required as part of the load expression and folks who know what they are doing can optimize the expressions as they see fit :)

Just a follow-up question, I'm not sure if I know what I'm doing: Would you expect any change in behavior if I merge both sends together into a single script in Squeak? :)

Metacello new
    baseline: 'Metacello';
    repository: 'github://Metacello/metacello:master/repository';
    load: #('default' 'Metacello-Help').
dalehenrich commented 2 years ago

@LinqLover, in a fresh image that does not have BaselineOfMetacello loaded, no ... However if there is an existing BaselineOfMetacello, then the get is necessary to pick up the (potentially) new version of BaselineOfMetacello ... which reminds that my logic may have been, that "it is good practice to use the get command when loading a new version of Metacello, because you never know when the BaselineOfMetacello has been changed" ... and this of course applies to all Metacello projects (monticallo and git based) ... :)

LinqLover commented 2 years ago

Quick follow-up, I just discovered a reason for this:

In an ancient version of Metacello (retrievable through the old bootstrap code), Metacello>>#execute invoked by Metacello>>#get looks like this:

image

So all the statements for baseline & Co. were reset after #get. Latest version of Metacello does not show this limitation any longer. So most likely, this trick is only required during bootstrapping. Thanks!