I think there has been previous discussion on changes we would like to make to the build toolchain. I am having trouble finding that discussion and would like to make an issue so we can track or progress these changes.
Currently, when you run roc run with a local platform, roc re-builds the platform each time, and links the application to produce the executable. My understanding is that we would like to remove this relationship, so that roc cli does not need to be aware of the platform host build toolchain. The platform is then responsible for building the necessary files it needs, and provides prebuilt host files for roc to work with. E.g. legacy linker e.g. libapp.so, surgical linker e.g. linux-x64.rh and metadata_linux-x64.rm.
My understanding is that we will need to update most of the platforms (at least the ones most often used like basic-cli and webserver) to have a relevant build script, before we can make this change.
One thing I am unsure of is if we would like to include instructions for roc cli within the platform package header? without this roc is unable to rebuild the platform.
# from module params proposal
platform package [Stdout, Stdin, echo, read]
requires [main]
provides [mainForHost] to "prebuilt-hosts/"
packages [
Foo, Bar, Baz from "https://…",
Something as Smt from "https://…",
]
hosts [
echo : Str -> Task {} [],
read : Task Str [],
]
rebuild "zig build" # something like this maybe?
Would it be acceptable for users who want to use a platform locally, to be required to run this manually until module params is implemented?
For using a platform via URL the default is to use the prebuilt host files so these users will not be impacted.
Yeah, the choice is to fully avoid Roc ever building platforms. For local development, you run the build command once and then roc many times.
Or if the platform needs to control the full build, the platform will call the roc build command like in the wasm4 case
It does make actually platform dev a tiny bit less convenient, but it doesn't affect roc developers much if at all
Last updated: Jun 16 2026 at 16:19 UTC