kowainik / .github

💊 Default health files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is the cabal freeze file a good cache key?

andreasabel opened this issue · comments

key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

If I look at the content of a freeze file, e.g.,

active-repositories: hackage.haskell.org:merge
constraints: any.base ==4.17.0.0,
             any.ghc-bignum ==1.3,
             any.ghc-prim ==0.9.0,
             any.rts ==1.0.2
index-state: hackage.haskell.org 2023-01-30T21:21:45Z

the I see that it contains the date of the last cabal update (ok, it is the last update to hackage, but since it has hourly updates, basically this date will be different almost every time the CI is run).
Including the date in the cache key leads to permanent cache misses.

Seems like the last line should be dropped before calculating the cache key from this.

Or maybe I am getting something wrong? Do you have evidence that this works as expected in practice? (Meaning, with frequent cache hits?)