Hello :) I tried building roc from source, and got a bunch of errors. Saw in ci that it uses zig 13. Why such an old version, if the compiler was recently rewritten in zig?
pretty sure it uses 0.15.2
https://github.com/roc-lang/roc/blob/main/BUILDING_FROM_SOURCE.md
I think maybe our old Rust compiler is still using zig 13 (the stdlib has always been in Zig, even back when the rest of the compiler was in Rust) because that was the latest version when we started the rewrite
https://github.com/roc-lang/roc/blob/main/.github/workflows/nightly_linux_x86_64.yml#L23 mentions 13, yes
I got a bunch of compilation errors with master and with 0.15.2, which is why I checked. Reinstalling zig now to make sure it's 0.15.2 and retrying
for reference, here's a recent zig master
~/drathier/roc$ /Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/zig build
/Users/drathier/.cache/zig/p/bytebox-0.0.1-SXc2seA2DwAUHbrqTMz_mAQQGqO0EVPYmZ89YZn4KsTi/build.zig:181:14: error: no field or member function named 'addCSourceFile' in 'Build.Step.Compile'
cffi_test.addCSourceFile(.{
~~~~~~~~~^~~~~~~~~~~~~~~
/Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/lib/std/Build/Step/Compile.zig:1:1: note: struct declared here
const builtin = @import("builtin");
^~~~~
/Users/drathier/.cache/zig/p/bytebox-0.0.1-SXc2seA2DwAUHbrqTMz_mAQQGqO0EVPYmZ89YZn4KsTi/build.zig:181:14: note: method invocation only supports up to one level of implicit pointer dereferencing
/Users/drathier/.cache/zig/p/bytebox-0.0.1-SXc2seA2DwAUHbrqTMz_mAQQGqO0EVPYmZ89YZn4KsTi/build.zig:181:14: note: use '.*' to dereference pointer
referenced by:
runBuild__anon_91509: /Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/lib/std/Build.zig:2226:33
dependencyInner__anon_87981: /Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/lib/std/Build.zig:2207:29
8 reference(s) hidden; use '-freference-trace=10' to see all references
/Users/drathier/.cache/zig/p/zstd-1.5.7-KEItkJ8vAAC5_rRlKmLflYQ-eKXbAIQBWZNmmJtS18q0/build.zig:51:26: error: no field or member function named 'addCSourceFiles' in 'Build.Step.Compile'
if (compression) zstd.addCSourceFiles(.{ .root = upstream.path("lib"), .files = compression_sources });
~~~~^~~~~~~~~~~~~~~~
/Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/lib/std/Build/Step/Compile.zig:1:1: note: struct declared here
const builtin = @import("builtin");
^~~~~
/Users/drathier/.cache/zig/p/zstd-1.5.7-KEItkJ8vAAC5_rRlKmLflYQ-eKXbAIQBWZNmmJtS18q0/build.zig:51:26: note: method invocation only supports up to one level of implicit pointer dereferencing
/Users/drathier/.cache/zig/p/zstd-1.5.7-KEItkJ8vAAC5_rRlKmLflYQ-eKXbAIQBWZNmmJtS18q0/build.zig:51:26: note: use '.*' to dereference pointer
build.zig:1797:28: error: operator > not allowed for type 'Io.Timestamp'
if (roc_stat.mtime > bin_stat.mtime) {
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/lib/std/Io.zig:875:23: note: struct declared here
pub const Timestamp = struct {
you try zig build roc?
~/drathier/roc$ /Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/zig build roc
/Users/drathier/.cache/zig/p/bytebox-0.0.1-SXc2seA2DwAUHbrqTMz_mAQQGqO0EVPYmZ89YZn4KsTi/build.zig:181:14: error: no field or member function named 'addCSourceFile' in 'Build.Step.Compile'
cffi_test.addCSourceFile(.{
~~~~~~~~~^~~~~~~~~~~~~~~
/Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/lib/std/Build/Step/Compile.zig:1:1: note: struct declared here
const builtin = @import("builtin");
^~~~~
/Users/drathier/.cache/zig/p/bytebox-0.0.1-SXc2seA2DwAUHbrqTMz_mAQQGqO0EVPYmZ89YZn4KsTi/build.zig:181:14: note: method invocation only supports up to one level of implicit pointer dereferencing
/Users/drathier/.cache/zig/p/bytebox-0.0.1-SXc2seA2DwAUHbrqTMz_mAQQGqO0EVPYmZ89YZn4KsTi/build.zig:181:14: note: use '.*' to dereference pointer
referenced by:
runBuild__anon_91509: /Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/lib/std/Build.zig:2226:33
dependencyInner__anon_87981: /Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/lib/std/Build.zig:2207:29
8 reference(s) hidden; use '-freference-trace=10' to see all references
/Users/drathier/.cache/zig/p/zstd-1.5.7-KEItkJ8vAAC5_rRlKmLflYQ-eKXbAIQBWZNmmJtS18q0/build.zig:51:26: error: no field or member function named 'addCSourceFiles' in 'Build.Step.Compile'
if (compression) zstd.addCSourceFiles(.{ .root = upstream.path("lib"), .files = compression_sources });
~~~~^~~~~~~~~~~~~~~~
/Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/lib/std/Build/Step/Compile.zig:1:1: note: struct declared here
const builtin = @import("builtin");
^~~~~
/Users/drathier/.cache/zig/p/zstd-1.5.7-KEItkJ8vAAC5_rRlKmLflYQ-eKXbAIQBWZNmmJtS18q0/build.zig:51:26: note: method invocation only supports up to one level of implicit pointer dereferencing
/Users/drathier/.cache/zig/p/zstd-1.5.7-KEItkJ8vAAC5_rRlKmLflYQ-eKXbAIQBWZNmmJtS18q0/build.zig:51:26: note: use '.*' to dereference pointer
build.zig:1797:28: error: operator > not allowed for type 'Io.Timestamp'
if (roc_stat.mtime > bin_stat.mtime) {
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/Users/drathier/Downloads/zig-aarch64-macos-0.16.0-dev.1634+b27bdd5af/lib/std/Io.zig:875:23: note: struct declared here
pub const Timestamp = struct {
^~~~~~
got it building now, thanks for helping out!
what was the issue?
not sure, unfortunately. I reinstalled zig with brew
Last updated: Jan 12 2026 at 12:19 UTC