I got migrate-zig-compiler built. but I have a FAQ entry: i now have libhost.a in the basic-cli directory. how do I use that in my roc-project dir?
If you use ./build.sh that will build the libraries in the platform/targets/ folder... so you should then be able to run an example, roc examples/hello_world.roc
You will note the examples use ../platform/main.roc instead of a URL -- they are using a relative path to the platform package instead of a URL release
yes, but should I copy platform/targets into my project dir? As a general question, that I don't honestly know the answer to. I'm sure that would work, but it feels clunky. I've got my "roc project" on one hand, and the "basic-cli" platform on the other. Or does the basic-cli repo then subsume my project? (i doubt it). How do I connect the outputs of basic-cli to my roc project?
This is more a question for #beginners > Platform basics to be clear. If someone asks, I'd like to know what to tell them. I also suspect I am missing something obvious or am harboring a misconception.
In your roc file you reference the platform directory by relative path.
If you are hacking on a platform it's probably easier to have the roc files consuming that platform in the same directory/repository but if you are just using the locally built platform for another project and the platform's libhost.a won't change I don't see a need for that.
ok, thanks, this is helpful. app [main!] { pf: platform "../basic-cli/platform/targets" } something like that?
Should be app [main!] { pf: platform "../basic-cli/platform/main.roc" }, but yeah.
ok, right! i'm hooking it up to the Roc API portion of the platform. thanks!
I'm thinking now in terms of roc-init -- a project intended to help new devs get up and running on the new compiler. right now we have a main.roc that targets roc-platform-template-zig release. I am thinking about showing ~4~ workflows:
roc-platform-template-zigroc-platform-template-rustroc-platform-template-cbasic-cli (build the migrate-zig-compiler branch)The first 3 would be trivial, just targeting platform release URLs. The final one would show how to get basic-cli going in a different dir, and then wiring to that via relative path. So I might have, instead of one roc-init/main.roc:
Within main! of each, the 3 templates would have some identical "hello world+" (prompt for name, read STDIN, say hi). But basic-cli.roc would have some nice example usage.
I suspect the current roc-platform-template-c is not up to this task (last commit 2y ago)
c is just zig-- heh
Last updated: Feb 20 2026 at 12:27 UTC