Thanks to our new rust docs I discovered debug_flags and am currently trying to use it but not having much luck. I'm sure there is an obvious answer.
//! Flags for debugging the Roc compiler.
//!
//! Lists environment variable flags that can be enabled for verbose debugging features in debug
//! builds of the compiler.
I've updated my .cargo/config
and changed the flags to "1"
. I'm using nix with nix develop
, then cargo build
, and then try to run an example with ./target/debug/roc examples/helloWorld.roc --debug
but it doesn't print anything. What am I missing here?
The --debug
flag is not relevant to this. That's for debugging the application that the compiler produces. But these flags are for debugging the compiler itself.
I don't actually know how to use them from that cargo config thing, I've never used them that way.
The way I do it is
MY_ROC_FLAG=1 ./target/debug/roc examples/helloWorld.roc
Or actually more often
MY_ROC_FLAG=1 cargo run examples/helloWorld.roc
Since if you are debugging the compiler it's probably because you just changed some of its source code and you need to rebuild it
This might be more of a "contributing" topic really!
Luke Boswell said:
Thanks to our new rust docs I discovered debug_flags and am currently trying to use it but not having much luck. I'm sure there is an obvious answer.
//! Flags for debugging the Roc compiler. //! //! Lists environment variable flags that can be enabled for verbose debugging features in debug //! builds of the compiler.
I've updated my
.cargo/config
and changed the flags to"1"
. I'm using nix withnix develop
, thencargo build
, and then try to run an example with./target/debug/roc examples/helloWorld.roc --debug
but it doesn't print anything. What am I missing here?
Can we make the nav bar static please?
Please refer the https://ziglang.org/documentation/0.9.1/ for reference
Yeah if you set them in .cargo/config you’ll need to rebuild with “cargo run”. If you have a debug build of the compiler you can just set the vars when calling the roc binary directly as Brian mentioned.
Last updated: Jul 06 2025 at 12:14 UTC