How to use zig master?
I got this error:
% roc effects.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 'cannot find `str.zig`. Check the source code in find_zig_str_path() to show all the paths I tried.', crates/compiler/build/src/link.rs:217:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Failed to (re)build platform.: Any { .. }', crates/cli/src/build.rs:329:46
rfrolow@MacBook-Pro-Roman cli % roc effects.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 'cannot find `str.zig`. Check the source code in find_zig_str_path() to show all the paths I tried.', crates/compiler/build/src/link.rs:217:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Failed to (re)build platform.: Any { .. }', crates/cli/src/build.rs:329:46
% zig version
0.11.0-dev.740+4d2372139
We are using zig 0.9.1, using a later zig version requires us to use a newer llvm version and such an upgrade is a significant undertaking
% roc effects.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 'cannot find `str.zig`. Check the source code in find_zig_str_path() to show all the paths I tried.', crates/compiler/build/src/link.rs:217:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Failed to (re)build platform.: Any { .. }', crates/cli/src/build.rs:329:46
% zig version
0.9.1
Still the same with zig 0.9.1
% uname -a
Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103 arm64
right this is a problem with where the roc
binary is located. I thought this was fixed but it isn't
did you build roc from source? or download a nightly?
I have used zvm
% type -a zig
zig is /Users/rfrolow/.zvm/bin/zig
zig is /Users/rfrolow/.local/zig/current/zig
And used roc nightly
Copying the crates folder from the nightly archive to your current directory should fix it
I have downloaded latest roc nightly
% roc effects.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 'cannot find `str.zig`. Check the source code in find_zig_str_path() to show all the paths I tried.', crates/compiler/build/src/link.rs:217:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Failed to (re)build platform.: Any { .. }', crates/cli/src/build.rs:329:46
rfrolow@MacBook-Pro-Roman cli % roc version
roc nightly pre-release, built from commit 61a2091 on Tue Jan 10 10:12:45 UTC 2023
Just to make sure, did you see my "Copying the crates folder ..." message?
% cp -r ~/bin/roc/crates .
% roc effects.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 host.zig:
The executed command was:
zig build-obj effects-platform/host.zig -femit-bin=effects-platform/macos-arm64.o --pkg-begin str crates/compiler/builtins/bitcode/src/str.zig --pkg-end --pkg-begin compiler_rt /Users/rfrolow/.zvm/0.9.1/lib/std/special/compiler_rt.zig --pkg-end --library c
stderr of that command:
thread 4862958 panic: Darwin is handled separately via std.zig.system.darwin module
Unable to dump stack trace: debug info stripped
', crates/compiler/build/src/link.rs:1565:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Failed to (re)build platform.: Any { .. }', crates/cli/src/build.rs:329:46
% RUST_BACKTRACE=full roc effects.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 host.zig:
The executed command was:
zig build-obj effects-platform/host.zig -femit-bin=effects-platform/macos-arm64.o --pkg-begin str crates/compiler/builtins/bitcode/src/str.zig --pkg-end --pkg-begin compiler_rt /Users/rfrolow/.zvm/0.9.1/lib/std/special/compiler_rt.zig --pkg-end --library c
stderr of that command:
thread 4864538 panic: Darwin is handled separately via std.zig.system.darwin module
Unable to dump stack trace: debug info stripped
', crates/compiler/build/src/link.rs:1565:21
stack backtrace:
0: 0x1019ef264 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1543c132bc4e188c
1: 0x100fa61b8 - core::fmt::write::hda8e8eb84b49cbfc
2: 0x1019e82a8 - std::io::Write::write_fmt::hb84c8996aec7120c
3: 0x1019f3ad4 - std::panicking::default_hook::{{closure}}::hdf06011cb093de6a
4: 0x1019f3854 - std::panicking::default_hook::hd7ceb942fff7b170
5: 0x1019f3f14 - std::panicking::rust_panic_with_hook::h053d4067a63a6fcb
6: 0x1019f3e48 - std::panicking::begin_panic_handler::{{closure}}::hea9e6c546a23e8ff
7: 0x1019f27b4 - std::sys_common::backtrace::__rust_end_short_backtrace::hd64e012cf32134c6
8: 0x1019f3be0 - _rust_begin_unwind
9: 0x102b29ec0 - core::panicking::panic_fmt::hbfde5533e1c0592e
10: 0x101245aec - roc_build::link::run_build_command::h4563bb953baf1571
11: 0x101243e88 - roc_build::link::rebuild_host::hce09d69f007c058a
12: 0x1012e22f0 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha9cba79ee629deed
13: 0x1012e3734 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hfca4c32f9d06da5f
14: 0x1019f89d8 - std::sys::unix::thread::Thread::new::thread_start::h403ab16d5f453cd4
15: 0x18979d06c - __pthread_deallocate
thread 'main' panicked at 'Failed to (re)build platform.: Any { .. }', crates/cli/src/build.rs:329:46
stack backtrace:
0: 0x1019ef264 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1543c132bc4e188c
1: 0x100fa61b8 - core::fmt::write::hda8e8eb84b49cbfc
2: 0x1019e82a8 - std::io::Write::write_fmt::hb84c8996aec7120c
3: 0x1019f3ad4 - std::panicking::default_hook::{{closure}}::hdf06011cb093de6a
4: 0x1019f3854 - std::panicking::default_hook::hd7ceb942fff7b170
5: 0x1019f3f14 - std::panicking::rust_panic_with_hook::h053d4067a63a6fcb
6: 0x1019f3e48 - std::panicking::begin_panic_handler::{{closure}}::hea9e6c546a23e8ff
7: 0x1019f27b4 - std::sys_common::backtrace::__rust_end_short_backtrace::hd64e012cf32134c6
8: 0x1019f3be0 - _rust_begin_unwind
9: 0x102b29ec0 - core::panicking::panic_fmt::hbfde5533e1c0592e
10: 0x102b29fac - core::result::unwrap_failed::h68832e989a8867c1
11: 0x1012f6230 - roc_cli::build::build_file::h18139e750a24eedc
12: 0x101302f28 - roc_cli::build::h2d3f29c0bfa23bdf
13: 0x1011a4f60 - roc::main::hab8c9c4e8028ea9c
14: 0x1011a01e0 - std::sys_common::backtrace::__rust_begin_short_backtrace::h38e22666ac1f42be
15: 0x1011a0200 - std::rt::lang_start::{{closure}}::hcb067392c5a3e3cf
16: 0x1019e1518 - std::rt::lang_start_internal::hef2161f9571a51d7
17: 0x1011a7758 - _main
Ah yes, we do not yet support macos 13 yet. This is due to an issue with zig 9.1.
We have a warning for that on the macos getting started. Do you know how we can increase the chance of users like yourself noticing this warning?
Oh, I saw this. But I am not a native english speaker, and somehow understood it that most things should work with zig :)
Right, I'll put the not
in bold :)
I wish your first roc experience had gone smoother, we'll keep improving things until it's delightful :smile:
Last updated: Jul 06 2025 at 12:14 UTC