I'm not able to get dbg
to print anything in the basic-cli example. I tried modifying examples/args.roc
:
main =
dbg "dbg print"
Stdout.line! "std print"
args = Arg.list! {}
....
but only Stdout is printing:
jared@jared-laptop:~/External/basic-cli$ ./examples/args
std print
I thought maybe my terminal wasn't printing stderr for some reason, but I tried changing roc_dbg
to use println
instead of eprintln
but it's still not showing
As far as I can tell roc_dbg
isn't being called at all. Does it need a compiler flag?
You need to use roc dev main.roc
or I think roc main.roc
also
If you build the app it is currently stripped out... but we have plans to change this
ty
I don't think I'm currently able to do that. I'm currently having to build with --linker=legacy
jared@jared-laptop:~/External/basic-cli$ roc examples/args.roc
🔨 Rebuilding platform...
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
failed to open file "examples/../platform/dynhost": No such file or directory (os error 2)
Location: crates/linker/src/lib.rs:552:29
If I use roc
instead of roc build
, I think it's quietly failing? At least the args example doesn't seem to be running:
jared@jared-laptop:~/External/basic-cli$ roc --linker=legacy ./examples/args.roc
🔨 Rebuilding platform...
jared@jared-laptop:~/External/basic-cli$
You can pass the args by using an --
and then pass the args after
$ roc --linker=legacy ./examples/args.roc -- firstArg secondArg
I'm not really trying to use the Args program, I was just using it to try to figure out if dbg not working was an issue with my platform or in general
what I was saying above is for some reason if I just do roc
the args example doesn't seem to run at all
Ahk, there is a rust specific bug that I know of where args aren't passed on linux
It's not related to roc specifically
https://github.com/roc-lang/basic-cli/issues/82
We upgraded to 1.79 but I think the bug is still there for some reason
What version of rust are you using?
This isn't an issue with the commandline arguments. Lemme clarify:
when I use roc build
and run the app manually:
jared@jared-laptop:~/External/basic-cli$ roc build --linker=legacy examples/args.roc
🔨 Rebuilding platform...
0 errors and 0 warnings found in 1271 ms
while successfully building:
examples/args
jared@jared-laptop:~/External/basic-cli$ ./examples/args
std print??
Error: A subcommand must be called.
Usage:
args-example [options]
args-example <COMMAND>
when I use just roc
:
jared@jared-laptop:~/External/basic-cli$ roc --linker=legacy ./examples/args.roc
🔨 Rebuilding platform...
jared@jared-laptop:~/External/basic-cli$
rustc 1.79.0 (129f3b996 2024-06-10)
meh nm I just forced platform to rebuild and now roc
on its own is working
Note, we want dbg
to be usable with roc build
. It is just currently tangled to expect
. expect
has not been updated yet. So it can only be used when the compiler executes a binary (like with roc some-app.roc
). Until expect
is updated or decoupled from dbg
, neither can work with roc build ...
.
#6930 if anyone is interested in taking a crack at this.
Last updated: Jul 06 2025 at 12:14 UTC