[squeak-dev] SqueakCore
Pavel Krivanek
squeak1 at continentalbrno.cz
Sun Dec 30 14:07:20 UTC 2012
On Sun, Dec 30, 2012 at 2:35 PM, H. Hirzel <hannes.hirzel at gmail.com> wrote:
> On 12/30/12, Pavel Krivanek <squeak1 at continentalbrno.cz> wrote:
>> Hi,
>>
>> this is the first unkempt attempt to produce SqueakCore image from
>> Squeak4.4-12324. It generates 3 MB dirty image (3.2 with Unicode
>> tables). Some overrides have only logging purpose.
>>
>> Cheers,
>> -- Pavel
>>
>
> Hello Pavel and others
>
> Thank you for your first attempt.
>
> I assume I have to file in first
> patch001.st
this file makes it all, the name is a little bit confusing. Tt should
be passed as command line argument to a fresh image. It was tested
only on Linux.
> as it contains various dummy classes and fixes to existing classes.
> (DummyProject, DummyUIManager, ,.... ClassOrganizer, PointerFinder,
> ScriptLauncher, ...)
this is the list of rewrites:
AutoStart class>>startUp:
- this method must be rewriten to make network and plugin usage optional
ReadOnlyVariableBinding>>value:
- ad hoc patch for writes of Undelclared, I guess it can be solved
with propper exception handling without modifying of this method
SmalltalkImage>>snapshot:andQuit:embedded:
- some minor things like "Project current wakeUpTopWindow." should be
delegated to UIManager
SmalltalkImage>>send:toClassesNamedIn:with:
- only logging to stdout added, can be removed
SmalltalkImage>>setPlatformPreferences
- SoundPlayer direct usage must be removed
Encoder>>undeclared:
- only logging to stdout added, can be removed
Behavior>>compileAllFrom:
- only logging to stdout added, can be removed
DisplayScreen>>newDepthNoRestore:
- delegation to UIManager, MorphicUIManager implementation should be added
String>>translated
- need some nice refactoring to make GetText package dependency optional
>
> However the attached error comes up and a debugger in method
> primWrite: id from: stringOrByteArray startingAt: startIndex count: count
>
> of MultiByteFileStream
>
> This is on a Windows 7 machine with a recent VM.
>
> Could anybody else check the file-in of Pavel's patch001.st as well?
>
> The the info.st file is copied in below [1].
>
> It refers to the class FileSystem, a class which is not (yet) in
> Squeak. The Squeak equivalent would be FSFileSystem.
This part of the script can be removed or rewriten for Squeak, it was
used by CI server in the past.
>
> A minimal installation for the Filesystem in Squeak is
>
> (Installer wiresong project: 'mc')
> addPackage: 'FS-Core';
> addPackage: 'FS-Disk';
> addPackage: 'FS-Tests-Core';
> addPackage: 'FS-Tests-Disk';
> install.
>
> So we need to adapt info.st and patch001.st
>
> and besides FSFilesystem maybe other artefacts have to be loaded into
>
> http://www.squeakci.org/job/SqueakTrunk/
>
>
>
> Regards
>
> Hannes
>
>
>
> Note:
> In Squeak we have for example
>
> root := FSFilesystem onDisk root.
>
> whereas in Pharo it is
>
> root := FileSystem disk root.
>
> besides this I have not found any other differences yet.
>
>
>
>
>
>
>
>
> [1] Pavel's info.st file
>
>
>
> [
>
> | info lines dict unimplemented sends unsent o printWithReferences
> printedObjects |
>
> info := "(((Smalltalk vm getSystemAttribute: 3) ifNil: [FileSystem
> disk workingDirectory] ifNotNilDo: [:path | FileSystem disk
> workingDirectory resolve: path])"
> FileStream forceNewFileNamed: 'info.txt'.
>
>
> Undeclared removeUnreferencedKeys.
>
> info nextPutAll: 'Project: ', Project current ; cr; cr.
>
> info nextPutAll: 'Processes: ' ; cr; cr.
> Process allInstances do: [:p |
> info nextPutAll: ' - ', p asString; cr].
>
>
> info nextPutAll: Project uiProcess asString; cr.
>
> "
> TextConstants associationsDo: [:a |
> info nextPutAll: a key, ' -> ', ([a value asString] ifError: ['ERROR']); cr.].
> "
>
>
> info cr.
>
>
> info nextPutAll: 'globals:', ((Smalltalk globals associations select:
> [:a | a value isBehavior not]) collect: [:a | a key ] )asString; cr.
>
>
>
>
> info nextPutAll: 'Obsolete:'; cr.
> info nextPutAll: SystemNavigation default obsoleteClasses asString; cr; cr.
>
> printedObjects := IdentitySet new.
>
> printWithReferences := [:object :depth |
> depth <= 3 ifTrue: [
> depth timesRepeat: [info tab].
> (printedObjects includes: object)
> ifTrue: ["info nextPutAll: '*****'; cr"]
> ifFalse: [
> printedObjects add: object.
> [info nextPutAll: object asString; cr.] ifError: [info nextPutAll:
> '--- PRINT ERRROR ---'; cr].
> (PointerFinder pointersTo: object) do: [:ref |
> printWithReferences value: ref value: depth+1].]
> ]].
>
> o := SystemNavigation default obsoleteClasses select: [:oc | oc
> allInstances size > 0].
> info nextPutAll: o asString; cr.
> o := nil.
>
> Smalltalk garbageCollect.
>
> info cr.
>
> "printWithReferences value: (SystemNavigation default obsoleteClasses
> at: 1) value: 1."
>
>
>
> info cr.
>
> info nextPutAll: 'Behaviors count:'; cr.
> info nextPutAll: Smalltalk allClassesAndTraits size asString; cr; cr.
>
> info nextPutAll: 'Undeclared:'; cr.
> info nextPutAll: Undeclared asString; cr; cr.
>
> info nextPutAll: 'Undeclared sorted by name:'; cr.
>
> dict := IdentityDictionary new.
> Smalltalk allClassesAndTraits do: [:c |
> c localSelectors do: [:sel |
> dict at: (c compiledMethodAt: sel) put: (c -> sel)].
> c isTrait ifFalse: [
> c class localSelectors do: [:sel |
> dict at: (c class compiledMethodAt: sel) put:
> (c class -> sel)]]].
>
> lines := SortedCollection new.
>
> Undeclared associations do: [:assoc |
> info nextPutAll: assoc key; cr.
> [
> ((PointerFinder pointersTo: assoc) select: [:ref | ref class =
> CompiledMethod]) do: [:cm |
> info nextPutAll: ' - ', (dict at: cm ifAbsent: ['method not
> found']) asString; cr.
> lines add: (dict at: cm) key asString, ' >> ', (dict at: cm)
> value asString, ' (', assoc key asString, ')'. ]
> ] ifError: [:e | info nextPutAll: '--error-- ', e asString; cr.]].
>
> info cr; nextPutAll: 'Undeclared sorted by class:'; cr.
> lines do: [:l | info nextPutAll: l asString; cr.].
>
> info cr.
>
>
>
> info nextPutAll: 'Unimplemented calls size:'; space.
> info nextPutAll: SystemNavigation default allUnimplementedCalls size asString.
> info cr; cr.
> info nextPutAll: 'Unimplemented calls:'; cr; cr.
> unimplemented := SystemNavigation default allUnimplementedCalls
> asSortedCollection.
> sends := OrderedCollection new.
> unimplemented do: [:call |
> | pos |
> pos := (call findString: ' calls: ').
> ((call allButFirst: (pos + 7)) findTokens: ' ') do: [:send |
> sends add: (send asString, ' calledBy: ', (call first: pos))].
> info nextPutAll: call asString; cr.].
> info cr.
> sends asSortedCollection do: [:call |
> info nextPutAll: call asString; cr.].
>
> "
> unsent := SystemNavigation default allUnsentMessages.
>
> info cr; nextPutAll: 'Unsent messages size: '; nextPutAll: unsent size
> asString; cr; cr.
> info cr; nextPutAll: 'Unsent messages:'; cr.
> unsent asSortedCollection do: [:message | info nextPutAll: message; cr. ].
> "
>
> info cr; nextPutAll: 'allClassesAndTraits:'.
> Smalltalk allClassesAndTraits do: [:c | info nextPutAll: c name
> asString; space]. info cr.
>
> info cr; nextPutAll: 'finished...'.
>
> info close.
>
> SmalltalkImage current snapshot: false andQuit: true.
>
>
> ] ifError: [:e |
> | rep |
> rep := FileStream forceNewFileNamed: 'PharoDebug.log'.
> rep nextPutAll: 'info.st'; cr.
> rep nextPutAll: 'Error:'; cr.
> rep nextPutAll: e asString; cr.
> rep nextPutAll: thisContext stack size asString.
> thisContext stack copy withIndexDo: [:stck :i |
> [rep nextPutAll: i asString; space; nextPutAll: stck
> asString; cr]
> ifError: []].
> rep close.
> Smalltalk exitFailure]
>
>
>
More information about the Squeak-dev
mailing list
|