FYI, I just built roc from source using the latest code (Roc compiler version debug-d9e3492d), and it panics on a simple hello world program using a platform:
app [main!] {
pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.7/DuRUyJh31Gt41YArMcVcvybLa2bCWboccWQ7Zq1KZPZ6.tar.zst",
}
import pf.Stdout
main! = |_args| {
Stdout.line!("Hello, World!")
Ok({})
}
Here's the output:
thread 5132 panic: reached unreachable code
/zig-x86_64-linux-0.16.0/lib/std/debug.zig:420:14: 0x4979ce9 in assert (std.zig)
if (!ok) unreachable; // assertion failure
^
/roc/src/parse/NodeStore.zig:3056:21: 0x6327ad9 in getTargetsSection (mod.zig)
std.debug.assert(node.tag == .targets_section);
^
/roc/src/compile/targets_config.zig:274:56: 0x63246f4 in fromAST__anon_280027 (mod.zig)
const targets_section = store.getTargetsSection(targets_section_idx);
^
/roc/src/cli/platform_validation.zig:96:41: 0x89412d8 in validatePlatformHeader (main.zig)
const config = TargetsConfig.fromAST(allocator, ast) catch {
^
/roc/src/cli/main.zig:1426:55: 0x890812f in rocRun (main.zig)
if (platform_validation.validatePlatformHeader(ctx.arena, ctx.io.std_io, platform_source)) |validation| {
^
/roc/src/cli/main.zig:824:19: 0x4b0764e in mainArgs (main.zig)
rocRun(&ctx, run_args) catch |err| switch (err) {
^
/roc/src/cli/main.zig:707:13: 0x4b05592 in main (main.zig)
mainArgs(gpa, arena, args, init.io) catch |err| {
^
/zig-x86_64-linux-0.16.0/lib/std/start.zig:737:30: 0x497879d in callMain (std.zig)
return wrapMain(root.main(.{
^
/zig-x86_64-linux-0.16.0/lib/libc/musl/src/env/__libc_start_main.c:95:7: 0xc4fdc2f in libc_start_main_stage2 (/zig-x86_64-linux-0.16.0/lib/libc/musl/src/env/__libc_start_main.c)
exit(main(argc, argv, envp));
^
Unwind error at address `/proc/self/exe:0xc4fdc2f` (unwind info unavailable), remaining frames may be incorrect
Note that the following does work:
main! = |_args| {
echo!("Hello")
Ok({})
}
So perhaps it's something to do with platforms?
Richard pushed a change to the targets section yesterday to support custom things for WASM see https://github.com/roc-lang/roc/pull/9585
I assumed it wouldn't be a breaking change to other platforms, but I guess it has broken the templates. I can have a look at patching that and making a new release
Now that I'm looking at it... it's definitely just that. Should be a quick fix.
I'm tracking this PR https://github.com/roc-lang/roc/pull/9586 as another breaking change for platforms... so we might have two releases in quick succession depending on how things land in main
My platform CI is broken on Windows... I'll have to investigate that tomorrow.
I'll add a CI check for Luke's platform that is allowed to fail (to avoid complex release coordination) but so that we do get alerted immediately.
I don't think we need it @Anton -- I think the breaking changes for platforms are normally rare and much more coordinated (certainly once we have basic-cli online etc)... it's just right now we're making some changes while it's less disruptive. I think after the C ABI thing there is nothing on the radar for a long time.
Maybe I should add a CI runner in my platform that bumps the Roc commit daily and runs the test suite?
Actually, I already test your platform after the nightlies are published: https://github.com/roc-lang/nightlies/blob/main/hello_world_test.roc
Curious... I'm going to need to dig into @Aurélien Geron's repro above a bit more I think. Something suspicious is going on here
On macos I get:
Run ./roc_nightly-macos_apple_silicon-2026-06-10-1ded9f8/roc nightlies-repo/hello_world_test.roc
-- UNSUPPORTED TARGET ----------------------------
The platform at /Users/runner/.cache/roc/packages/DuRUyJh31Gt41YArMcVcvybLa2bCWboccWQ7Zq1KZPZ6/main.roc
does not support the arm64mac target for exe builds.
This platform has no targets configured for exe builds.
To add support, update the targets section in the platform header.
If you do find the issue and feel like cutting a release of the platform anytime in the next 10 hours r so, here's the PR https://github.com/lukewilliamboswell/roc-platform-template-zig/pull/31
You're welcome to make any changes.
I am somewhat hoping Richard lands the C ABI PR before (my) tomorrow morning and I can include that too. :smiley:
yes, and heads up there are more breaking Host ABI changes coming :sweat_smile:
after C ABI, namely weak linking - basically making it so that RocOps becomes a behind-the-scenes thing used by the interpreter, and hosts never actually see it anymore; instead they link symbols like the old compiler used to, except now with dead code elimination (e.g. so Hello World in basic-cli no longer includes all of sqlite :smile:)
so it'll mean better runtime performance, smaller compiled binaries, still a uniform ABI for all hosts, but it'll be a breaking change (also another platform syntax change: a new section where platform authors explicitly specify what the symbol names of the hosted functions will be, instead of the old system where we would just prefix with roc_ and call it a day)
so that will be a second PR (still WIP locally) on top of the C ABI PR
I think that will be the last breaking platform change for awhile though!
and of course it'll update Glue to generate the right new thing
Cool. Sounds like a nice improvement.
Im definitely going to wait for those to land then before I update and release my platforms.
Last updated: Jun 16 2026 at 16:19 UTC