As you know we are getting close to Advent of Code -- and should have the compiler in a state that we can use it (for those brave enough).
If you have some time and would like to help, it would be great if you could try out the new compiler using a test platform and report any bugs or issues you find.
We've just started adding the builtins - so many functions are just missing an implementation. Feel free to make a PR if you can.
Here is a video I clipped showing how you can use the new compiler today.
It's using the fx test platform, so only has Stdio effects available... and only works when built locally (not from a URL release) -- but that's all you need to get started solving AoC puzzles and trying out the new static dispatch and syntax.
We're resolving bugs in a tight loop (think hours not days) right now, so if you find any issues I would suggest letting us know in zulip and remember to sync with main as PR's land.
Looking forward to working with you all on Roc and preparing for AoC again this year :smile:
Is there another step here to build libhost.a on a non-windows platform? I'm running into this failing-to-find-host-path error case locally on linux.
Hmm, did you run zig build test?
Yeah; maybe some test is being skipped? I got 1533 passed on roc version debug-9e509c53.
I will try it on linux later today.
I noticed fx_platform_test.zig now. If I run zig build test -- --test-filter 'fx platform' no tests are run, so I think that's getting skipped for some reason.
It needs to be 'fx_platform', that works for me, does it work for you?
I was able to reproduce the issue on linux
I hit that error as well on NixOs. Did zig build and zig build test before. Then with zig-out/bin/roc test/fx/app.roc I get:
error: Failed to resolve platform spec './platform/main.roc': error.PlatformNotSupported
I also hit this issue on NixOS. build.zig has a check like target.query.isNativeCpu() and target.query.isNativeOs() and target.query.isNativeAbi() on line 816 and that'll be false on my machine since I'm using native CPU, native OS, but not native ABI (it's using musl not glibc). So I switched that to is_native (an existing variable with exactly this distinction). However, the tests fail and I'll attach the output.
I'll try to take care of this issue tomorrow.
I'm blown away by how fast ./zig-out/bin/roc test/fx/app.roc is. It just goes BRRRT! Can't wait to use this compiler for everything... everything.
Are there any WIP docs I can use while trying this out, or should I just look at the source code to figure out what’s available and where I can help out? I just built the compiler on macOS, and that part went great. :slight_smile:
I'm going to try to post some tonight
I tried to run a simple "hello world" program with the compiler using the following Roc file:
app [main!] { pf: platform "/Users/kevin/src/roc/test/fx/platform/main.roc" }
import pf.Stdout
main! = || {
Stdout.line!("Hello, World!")
}
But running roc year2024day01.roc produced the following error message:
~/prj/advent-of-code $ roc year2024day01.roc
Roc crashed: Error evaluating from shared memory: TypeMismatch
error: Failed to run with POSIX fd inheritance: error.ProcessExitedWithError
Am I doing something silly here? I'm running on the latest version of macOS and have the compiler running at debug-c442c8a0.
if you have the repo checked out, what happens if you do (from the repo root) roc test/fx/app.roc?
Richard Feldman said:
if you have the repo checked out, what happens if you do (from the repo root)
roc test/fx/app.roc?
That seems to work fine.
~/src/roc (main) $ zig-out/bin/roc test/fx/app.roc
Hello from stdout!
Line 1 to stdout
Line 2 to stderr
Line 3 to stdout
Error from stderr!
hm, maybe it's unhappy about the absolute path?
for the platform location
What if you rename the file to app.roc (rename the existing one)? I tried a few things and the filename seems to have an impact for me.
It doesn't seem like a relative path helped. I changed the platform path to ../../src/roc/test/fx/platform/main.roc and got the same error. Renaming the file to app.roc did not work either.
What did work was coping the platform into the root of the directory where the file is and then reference it using a relative path (app [main!] { pf: platform "./platform/main.roc" }).
Perhaps I was mistaken in thinking I could reference a platform outside my project directory?
To give context about the filename:
./zig-out/bin/roc test/fx/appc.roc
error: Child process /home/niclas/.cache/roc/43d450a451cacf424d42033893679acf/temp/roc-tmp-22donbk0q9xGfZH0fwb5a2jfUHqhJGXb/roc_run_349899816 killed by signal: 11
error: Child process crashed with segmentation fault (SIGSEGV)
error: Failed to run with POSIX fd inheritance: error.ProcessKilledBySignal
./zig-out/bin/roc test/fx/app.roc
Hello, World!
Same file contents
I'll take a look at the relative path thing
the name appc.roc works for me, but that is WILD
Yeah, my wife tells me I'm pretty crazy
Richard Feldman said:
I'll take a look at the relative path thing
Worth noting is that it only seems to work when the platform starts with ./path/to/platform. I tried moving the file from <PROJECT_ROOT>/year2024day01.roc into <PROJECT_ROOT>/year2024/day01.roc but then I got the same error because the platform path started with ../ now.
➜ roc_zig git:(main) ✗ cp test/fx/appc.roc test/fx/app.roc
➜ roc_zig git:(main) ✗ bat test/fx/app.roc
─────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: test/fx/app.roc
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ app [main!] { pf: platform "./platform/main.roc" }
2 │
3 │ import pf.Stdout
4 │ import pf.Stderr
5 │
6 │ main! = || {
7 │ Stdout.line!("Hello from stdout!")
8 │ Stdout.line!("Line 1 to stdout")
9 │ Stderr.line!("Line 2 to stderr")
10 │ Stdout.line!("Line 3 to stdout")
11 │ Stderr.line!("Error from stderr!")
12 │ }
─────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
➜ roc_zig git:(main) ✗ bat test/fx/appc.roc
─────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: test/fx/appc.roc
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ app [main!] { pf: platform "./platform/main.roc" }
2 │
3 │ import pf.Stdout
4 │ import pf.Stderr
5 │
6 │ main! = || {
7 │ Stdout.line!("Hello from stdout!")
8 │ Stdout.line!("Line 1 to stdout")
9 │ Stderr.line!("Line 2 to stderr")
10 │ Stdout.line!("Line 3 to stdout")
11 │ Stderr.line!("Error from stderr!")
12 │ }
─────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
➜ roc_zig git:(main) ✗ ./zig-out/bin/roc test/fx/app.roc
Hello from stdout!
Line 1 to stdout
Line 2 to stderr
Line 3 to stdout
Error from stderr!
➜ roc_zig git:(main) ✗ ./zig-out/bin/roc test/fx/appc.roc
error: Child process /home/niclas/.cache/roc/43d450a451cacf424d42033893679acf/temp/roc-tmp-MxVgzDoyVPsmTvDDcEvMe750Tm0mrDPP/roc_run_349899816 killed by signal: 11
error: Child process crashed with segmentation fault (SIGSEGV)
error: Failed to run with POSIX fd inheritance: error.ProcessKilledBySignal
idk man, my computer is drunk :joy:
is this on current main? so, 587c53210286757876478579d2c17cd59f834198
I just tried what @Niclas Ahden mentioned on my machine (M1 MBP on macOS 15.16.1) and ./zig-out/bin/roc test/fx/appc.roc ran without a problem on 587c53210286757876478579d2c17cd59f834198.
Nope, I was on df66010948. Pulled 587c532102, git clean -dfx, re-added this diff:
diff --git i/build.zig w/build.zig
index 57fb74fa51..d9d0c6bd4d 100644
--- i/build.zig
+++ w/build.zig
@@ -1044,7 +1044,7 @@ pub fn build(b: *std.Build) void {
const is_windows = target.result.os.tag == .windows;
// fx platform effectful functions test - only run when not cross-compiling
- if (target.query.isNativeCpu() and target.query.isNativeOs() and target.query.isNativeAbi()) {
+ if (is_native) {
// Create fx test platform host static library
const test_platform_fx_host_lib = createTestPlatformHostLib(
b,
Rebuilt with zig build, then:
./zig-out/bin/roc test/fx/app.roc
error: Child process /home/niclas/.cache/roc/8a126c1a3b33ced3831765bc6d91e1bc/temp/roc-tmp-LPoA9CbVzOVdzCLySvGz5YtBiD4lWT8i/roc_run_792223834 killed by signal: 11
error: Child process crashed with segmentation fault (SIGSEGV)
error: Failed to run with POSIX fd inheritance: error.ProcessKilledBySignal
I'll try the same on my Mac.
Works perfectly on the Mac (ARM). Not on NixOS (x86) sadly.
ok see if it works on this branch: https://github.com/roc-lang/roc/pull/8461
(I'm guessing probably still doesn't work on NixOS but relative paths should work better!)
Richard Feldman said:
ok see if it works on this branch: https://github.com/roc-lang/roc/pull/8461
I tried rebuilding the compiler but got:
test
└─ tests_summary
└─ run test fx_platform_test 12/13 passed, 1 failed
error: 'fx_platform_test.test.fx platform with dotdot starting path' failed: Run failed with exit code 1
STDOUT:
STDERR:
Roc crashed: Error evaluating from shared memory: TypeMismatch
error: Failed to run with POSIX fd inheritance: error.ProcessExitedWithError
/Users/kevin/src/roc/src/cli/test/fx_platform_test.zig:146:17: 0x1005c908b in test.fx platform with dotdot starting path (fx_platform_test)
return error.RunFailed;
^
error: while executing test 'fx_platform_test.test.fx platform checked directly finds sibling modules', the following test command failed:
./.zig-cache/o/8b01e086a989ec45c18eb3c0c3b150b3/fx_platform_test --cache-dir=./.zig-cache --seed=0x73d04778 --listen=-
Build Summary: 54/57 steps succeeded; 1 failed; 1590/1591 tests passed; 1 failed
test transitive failure
└─ tests_summary transitive failure
└─ run test fx_platform_test 12/13 passed, 1 failed
error: the following build command failed with exit code 1:
.zig-cache/o/cc6d41c01a0793b6188e07ef840af6b0/build /Users/kevin/.asdf/installs/zig/0.15.2/zig /Users/kevin/.asdf/installs/zig/0.15.2/lib /Users/kevin/src/roc .zig-cache /Users/kevin/.cache/zig --seed 0x73d04778 -Za49efdac55e7b81a test
I could verify that the branch fixes the relative path issue. No build error unlike Kevin.
(and it still doesn't work on NixOS as expected)
@Kevin Hovsäter what OS are you running?
Richard Feldman said:
Kevin Hovsäter what OS are you running?
M1 MBP on macOS 15.16.1.
M1 MBP on macOS 26.1 (25B78)
so weird! I don't know what the issue is
FYI here is the WIP tutorial I'm working on - just have the very basics so far https://gist.github.com/rtfeldman/f46bcbfe5132d62c4095dfa687bb9aa4
we do actually have bundled platforms working, so in theory we could package up the test/fx/ platform for all the different OSes and distribute it, but we should probably try to get NixOS working first
@Kevin Hovsäter if you do zig build without running tests, and then run the compiled roc manually, does that work?
Richard Feldman said:
so weird! I don't know what the issue is
I'm heading to bed, but I can try to investigate further tomorrow!
Double-checking:
zig build test
✅ All 1591 tests passed.
I'm on x86_64-linux-gnu and experiencing the same issue.
Richard Feldman said:
FYI here is the WIP tutorial I'm working on - just have the very basics so far https://gist.github.com/rtfeldman/f46bcbfe5132d62c4095dfa687bb9aa4
Whether grabbing the nightly like in this tutorial or building from source, I can't get the fx platform to work either. Initially, I get
$ roc version
Roc compiler version release-fast-299268c2
$ roc test/fx/app.roc
error: Failed to resolve platform spec './platform/main.roc': error.PlatformNotSupported
After adjusting build.zig to actually build test/fx/platform/libhost.a, the error becomes
$ roc test/fx/app.roc
error: Child process /home/timob/.cache/roc/387646676cd876895a972bc305e43fc4/temp/roc-tmp-KBw2ppRjjpmtiooxunMoZ47aR77MhrJ5/roc_run_792223834 killed by signal: 11
error: Child process crashed with segmentation fault (SIGSEGV)
error: Failed to run with POSIX fd inheritance: error.ProcessKilledBySignal
I can't seem to usefully attach a debugger to anything, so my investigation unfortunately has had to stop here so far.
I'll try to debug that tonight
I tried fix-segfault/ca81b2916 but that didn't affect this issue. Happy to test more tomorrow, good night!
8 messages were moved from this topic to #contributing > Help prepare for AoC 2025 - Testing a platform from URL by Luke Boswell.
Anton said:
I'll try to take care of this issue tomorrow.
I have not looked into this yet, I'll prioritize it tomorrow.
Last updated: Nov 28 2025 at 12:16 UTC