Skip to content

Commit

Permalink
CI: don't share cache between C compilers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
runeksvendsen committed Jan 13, 2025
1 parent 58b5a6d commit fbaca1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cabal-in-nix-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ matrix.os }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}--${{ matrix.ghc }}
restore-keys: ${{ runner.os }}-${{ matrix.os }}-
key: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
restore-keys: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cc }}-

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

0 comments on commit fbaca1e

Please sign in to comment.