cubical icon indicating copy to clipboard operation
cubical copied to clipboard

Consider caching Nix artifacts via Cachix

Open phijor opened this issue 2 years ago • 0 comments

Currently, the Nix CI job builds Agda and the Cubical library, but throws away all the results once done typechecking. I suggest it is worth investigating whether these artifacts could be cached between runs or not

Implementation

I'm using Cachix to cache my own Agda artifacts. The setup is relatively simple (documentation):

  1. Set up a cache at cachix.org, call it say cubical. Open-source projects get 5GiB of cache for free.
  2. Create an API token, store it in this project's GitHub secrets
  3. Add the GitHub Action https://github.com/cachix/cachix-action to the CI job and tell it to use the cubical cache.

Here's how I've been doing it for one of my libraries.

Benefits

  • avoids rebuilding Agda when unchanged (cf. #959)
  • should prevent re-typechecking for documentation-only changes (or anything that doesn't touch *.agda files)
  • if hosted on a public cache, everyone using the provided Nix flake as an input can use the cached artifacts, avoiding the need to type-check locally (looking at you, Cubical/Experiments/ZCohomology/Benchmarks.agda 👀)

Drawbacks

  • Someone has to be responsible for the cachix.org cache.
  • ???

PS: Pinging @guilhermehas who seems to be responsible for Nix CI.

phijor avatar Nov 24 '22 14:11 phijor