[squeak-dev] SqueakCore

H. Hirzel hannes.hirzel at gmail.com
Sun Dec 30 13:35:11 UTC 2012


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

as it contains various dummy classes and fixes to existing classes.
(DummyProject, DummyUIManager, ,.... ClassOrganizer, PointerFinder,
ScriptLauncher, ...)


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.

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]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestSqueak4.4-12324-Failure-Loading-PavelK-patch001-for-minimal-image.gif
Type: image/gif
Size: 53108 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20121230/a6dd16bc/TestSqueak4.4-12324-Failure-Loading-PavelK-patch001-for-minimal-image.gif


More information about the Squeak-dev mailing list