Skip to content

Commit

Permalink
Make sure cabal store is cached in simple cabal shell job
Browse files Browse the repository at this point in the history
  • Loading branch information
cdepillabout committed Oct 22, 2023
1 parent ce4b966 commit 6382b48
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,25 @@ jobs:

- uses: DeterminateSystems/magic-nix-cache-action@v2

# TODO: This cache actually needs to be keyed on the hash of the
# TODO: These caches actually needs to be keyed on the hash of the
# ./nix-helpers/simple-cabal-shell.nix derivation. If that derivation
# changes, then we really, really should not reuse the same
# ~/.cabal/store directory.
# ~/.cabal/store directory (since there is the possibility of getting
# into a cabal hell, where Haskell libraries in the Cabal store are linked to
# different, incompatible system libraries).
#
# It is possible to get the hash of this derivation with a command like:
#
# $ nix eval --impure --raw --expr 'with (import <nixpkgs> {}).lib; let simpleCabalShell = import ./.nix-helpers/simple-cabal-shell.nix {}; in builtins.elemAt (splitString "-" (removePrefix (builtins.storeDir + "/") simpleCabalShell)) 0'
#
# Just need to load this into a variable, and throw it in the following key name
- uses: actions/cache@v3
name: Cache cabal-store
name: Cache cabal store
with:
path: ~/.config/cabal/store
path: |
~/.cabal/store
~/.config/cabal/store
~/.local/state/cabal/store
key: nix-simple-cabal-shell

- name: cabal update
Expand Down

0 comments on commit 6382b48

Please sign in to comment.