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)
yeah the goal is that we should be able to get to fully statically linked binaries, but we aren't there yet
I don't remember what the remaining blockers are though :thinking:
for basic-webserver
Maybe the new version Anton is working on already solves that? Is that achieved per-platform or through a new build flag?
there are two things that are required for that to work:
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.
Maybe a good DX would be to check and document that as part of Roc's build process.
Stating the compiled binary is statically linked or depends on xyz (link to platform docs)
Wrapping a dynamically linked app in a way that trying to use it with missing links guides the user by providing better error messages. Don't know if that is simple/possible but it would be great when considering Roc's users might be unfamiliar with linking as a whole (like my lil self :nerd:)
yeah some hosts will need dynamic linking, but basic-webserver shouldn't
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.
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.
Will do! I'm at a family thing now but I'll send the output here later today :pray:
(deleted)
I'll check it out
It'll take some digging to figure this out, I've put this on my TODO list
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