Updating GT.gs and load in to GemStone
Use this loop to update GT.gs and load it into the local GemStone stone.
1. Regenerate the GemStone export through the GToolkit MCP server:
GtGemStoneGtCodeExporter new export
$GT_CURRENT_DIR/gt4gemstone/src-gs/GT.gs.
2. Run the loader:
./loadGsGt.sh
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.
3. 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 ].
4. 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.
5. 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