Is there anyone online who could help me test running roc with a platform from URL?
Sure thing. :blush:
Can you build roc from source off this branch https://github.com/roc-lang/roc/pull/8464
zig build roc
And then run this app
app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.1-test/LKroJZnzRzHS2JPYcWa6bEdFN129zawLf5ub8CrYgcH.tar.zst" }
import pf.Stdout
main! = || {
Stdout.line!("Hello World")
}
Let me know what machine / os / arch your on if you run it please -- it's working for me on my arm64 Mac
Seems to be working nicely. I'm running on a M1 MBP (macOS 15.6.1).
For anyone interested here is the zig platform template I used to generate that package https://github.com/lukewilliamboswell/roc-platform-template-zig/tree/0.1
8 messages were moved here from #announcements > Help prepare for AoC 2025 by Luke Boswell.
@Luke Boswell would it make sense to have a way to read the entirely of Stdin or are we imagining people just looping over Stdin.line! until "" is reached?
This is just a template to show how to create a simple platform... I copied the Fx test platform verbatim.
I would love to see people experiment with different ideas for platform API's and capabilities
My immediate goal is to get something working for AoC
I see, that makes sense. :slight_smile:
Pushed some fixes to that branch... and now we have x64 Windows running from a URL too! :smiley:
C:\Users\bosyl\Documents\Github\roc>zig build roc
C:\Users\bosyl\Documents\Github\roc>roc test.roc
Hello World
And ... I get a segfault on x64 linux :tear:
I just tried to build the Roc compiler using zig build test and now my "hello, world" program isn't running anymore. I just get error: Failed to set up shared memory with ModuleEnv: error.InvalidAppPath when trying to run the program.
This is on d28a978d8b957f3b88dbc92dcbbc6a87ffb0e8f4 on a M1 MBP on macOS 15.16.1.
Interesting... I'll have a closer look tomorrow
@Kevin Hovsäter just to make sure we're on the same page, these details would be helpful:
@Richard Feldman
what's the source code of the .roc file?
~/prj/advent-of-code $ cat hello.roc
app [main!] { pf: platform "./platform/main.roc" }
import pf.Stdout
main! = || {
Stdout.line!("Hello, world!")
}
what directory is the .roc file in?
~/prj/advent-of-code $ tree
.
├── hello.roc
└── platform
├── host.zig
├── libhost.a
├── main.roc
├── Stderr.roc
├── Stdin.roc
└── Stdout.roc
2 directories, 7 files
- what command are you using to run the program?
- what directory are you in when you run the command?
~/prj/advent-of-code $ roc hello.roc
error: Failed to set up shared memory with ModuleEnv: error.InvalidAppPath
~/prj/advent-of-code $ which roc
/Users/kevin/src/roc/zig-out/bin/roc
Roc was built using zig build test and I copied the platform from test/fx/platform into ~/prj/advent-of-code.
excellent, thank you!
fix for this: https://github.com/roc-lang/roc/pull/8471
Tried to build your branch but got the following errors:
~/src/roc (fix-dir-bug) $ zig build test
test
└─ tests_summary
└─ run test fx_platform_test 14/16 passed, 2 failed
error: 'fx_platform_test.test.fx platform opaque type with method' failed: Run failed with exit code 1
STDOUT:
STDERR: error: Child process /Users/kevin/Library/Caches/roc/3db62731d7e536d5d9c27137f68b7c5a/temp/roc-tmp-knVzb0gLfOcUKmevHkXrzfZb8Q6PxsNs/roc_run_1170380953 killed by signal: 11
error: Child process crashed with segmentation fault (SIGSEGV)
/Users/kevin/src/roc/src/cli/test/fx_platform_test.zig:585:17: 0x102489d67 in test.fx platform opaque type with method (fx_platform_test)
return error.RunFailed;
^
error: 'fx_platform_test.test.fx platform run from different cwd' failed: Run failed with exit code 1
STDOUT:
STDERR: error: Failed to set up shared memory with ModuleEnv: error.InvalidAppPath
/Users/kevin/src/roc/src/cli/test/fx_platform_test.zig:672:17: 0x10248ad37 in test.fx platform run from different cwd (fx_platform_test)
return error.RunFailed;
^
error: while executing test 'fx_platform_test.test.fx platform run from different cwd', the following test command failed:
./.zig-cache/o/a3568d4bddc2e60f4e000977a4db93f6/fx_platform_test --cache-dir=./.zig-cache --seed=0x75600522 --listen=-
Build Summary: 54/57 steps succeeded; 1 failed; 1615/1617 tests passed; 2 failed
test transitive failure
└─ tests_summary transitive failure
└─ run test fx_platform_test 14/16 passed, 2 failed
error: the following build command failed with exit code 1:
.zig-cache/o/e6d6ec7fb8dbc0a4bd0962fb69f26247/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 0x75600522 -Zf8f5c3ff46d8dde4 test
ah it's a stale roc binary - I just pushed something to that branch to force rebuilding it for the tests
That did indeed work! And now both absolute and relative paths seem to work as expected! :tada:
Can I get more folks to help me test this?
app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.1-test/LKroJZnzRzHS2JPYcWa6bEdFN129zawLf5ub8CrYgcH.tar.zst" }
import pf.Stdout
main! = || {
Stdout.line!("Hello World")
}
Build roc from source on the bundle-changes branch
9:33:19 ~/Documents/GitHub/roc bundle-changes $ zig build roc
9:42:28 ~/Documents/GitHub/roc bundle-changes $ roc test.roc
Hello World
Specifically any linux users
I've got it working on all three OS's now -- if https://github.com/roc-lang/roc/pull/8464 passes we should be good for supporting basic platforms from URL's
I hate to say it, but on x86_64 linux I get
$ zig-out/bin/roc main.roc
error: Child process /home/timob/.cache/roc/c17e6c1672ab85bbfeb20617f7710e69/temp/roc-tmp-Rj9qhjzcZYcolwSXZm4NfPCDD31RecAU/roc_run_733124949 killed by signal: 11
error: Child process crashed with segmentation fault (SIGSEGV)
with
$ cat main.roc
app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.1-test/LKroJZnzRzHS2JPYcWa6bEdFN129zawLf5ub8CrYgcH.tar.zst" }
import pf.Stdout
main! = || {
Stdout.line!("Hello World")
}
and
$ zig-out/bin/roc version
Roc compiler version debug-c4550425
$ git show --oneline
c455042522 (HEAD) Merge pull request #8464 from roc-lang/bundle-changes
main doesn't build for me right now and bundle-changes seems to have been deleted, so I checked out the merge commit directly.
maindoesn't build for me right now
I'm looking into this.
I've been updating the release URL as I fix things, maybe that is related?
Last updated: Nov 28 2025 at 12:16 UTC