Stream: beginners

Topic: Should dbg work with `roc run` ?


view this post on Zulip Ricardo (Apr 01 2024 at 18:43):

Hey, all!

I'm playing around with the dbg stuff from the tutorial. While it works fine when I use roc dev, when using roc run it's not showing up. I even tried to redirect stderr to a file and still nothing:

$ roc run 2> out.log
There are 5 animals!
$ cat out.log
$

With roc dev this does work:

$ roc dev 2> out.log
There are 5 animals!
$ cat out.log
[main.roc:19] T "num1 is " num1 = (T "num1 is " 2)

Is this a bug? Or am I misunderstanding something?

view this post on Zulip Karakatiza (Apr 01 2024 at 18:47):

No, dbg only compiles into "dev" builds, like dev and test

view this post on Zulip Brendan Hansknecht (Apr 01 2024 at 18:53):

Long term it should be possible to enable on any compilation, but first we have to do some internal plumbing around how expect works (the two features are tied together).

view this post on Zulip Ricardo (Apr 01 2024 at 18:57):

Got it, thanks for the replies. I was asking because the documentation from the tutorial does mention roc run:

Note: dbg is a debugging tool, and is only available when running your program via a roc subcommand (for example using roc dev, roc run, or roc test).

Still, not a big issue, I was just wondering if I had misunderstood something or botched the installation somehow :grinning_face_with_smiling_eyes:

view this post on Zulip Anton (Apr 02 2024 at 09:11):

Fixed in PR#6619


Last updated: Jul 06 2025 at 12:14 UTC