Skip to content

ci: remove cache steps in nix jobs#14899

Open
Alizter wants to merge 1 commit into
ocaml:mainfrom
Alizter:push-tyoxvukrynly
Open

ci: remove cache steps in nix jobs#14899
Alizter wants to merge 1 commit into
ocaml:mainfrom
Alizter:push-tyoxvukrynly

Conversation

@Alizter
Copy link
Copy Markdown
Collaborator

@Alizter Alizter commented Jun 2, 2026

Change

We remove the cache steps in the nix jobs in the CI. We replace them with a cachix cache hosted at https://ocaml-dune.cachix.org.

The flake is configured so that it consults this cache by default. This should speed up setting up local development too.

I've added instructions on how to warm nix cache which has to happen manually between flake updates.

Motivation

The main motivation for this change was to give some relief to the GitHub actions cache which was evicting itself often leading to CI times suffering.

Notes

We are currently caching a subset of all the nix jobs, I haven't for instance added the full oxcaml nix job because we override dune with the current scope which invalidates cache. If we can work out how to do this without, it should be no problem to add.

I have not cached anything for macos, because I don't currently know how to do this.

p.s.

I can give permissions to push to this cache as needed from other maintainers.

cc @shonfeder @anmonteiro @rgrinberg

- Add instructions on how to warm nix cache

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@rgrinberg
Copy link
Copy Markdown
Member

Manually pushing to this cache does not seem like an attractive option. Can't we push at then of a successful CI run?

@Alizter
Copy link
Copy Markdown
Collaborator Author

Alizter commented Jun 3, 2026

@rgrinberg We only have to do this every time we update the nix flake. The dune that we build here doesn't affect the packages we pull in (that's how we have it set up currently).

We could push every PR but I would have to add some secrets to this repo in order to allow it. Most of the time nothing changes, so they would be noops. When somebody updates a flake, it would invalidate the cache.

Cachix has a 5GB limit at the moment in the free tier, our nix jobs should fit nicely in that for now since there is a lot of sharing. When the limit is reached they will evict LRU.

@shonfeder
Copy link
Copy Markdown
Member

We only have to do this every time we update the nix flake.

Could we have a CI job that is only run when the flake file changes that pushes updates to cache?

@rgrinberg
Copy link
Copy Markdown
Member

There's a github secrets thing to prevent the key from being committed.

I am hoping that this push step would be a no-op when the flake hasn't changed anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants