Loading
Draft: localExec under pythonmonkey: run Node's evaluator as the sandbox
Supersedes !303 (closed).
localExec() under pythonmonkey uses Node's own evaluator as the sandbox. pmEvaluatorFactory() returns a Worker-shaped SandboxConstructor that starts node libexec/evaluator-node.js <files> through evaluator-pm-parent.py (pythonmonkey has no child_process) and speaks the lib/standaloneWorker.js wire protocol over its stdio. Callers pass the node sandbox definition files; there is no separate pythonmonkey sandbox definition. Node.js on the PATH is required, as for the rest of PythonMonkey.
build/bundle: gives node.exe a Windows path for dcpClientDestination when cygpath is available (carried over from !303 (closed)).
Sequencing
- PythonMonkey #518 adds a
structuredClone()global; the supervisor needs it. - This MR.
- dcp !3327 calls
pmEvaluatorFactory()fromjob.localExec(). It needssandboxDefinitions['node']instead of['pythonmonkey'].
Tested
- From PythonMonkey 1.4.1 on macOS arm64: every
nodesandbox definition file reportsscriptLoaded(including the Pyodide worktime), the sandbox posts__sandboxLoaded, andterminate()leaves noevaluator-node.jsprocess. - Not yet: a full
job.localExec()(needs dcp !3327), Linux, Windows.
Edited by Dan Desjardins