Stream: beginners

Topic: build cache location and dependency downloads


view this post on Zulip Krzysztof Skowronek (Aug 18 2026 at 20:13):

where are the build artifacts located? I know I can run roc build --no-cache but I was expecting to also have roc clean or something like, or at least be able to manually clear the cache (think the bin folder from dotnet or target from Rust)

also, I tried running roc build at work (because of course I did), but the corporate firewall blocked the platform download. Will there be a way to configure the packages/platforms sources to go through something like artifactory? I think it's a must if Roc is to be used in bigger companies.

view this post on Zulip Richard Feldman (Aug 18 2026 at 22:04):

great questions! There is one global cache dir - not sure what OS you're on, but on macOS it's in ~/.cache/roc/

view this post on Zulip Richard Feldman (Aug 18 2026 at 22:04):

if you want to clean it, you can just delete it

view this post on Zulip Richard Feldman (Aug 18 2026 at 22:06):

but in general the way it works is:

view this post on Zulip Richard Feldman (Aug 18 2026 at 22:10):

the design goals here are:

view this post on Zulip Krzysztof Skowronek (Aug 18 2026 at 22:21):

maybe it would be nice to have a command to open the build artifact directory? maybe even per file you are trying to run?

view this post on Zulip Luke Boswell (Aug 18 2026 at 22:23):

Richard Feldman said:

Another aspect to this is you only need to make a network request if you don't already have packages in your cache... because packages are content-hashed we can know for certain if you have the exact files locally and there is never any need to check. So the cli can download once, and then re-use that cached package (includes platforms) every time.

view this post on Zulip Krzysztof Skowronek (Aug 18 2026 at 22:33):

ok, on windows it's ~\AppData\Local\roc - good location I'd say, however there is only a directory for packages

I've built some examples on this machine, and I can't see anything related to the compilation - maybe that's why the --no-cache didn't do much?

view this post on Zulip Krzysztof Skowronek (Aug 18 2026 at 22:37):

the global cache for packages is something I'm familiar with, that's how nuget works in dotnet - all packages go through ~/.nuget as a global cache

is there roc restore to just download everything? we use dotnet-subset to copy only the dependency related parts of the codebase, then run dotnet restore to cache a docker layer with all dependencies baked in

maybe could be a nice thing for roc also

view this post on Zulip Luke Boswell (Aug 18 2026 at 22:48):

Package cache %LOCALAPPDATA%\roc\packages
Build cache %APPDATA%\Roc

view this post on Zulip Anton (Aug 19 2026 at 14:04):

is there roc restore to just download everything?

We don't have this yet, shall we name this roc fetch?

view this post on Zulip Krzysztof Skowronek (Aug 19 2026 at 14:28):

In principle the docker layer should just copy the main.roc file, and then use this new roc fetch main.roc, right?

view this post on Zulip Anton (Aug 19 2026 at 14:38):

Yeah, that sounds like it should work (once we implement roc fetch)

view this post on Zulip Richard Feldman (Aug 19 2026 at 14:59):

if you just want it to download everything, roc check will already do this

view this post on Zulip Richard Feldman (Aug 19 2026 at 14:59):

I don't think we need a separate subcommand for that :smile:

view this post on Zulip Krzysztof Skowronek (Aug 19 2026 at 15:02):

So the idea is to have a layer that is cached until the dependencies changed, so we would copy just main.roc that lists them

Roc check would fail usually for that, because of actually looks at the code

view this post on Zulip Anton (Aug 19 2026 at 15:14):

roc check will already do this

roc check could take up significant time on a big project so it would be nice to be able to do just roc fetch on a low spec CI machine.

view this post on Zulip Richard Feldman (Aug 19 2026 at 15:21):

hm but what's the use case there? What's the situation where you want to download the deps and then not do anything with them? :thinking:

view this post on Zulip Krzysztof Skowronek (Aug 19 2026 at 15:27):

In dockerfile

You do:

copy roc.main .&& Roc fetch
Copy . . // Can't remember syntax for copy all
Roc build main.roc

The layer that has only the main will not be recomputed until your dependencies change, removing the download

With good caching setup, all your runners share the .cache/roc/packages state, until you change the main.roc file

view this post on Zulip Krzysztof Skowronek (Aug 19 2026 at 15:27):

You could even go one step further and make it prepare build cache artifacts for dependencies, so that can also be shared

view this post on Zulip Richard Feldman (Aug 19 2026 at 15:38):

I see, that makes sense. What name do mainstream CLIs use for this operation?

view this post on Zulip Krzysztof Skowronek (Aug 19 2026 at 15:41):

Npm does install, cargo does fetch, dotnet does restore, go has mod download - I don't think there is a standard

view this post on Zulip Richard Feldman (Aug 19 2026 at 15:42):

download sounds the most direct, except that if I see roc download I immediately think "...download what?" - like it feels like it should have another argument haha

view this post on Zulip Richard Feldman (Aug 19 2026 at 15:43):

I guess roc fetch is probably the best option among those

view this post on Zulip Krzysztof Skowronek (Aug 19 2026 at 15:43):

roc deps main.roc? Would be great if it also precompiled the dependencies if that's happening at any point

view this post on Zulip Krzysztof Skowronek (Aug 19 2026 at 15:44):

Btw, dotnet even has dotent build --no-restore to fully skip even checking if restore is needed

view this post on Zulip Richard Feldman (Aug 19 2026 at 15:59):

roc deps sounds to me like it's going to tell me what the dependencies are :smile:

view this post on Zulip Hannes (Aug 20 2026 at 04:20):

To add another alternative, Gleam has gleam deps list for listing and gleam deps download for downloading.


Last updated: Sep 03 2026 at 15:16 UTC