starlark icon indicating copy to clipboard operation
starlark copied to clipboard

Debug Starlark Program Directly

Open wulixzCN opened this issue 3 years ago • 2 comments

I am using Starlark language to develop the project recently. I wanna know can I debug the Starlark Program directly? I read some documents like bazel, starlark debugger,etc. but no result... Ask for help.

wulixzCN avatar May 23 '22 10:05 wulixzCN

Bazel, which uses the Java implementation of Starlark, has a BUILD-file debugger, which uses some hooks in the interpreter, but there is no debugger for pure Starlark outside of Bazel. You could build one by modifying the Bazel code, though I would not regard the debug API as stable, and there is certainly a lot of room for improvement.

(In the Go implementation of Starlark, I once started work on a debugger but put it aside and don't expect to return to it any time soon.)

adonovan avatar May 23 '22 13:05 adonovan

There is actually a DAP debugger in the Rust Starlark code - https://github.com/facebookexperimental/starlark-rust/tree/main/starlark/bin/dap is the code, but it's hard to integrate with projects that extend Starlark. But you can debug a pure-Starlark program.

ndmitchell avatar May 23 '22 15:05 ndmitchell