Stream: compiler development

Topic: cargo host package management


view this post on Zulip Brendan Hansknecht (Sep 06 2024 at 22:57):

I am assume @Anton will know the answer to this. And others may know as well. Just thinking a bit about dependency management. For roc_std and heap.rs in both basic_cli and basic_webserver, they both have a checked in version of the files. This is fine, but means that sometimes they mutate without changes being looped back into roc_std in the main repo. Or other fixes are missed due to slow updating. Currently these are generated with glue, which is fine, but I'm wondering if we could just make them a cargo dependencies. Preferably, I think they would be cargo depencencies that point to a specific git commit in roc, but they also could be published as packages. I'm thinking that heap.rs might make sense to just put into roc_std cause it likely will be useful for many rust platforms.

One thing I am not sure of: How does rust/cargo deal with dependencies on a subcrate? Is that supported? Would we need to put roc_std in it's own github repo to depend on it in cargo?


Just kinda thinking out loud about a minor dependency annoyance.

view this post on Zulip Luke Boswell (Sep 06 2024 at 23:04):

In the JWT PR I updated basic-webserver to point at roc_std in roc if tou wanted to see how its done.

view this post on Zulip Luke Boswell (Sep 06 2024 at 23:05):

We can pin it to a specific commit easy too

view this post on Zulip Brendan Hansknecht (Sep 06 2024 at 23:40):

And it works for subcrates? That was my main concern

view this post on Zulip Brendan Hansknecht (Sep 06 2024 at 23:41):

But yeah, if that works, I think we should do the same for basic CLI, merge back any updates (I think basic webserver had a fix or two). And add heap to roc_std

view this post on Zulip Brendan Hansknecht (Sep 06 2024 at 23:41):

Not a rush by any means, but would be nice


Last updated: Jul 06 2025 at 12:14 UTC