Stream: beginners

Topic: roc binaries extensions (for gitignore)


view this post on Zulip Jared (Feb 01 2024 at 03:02):

So it looks like roc dev and roc run produce binaries that don't have any extensions ... is it a way to have the files have extensions? That would make it easier to .gitignore them.

view this post on Zulip Brendan Hansknecht (Feb 01 2024 at 03:16):

linux and mac binaries don't tend to have extensions, so that would be a bit strange to do by default. That said, you can always use --output to set it to whatever you like

view this post on Zulip Brendan Hansknecht (Feb 01 2024 at 03:17):

I guess the lack of extension is why most build systems put everything in a build directory. In like in the case of rust/zig ./target and ./zig-out. We probably should do something similar for roc to make it easy to gitignore. That is the more "correct" solution

view this post on Zulip Brendan Hansknecht (Feb 01 2024 at 03:19):

Just like for a number of our intermediate artifacts, we should either move them to the global .cache/roc or some sort of local roc-cache or ./roc-cache. I think this would all be welcome improvements (of course with a bit of discussion on the exact order/location/name for the pieces).

view this post on Zulip Brendan Hansknecht (Feb 01 2024 at 03:24):

We also potentially will want two different folders, which is a bit odd. One in the platform directory if you have a locally compiled platform. One for where actual apps are built.

view this post on Zulip Luke Boswell (Feb 01 2024 at 04:17):

This sounds like a good idea.

view this post on Zulip Oskar Hahn (Feb 01 2024 at 06:50):

I like the idea of a roc-cache, but not the idea of a build directory. In my time as a go developer, it never was a problem to add /my-binary to .gitignore. Yes, it is not so generic, but I only have to add it once. This is very little work for the convenient having the binary at the place, where I built it. It is nice to call roc build && ./main.

For someone without any knowledge of rust, it took me some time to find the roc-binary after running cargo build.

view this post on Zulip Richard Feldman (Feb 01 2024 at 12:45):

I think roc dev and roc run should not put binaries in the local directory. A tempdir seems fine for now, if someone wants to make that change!

view this post on Zulip Richard Feldman (Feb 01 2024 at 12:47):

long-term, I want to avoid having roc builds create any local directories unless you explicitly ask for them (via --output)

view this post on Zulip Jared (Feb 01 2024 at 12:48):

Sweet yeah that sounds great to me.

view this post on Zulip Brendan Hansknecht (Feb 01 2024 at 15:46):

Can we still put (or at least accept) a subfolder in the platform directory for all of the roc related output....actually I think this may already be planned as part of the platform changes. I think we plan to enable the platform to specify the exact file path. So then the platform can put it wherever.


Last updated: Jul 06 2025 at 12:14 UTC