[Vm-dev] [Pharo-dev] Image crashing on startup, apparently during GC

K K Subbu kksubbu.ml at gmail.com
Sun Apr 1 03:56:32 UTC 2018


On Sunday 01 April 2018 06:49 AM, tim Rowledge wrote:
> Maybe I should offer a snippet that sticks a big warning as a comment
> in front of every single generated routine "This code was generated
> from XXXX on DDDDDD:HHMMSS and should not be edited let alone edited
> and pushed back into SCCS"
I think there are two problems mixed up here. One is about sticking meta 
data tags like version control tags into generated source code. This is 
an easier problem to solve with Git.

The second, and more difficult one, is that an artifact is dependent on 
two types of sources only one of which can be compiled directly by 
automated builds. The other type (auto generated from .st) requires 
manual intervention during compiling and intermediate code needs to be 
preserved for debugging.

What if Slang could append a version hash at the end of the generated 
file and use a special extension (say *.cpk) to mark such augmented files?

	HASH=xxxxxxxx

Build scripts can use this hash file to decide if the corresponding .c 
file needs to be compiled or not:

foo.hash : foo.cpk
	update foo.hash iff its HASH differs from that in foo.cpk

foo.o  : foo.hash
	unpack foo.c from foo.cpk
  	compile foo.c to get foo.o

A CPK could also concat a compressed C file with a HASH line and the C
part could be extracted by the build script. It will deter people from 
editing a pack file while still allowing access to intermediate code for 
VM developers.

If a single ST coded component generates multiple *.[ch] files, they 
could all be packed into a single file and share the same hash. Build 
scripts can unpack and recompile individual files if the hash changes.

Regards .. Subbu


More information about the Vm-dev mailing list