Stream: beginners

Topic: Deploying a Roc application


view this post on Zulip Georges Boris (Dec 24 2024 at 14:50):

Hey folks!

Yesterday I started to create an application that runs on roc-lang/basic-webserver (yey!). I've run into a few problems when trying to deploy it but managed to make it work. I decided to document my process in the case it is helpful for anyone else and/or anyone has any pointers that I could use to improve things:

https://gist.github.com/georgesboris/15fa2ab2ce6a5750b8c6bb3adc95f63a

(decided to put it into a gist so as not to clutter the chat here as it ended up being a bit long)

view this post on Zulip Richard Feldman (Dec 24 2024 at 15:54):

yeah the goal is that we should be able to get to fully statically linked binaries, but we aren't there yet

view this post on Zulip Richard Feldman (Dec 24 2024 at 15:54):

I don't remember what the remaining blockers are though :thinking:

view this post on Zulip Richard Feldman (Dec 24 2024 at 15:54):

for basic-webserver

view this post on Zulip Georges Boris (Dec 24 2024 at 16:06):

Maybe the new version Anton is working on already solves that? Is that achieved per-platform or through a new build flag?

view this post on Zulip Richard Feldman (Dec 24 2024 at 16:42):

there are two things that are required for that to work:

  1. The host needs to not dynamically link anything. For a Rust host, this means on Linux it needs to build with musl libc instead of something like glibc
  2. Roc's compiler needs to not introduce any dynamic dependencies to the compiled application

view this post on Zulip Georges Boris (Dec 24 2024 at 16:48):

Uhnn - do you think this will end up being something to be specified by platform then? As 1. depends on that implementation?

I thought that enforcing statically linked host could be interesting to simplify the process of using them later, however I can see some hosts really using dynamically linking as a feature, right? E.g. game engines with hot reloading.

view this post on Zulip Georges Boris (Dec 24 2024 at 16:53):

Maybe a good DX would be to check and document that as part of Roc's build process.

view this post on Zulip Richard Feldman (Dec 24 2024 at 17:59):

yeah some hosts will need dynamic linking, but basic-webserver shouldn't

view this post on Zulip Luke Boswell (Dec 24 2024 at 20:50):

Richard Feldman said:

I don't remember what the remaining blockers are though :thinking:

From what I know there's no blockers anymore, though we haven't done it before so there could be issues we're not aware of.

I'd love to make progress on testing this etc in the new year.

I think we even have musl set up in our CI.. maybe I'm thinking of basic-cli.

view this post on Zulip Anton (Dec 27 2024 at 14:50):

We do build basic-webserver with musl, can you run ldd on your executable and share the output? That will allows us to see the specific dynamic libs.

view this post on Zulip Georges Boris (Dec 27 2024 at 16:09):

Will do! I'm at a family thing now but I'll send the output here later today :pray:

view this post on Zulip Georges Boris (Dec 28 2024 at 15:50):

(deleted)

view this post on Zulip Anton (Dec 28 2024 at 16:13):

I'll check it out

view this post on Zulip Anton (Dec 28 2024 at 16:31):

It'll take some digging to figure this out, I've put this on my TODO list

view this post on Zulip Georges Boris (Dec 28 2024 at 16:35):

Awesome! I managed to make it work for me as described in the gist, but if something changes - maybe update this thread? And I'll update the gist with the any improvements as well!


Last updated: Jul 06 2025 at 12:14 UTC