https://www.boundaryml.com logo
🟑 Debugging issue using BAML in Golang app
# questions
u
Hi there! I'm trying out BAML in our Golang app and it's working pretty good, I think it may be the perfect solution for our needs but there's a big issue. When using BAML the
dlv
debugger in VS Code stops working. With this I mean, I set a breakpoint, run the program using the debugger:
Copy code
json
{
    "name": "Launch API",
    "type": "go",
    "request": "launch",
    "mode": "auto",
    "program": "${workspaceFolder}/cmd/api/main.go",
    "cwd": "${workspaceFolder}",
    "env": {
        "APP_ENV": "local"
    }
}
I make a request to hit the breakpoint, in theory the breakpoint is hit but nothing changes in VS Code, looks like the program still didn't hit and the request hangs there until I stop the debugger, then the endpoint gets the response and the program stops. I'm using
BAML v0.210.0
with
go1.24.4 darwin/arm64
and delve 1.25.2. As soon as I stop importing BAML the debugger goes back to working as normal again. Did anyone experienced this before? Is kind of a dealbreaker to using BAML πŸ˜”
a
interesting, maybe @Vaibhav (BAML πŸ‘) has some insight into it, but he'll be busy in the next few days. We'll look into this!
v
Oh interesting. I wonder if CGO has some weird interactions with the debugger here
Ok that looks like a good hypothesis. Mac seems to have this issue https://github.com/go-delve/delve/issues/3701
https://chatgpt.com/share/68e4a40e-53a0-800d-a57f-4216b3025247 based on this conversation. My hunch says the actions on that github thread should solve the issue! It looks like some mismatch of cxx + what Xcode installs for the go tool chain
(It’s late but I’ll try and review during the week!)