Skip to content

Commit fbaca1e

Browse files
committed
CI: don't share cache between C compilers
The "Cache cabal files"-step would restore a cache from a key that does not include the C compiler, which means e.g. Clang could restore stuff built by GCC. Also, the `restore-keys` key didn't even include the GHC version. This meant that -- in case of a cache miss for `key` -- a cache built by one GHC version could be pulled for a CI run for another GHC version.
1 parent 58b5a6d commit fbaca1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/cabal-in-nix-shell.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
~/.cabal/packages
4343
~/.cabal/store
4444
dist-newstyle
45-
key: ${{ runner.os }}-${{ matrix.os }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}--${{ matrix.ghc }}
46-
restore-keys: ${{ runner.os }}-${{ matrix.os }}-
45+
key: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
46+
restore-keys: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cc }}-
4747

4848
# Make nix-shell use specific Bash version.
4949
# Cf. https://nixos.org/manual/nix/stable/command-ref/nix-shell#environment-variables.

0 commit comments

Comments
 (0)