Stream: beginners

Topic: ✔ error while building compiler from source


view this post on Zulip Hrishikesh Dharam (Dec 03 2024 at 16:59):

I was picking up a stale PR and started getting this failure when trying to build the compiler

   Compiling roc_bitcode_bc v0.0.1 (/Users/hdharam/Documents/dev/roc/crates/compiler/builtins/bitcode/bc)
error: failed to run custom build command for `roc_bitcode v0.0.1 (/Users/hdharam/Documents/dev/roc/crates/compiler/builtins/bitcode)`

Caused by:
  process didn't exit successfully: `/Users/hdharam/Documents/dev/roc/target/debug/build/roc_bitcode-e1214b17feff2496/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=build.rs
  Compiling zig object `object` to: /Users/hdharam/Documents/dev/roc/crates/compiler/builtins/bitcode/zig-out/builtins-host.o

  --- stderr
  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>
  zig build object -Drelease=true failed with:

    error: Unexpected


  Location: crates/compiler/builtins/bitcode/build.rs:188:21

this is after running cargo clean and nix develop. I saw that other folks ran into similar issues while doing manual installs with an incorrect zig version, but I confirmed my zig version in the nix shell is correct.

$ which zig
/nix/store/xvw8ikyvk7jn2f3vj6xd9n1yxpgvk02r-zig-0.11.0/bin/zig

view this post on Zulip Anton (Dec 03 2024 at 17:11):

Can you execute git clean -X -d -f and try again?

view this post on Zulip Hrishikesh Dharam (Dec 03 2024 at 17:17):

that worked, thanks! just curious, do you have a guess why?

view this post on Zulip Notification Bot (Dec 03 2024 at 17:17):

Hrishikesh Dharam has marked this topic as resolved.

view this post on Zulip Anton (Dec 03 2024 at 17:19):

Your previous compilation outside of nix could have done weird stuff and cargo clean does not remove all files


Last updated: Jul 06 2025 at 12:14 UTC