Levente pointed out that while Cog has this primitive, the Interpreter VM doesn't, and so his Inbox submission (http://source.squeak.org/inbox/System-ul.528.mcz) can't really go into Trunk yet.
Given that this is something that I feel strongly about - I need this primitive so that builds will actually _fail_ and not continue trying random things on things in random states - it seems likely that I'll be the one to implement the thing.
SO. How might I go about porting the Cog version? Do I simply start to Read the Source?
frank
Levente pointed out that while Cog has this primitive, the Interpreter VM doesn't, and so his Inbox submission (http://source.squeak.org/inbox/System-ul.528.mcz) can't really go into Trunk yet.
Given that this is something that I feel strongly about - I need this primitive so that builds will actually _fail_ and not continue trying random things on things in random states - it seems likely that I'll be the one to implement the thing.
SO. How might I go about porting the Cog version? Do I simply start to Read the Source?
Sure, start by looking at the source. But also open a mantis issue in category "VM", because IIRC there are C platform source changes involved in addition to the Smalltalk, and you may want changes to the squeak start script to pass the return value from the squeakvm executable back.
I recall doing a trivial implemention of this for the interpreter (which is indeed trivial), but Eliot also added some platform support for reasons that I can't recall at the moment (but maybe a search of vm-dev from that time period will find it).
Dave
On Tue, Oct 15, 2013 at 6:23 AM, Frank Shearar frank.shearar@gmail.comwrote:
Levente pointed out that while Cog has this primitive, the Interpreter VM doesn't, and so his Inbox submission (http://source.squeak.org/inbox/System-ul.528.mcz) can't really go into Trunk yet.
Given that this is something that I feel strongly about - I need this primitive so that builds will actually _fail_ and not continue trying random things on things in random states - it seems likely that I'll be the one to implement the thing.
SO. How might I go about porting the Cog version? Do I simply start to Read the Source?
Get commit rights to trunk. Refactor ioExit(void) into ioExit(void) and ioExitWithErrorCode(int) (you can take the code from the Cog branch). Then add the primitive to VMMaker trunk. Then sit back and bask in the feeling of a job well done.
cheers! e.
On 15-10-2013, at 6:23 AM, Frank Shearar frank.shearar@gmail.com wrote:
Levente pointed out that while Cog has this primitive, the Interpreter VM doesn't, and so his Inbox submission (http://source.squeak.org/inbox/System-ul.528.mcz) can't really go into Trunk yet.
Given that this is something that I feel strongly about - I need this primitive so that builds will actually _fail_ and not continue trying random things on things in random states - it seems likely that I'll be the one to implement the thing.
SO. How might I go about porting the Cog version? Do I simply start to Read the Source?
The Cog version in platforms/unix/sqUnixMain.c is -
int ioExit(void) { return ioExitWithErrorCode(0); }
sqInt ioExitWithErrorCode(int ec) { #if COGVM extern sqInt reportStackHeadroom; if (reportStackHeadroom) reportMinimumUnusedHeadroom(); #endif printPhaseTime(3); dpy->winExit(); exit(ec); return ec; }
so the plain interp version (in platforms/unix/sqUnixMain.c - who'd guess!) needs to change from sqInt ioExit(void) { dpy->winExit(); exit(0); }
to something like
sqInt ioExit(void) { ioExitWithErrorCode(0); }
sqInt ioExitWithErrorCode(int ec) { dpy->winExit(); exit(ec); return ec; }
And we need to update the platforms/Cross/sq .h file to add sqInt ioExitWithErrorCode(int);
Then in the plain interp VMMakerpackage InterpreterPrimitives>primitiveQuit becomes primitiveQuit
self ioExitWithErrorCode: (argumentCount = 1 ifTrue: [objectMemory integerValueOf: self stackTop] ifFalse: [0])
Simple. Though we have to get all the platform code updated sensibly synchronously, which always more of a getting everyone organised problem than anything else.
I've committed the Cross/sq.h and RiscOS/vm/sqRPCMain.c changes. Ian is still caring for the unix code but who able to do the Mac & Windows changes?
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim The enema of my enemy is my friend
Hi Ian,
Attached are updates to support exit from the VM with an error status. Background on Mantis http://bugs.squeak.org/view.php?id=7792. The files are:
unix/vm/sqUnixMain.c win32/vm/sqWin32Window.c Mac OS/vm/sqMacMain.c
Tim has done the updates for Cross and RiscOS, and the iOS tree already has this support. I will make the update to VMM and generate new ./src for SVN.
I've tested the unix update, and the changes are trivial enough that I would suggest doing the updates for Windows and Mac at the same time. I'm not sure how we should handle win32 and Mac tree updates in the future, but if you can make the updates to all three trees this time around, that would be a good thing.
Thanks! Dave
On Tue, Oct 15, 2013 at 10:56:37AM -0700, tim Rowledge wrote:
And we need to update the platforms/Cross/sq .h file to add sqInt ioExitWithErrorCode(int);
Then in the plain interp VMMakerpackage InterpreterPrimitives>primitiveQuit becomes primitiveQuit
self ioExitWithErrorCode: (argumentCount = 1 ifTrue: [objectMemory integerValueOf: self stackTop] ifFalse: [0])
Simple. Though we have to get all the platform code updated sensibly synchronously, which always more of a getting everyone organised problem than anything else.
I've committed the Cross/sq.h and RiscOS/vm/sqRPCMain.c changes. Ian is still caring for the unix code but who able to do the Mac & Windows changes?
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim The enema of my enemy is my friend
vm-dev@lists.squeakfoundation.org