I was browsing through the roc-awesome list and found raytrace.roc that I thought might be fun to run.
I tried roc dev main.roc
and got a couple errors about Nat
. Fortunately, I had been browsing around Zulip today to get a little more aquatinted with roc and remembered seeing that Nat
=> U64
in most cases, so I tried that, and those errors went away.
But then I tried again and got this error, and tried searching on Zulip and on Google, but didn't find anything useful to help me fix the problem. Any ideas how to fix this?
$ roc dev main.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
thread '<unnamed>' panicked at 'Error:
Failed to rebuild src/lib.rs:
The executed command was:
cargo build --lib
stderr of that command:
error: failed to load manifest for dependency `roc_std`
Caused by:
failed to read `/Users/glenn/src/github.com/shritesh/roc/crates/roc_std/Cargo.toml`
Caused by:
No such file or directory (os error 2)
', crates/compiler/build/src/link.rs:1422:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Failed to (re)build platform.: Any { .. }', crates/compiler/build/src/program.rs:985:46
They made their platform depend on compiler related libraries being in a relative path.
So they expect the compiler source to be downloaded in a folder next to the repo folder
raytracer.roc/....
roc/...
Thank you, @Brendan Hansknecht !
I made a soft link, and that got me a little further:
glenn@glenn-MacM2Pro ~/src/github.com/shritesh $ ln -s /usr/local/roc roc
glenn@glenn-MacM2Pro ~/src/github.com/shritesh $ cd raytrace.roc/
glenn@glenn-MacM2Pro ~/src/github.com/shritesh/raytrace.roc (main) $ roc run main.roc
🔨 Rebuilding platform...
ld: Undefined symbols:
_roc__mainForHost_1__Init_caller, referenced from:
__ZN4host4init17h51d45c6082d34a62E in macos-arm64.o
_roc__mainForHost_1__Init_result_size, referenced from:
__ZN4host4init17h51d45c6082d34a62E in macos-arm64.o
_roc__mainForHost_1__Init_size, referenced from:
__ZN4host4init17h51d45c6082d34a62E in macos-arm64.o
_roc__mainForHost_1__Render_caller, referenced from:
__ZN4host17update_and_render17h516626b2a4b3bdc9E in macos-arm64.o
_roc__mainForHost_1__Render_result_size, referenced from:
__ZN4host17update_and_render17h516626b2a4b3bdc9E in macos-arm64.o
_roc__mainForHost_1__Render_size, referenced from:
__ZN4host17update_and_render17h516626b2a4b3bdc9E in macos-arm64.o
_roc__mainForHost_1__Update_caller, referenced from:
__ZN4host17update_and_render17h516626b2a4b3bdc9E in macos-arm64.o
_roc__mainForHost_1__Update_result_size, referenced from:
__ZN4host17update_and_render17h516626b2a4b3bdc9E in macos-arm64.o
__ZN53_$LT$host..State$u20$as$u20$core..ops..drop..Drop$GT$4drop17h9a1563490ac4f818E in macos-arm64.o
_roc__mainForHost_1__Update_size, referenced from:
__ZN4host17update_and_render17h516626b2a4b3bdc9E in macos-arm64.o
main: No such file or directory
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` (or `zig` in the case of wasm with --optimize) returning exit code Some(1)', crates/compiler/build/src/program.rs:1052:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Any more ideas, or should I just consider this to be an outdated example?
Probably wouldn't be that hard to fix, but definitely stale at this point. Not sure how long the tail of fixes would be.
In this case, the next step would be to dump the llvm ir and figure out the new function names.
OK, thanks again, @Brendan Hansknecht ! I'll pass for now.
Last updated: Jul 06 2025 at 12:14 UTC