tweag / monad-bayes

A library for probabilistic programming in Haskell.
MIT License
410 stars 62 forks source link

Nix cache on CI doesn't work properly #273

Closed turion closed 1 year ago

turion commented 1 year ago

Recent PRs (see https://github.com/tweag/monad-bayes/pull/271#issuecomment-1550907396, https://github.com/tweag/monad-bayes/actions/runs/4996034119/jobs/8948715375) took a very long time to complete on CI. The problem was probably made more visible by adding multiple GHC versions to CI (https://github.com/tweag/monad-bayes/pull/266).

In theory, we have a Cachix setup (https://github.com/tweag/monad-bayes/blob/master/.github/actions/nix-common-setup/action.yml#L11), but in practice it doesn't work because we keep rebuilding the same packages in subsequent runs:

For example, https://github.com/tweag/monad-bayes/actions/runs/4996034119/jobs/8948715375?pr=271#step:6:1134 should have been cached because it was built in https://github.com/tweag/monad-bayes/actions/runs/4992638711/jobs/8940645540#step:6:1135 already.

Probably, the Cachix configuration is not respected properly: https://github.com/tweag/monad-bayes/actions/runs/4996034119/jobs/8948715375?pr=271#step:6:7

warning: ignoring untrusted flake configuration setting 'extra-substituters'.
Pass '--accept-flake-config' to trust it
warning: ignoring untrusted flake configuration setting 'extra-trusted-public-keys'.
Pass '--accept-flake-config' to trust it

Other possibilities to explore if this is not the cause: The cachix cache might be too small, its key or configuration has changed since it was set up. Either way we should make sure that maintainer of this repo here can configure the Cachix.

CC @idontgetoutmuch @reubenharry

turion commented 1 year ago

Another conundrum is why it keeps recompiling so many packages that should be available via NixOS, such as half of the Haskell dependencies. What are we changing in the configuration to trigger this?