Updating GT.gs and load in to GemStone

Use this loop to update GT.gs and load it into the local GemStone stone. If $GT_CURRENT_DIR isn't defined, it is probably the working directory of the gtoolkit mcp server.

  1. Regenerate the GemStone export through the GToolkit MCP server:

        
GtGemStoneGtCodeExporter new export
        
      
This updates $GT_CURRENT_DIR/gt4gemstone/src-gs/GT.gs.

  1. Run the loader:

        
$GT_CURRENT_DIR/gt4gemstone/scripts/loadGsGt.sh
        
      
Output is captured in $CURRENT_DIR/loadGsGt.log. The last 10 lines of the log file are written by the script to enable a quick check of success or not (errorCount should be 0). The execution sandbox blocks socket creation, including connections to the local NetLDI on akgd:50377 (it fails with Operation not permitted). Run this command with escalated sandbox permission so it can reach the local netldid process. A normal sandbox run can misleadingly report that the stone service cannot be found.

  1. Inspect the end of loadGsGt.log. If the load fails because of an

undefined class — for example, undefined symbol GtRBNamespace — check the the superclass, if it is Exception or Error, add exactly that class name to the array of classes by evaluating GtGemStoneGtCodeExporter class>>#addAdditionalClassName: with the undefined class name, otherwise add exactly that class name by evaluating GtGemStoneGtCodeExporter class>>#addStubClassName: with the undefined class name, then return to step 1. If the undefined symbol is Smalltalk, add the failing method reference (for example, GtLClassCreationDataExtractor>>#extractTargetClassNameIfError:) to GtGemStoneGtCodeExporter>>#excludedMethodsList, preserving the existing literal array and pragma, then return to step 1. If the undefined symbol is thisContext, add the failing method reference (for example, GtLClassCreationDataExtractor>>#extractTargetClassNameIfError:) to GtGemStoneGtCodeExporter>>#excludedMethodsList, preserving the existing literal array and pragma, then return to step 1. If the error is 'missing end of literal mark', add the failing method reference (for example, GtLClassCreationDataExtractor>>#extractTargetClassNameIfError:) to GtGemStoneGtCodeExporter>>#excludedMethodsList, preserving the existing literal array and pragma, then return to step 1. If the error is 'The object was not a block or a non-literal expression' (or equivalent), caused by a symbol being used in place of a block closure, e.g. anObject ifNotNil: #doSomething, replace it in GT with the equivalent block closure, e.g. anObject ifNotNil: [ :obj | obj doSomething ].

  1. If the error is none of the conditions listed above symbol,

stop the loop and report the current state, including the failing class/method and the relevant error from loadGsGt.log.

  1. In the GToolkit MCP server, update the source exporter when necessary.

- Read GtGemStoneGtCodeExporter>>#stubClasses4 with getCodeOfMethods. - To add a missing class, compile the complete updated method with compileMethods. Preserve the existing list and add the missing class to the returned literal array. Useful checks:

        
tail -n 80 $GT_CURRENT_DIR/loadGsGt.log
rg -n 'CompileError|undefined symbol|Error Category|Fatal' $GT_CURRENT_DIR/loadGsGt.log | tail -n 20