How to generate identically image file after snapshots

John M McIntosh johnmci at smalltalkconsulting.com
Wed Aug 1 08:15:37 UTC 2007


On Jul 31, 2007, at 6:52 AM, Martin Troielli wrote:

> Hi Avi,
>
> The main goal is to certify a software development. The certifier  
> must to check that a set of source files produce a binary output.
>
> We give them:
> 1 - The final image and VM
> 2 - The Smalltalk source files (fileOuts of our development)
> 3 - The VM C source files
> 4 - The base image
> 5 - A make script that compiles the VM, filesIn the smalltalk  
> source files on the base image and produces a final images and VM.
>
> They need to check that the two images, the one we give (1) and the  
> generated by our script (5) are the same. They check the  
> differences by doing a binary diff plus a hash over the files. They  
> only could allow changes refered to timestamps. They don't know  
> anything about Smalltalk...
>
> Best regards,
> Martin

12 years back I had a client like this. Let's see if I remember...

you could try doing

| m |
m := OrderedCollection new.
SystemNavigation default allBehaviorsDo: [ :behavior |
	behavior selectors do: [ :sel |
		decompiled := Decompiler new decompile: sel in: behavior.
		m add: decompiled]].
^m

where you sort the behaviors by the class name, then sort the  
selectors and instead of collecting the decompiled value you
stream the print string out to a stream. This should give you all the  
source code for the image in a sorted order which you then can
compare as text files.

Think of it as decompiling the binary to see if the assembly  
instructions are the same.

What's missing is the globals and class variable values, but you  
might not need those... ?


Perhaps even a file out of all the methods in the image after the  
build might help?

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===





More information about the Squeak-dev mailing list