Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows cache2 #58

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/caching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ on:
push:
branches:
- master
schedule:
# Refresh snapshot every (02+8*x):25 UTC
# When cache is present it is a light check workflow with early termination.
# When primary cache is not hit - runs the cache generation.
# Why: GitHub repo has 10G pool & on overflow GitHub removes caches in FIFO manner.
# When internal branche PRs save into the same pool -
# their cache is accessible only inside of the scope of the PR.
# If main cache is forced out - there are no cache shared between PRs,
# which implies all PRs would start to create & save their cache.
# Reinstitution of the main chache puts it back into FIFO
# & so it gets shared across all PRs.
- cron: "25 2/8 * * *"

env:
cabalBuild: "v2-build all --enable-tests --enable-benchmarks"
Expand Down Expand Up @@ -78,7 +90,7 @@ jobs:
- if: runner.os == 'Windows'
name: (Windows) Platform config
run: |
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
echo "CABAL_PKGS_DIR=C:\\cabal\\packages" >> $GITHUB_ENV
- if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' )
name: (Linux,macOS) Platform config
run: |
Expand Down Expand Up @@ -130,6 +142,7 @@ jobs:
restore-keys: ${{ env.cache-name }}-

- name: Compiled deps cache
id: compiled-deps
uses: actions/cache@v2
env:
cache-name: compiled-deps
Expand All @@ -141,9 +154,12 @@ jobs:
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-
${{ env.cache-name }}-${{ runner.os }}-

- run: cabal update
- if: (! steps.compiled-deps.outputs.cache-hit)
run: |
cabal update

- name: Download all sources
- if: (! steps.compiled-deps.outputs.cache-hit)
name: Download all sources
run: |
cabal $cabalBuild --only-download

Expand All @@ -152,7 +168,8 @@ jobs:
# but to cache what can be cached, so step is fault tolerant & would always succseed.
# 2021-12-11: NOTE: Building all targets, since
# current Cabal does not allow `all --enable-tests --enable-benchmarks --only-dependencies`
- name: Build all targets; try 3 times
- if: (! steps.compiled-deps.outputs.cache-hit)
name: Build all targets; try 3 times
continue-on-error: true
run: |
cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild
42 changes: 34 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- if: runner.os == 'Windows'
name: (Windows) Platform config
run: |
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
echo "CABAL_PKGS_DIR=C:\\cabal\\packages" >> $GITHUB_ENV
- if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' )
name: (Linux,macOS) Platform config
run: |
Expand Down Expand Up @@ -133,22 +133,48 @@ jobs:
env:
cache-name: compiled-deps
with:
path: ${{ steps.HaskEnvSetup.outputs.cabal-store }}
key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }}
path: v2-${{ steps.HaskEnvSetup.outputs.cabal-store }}
key: v2-${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-
${{ env.cache-name }}-${{ runner.os }}-
v2-${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-
v2-${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-
v2-${{ env.cache-name }}-${{ runner.os }}-

- run: cabal update
- if: runner.os == 'Windows'
name: Trace cabal cache
run: |
set +u
echo "CABAL_DIR: $CABAL_DIR"
echo "Content of $CABAL_DIR"
[ -d $CABAL_DIR ] && ls $CABAL_DIR/packages/hackage.haskell.org
[ -f $CABAL_DIR/config ] && cat $CABAL_DIR/config
echo "Content of /c/sr/ghc-${{ matrix.ghc }}"
if [ -d "/c/sr/ghc-${{ matrix.ghc }}" ]; then
ls /c/sr
ls /c/sr/ghc-${{ matrix.ghc }}
echo "Trace keys for computing package StateVar hash"
cat /c/sr/ghc-${{ matrix.ghc }}/StateVar*/cabal-hash.txt
fi

- run: cabal update -v3

- name: "HLint via ./fmt.sh"
run: |
./fmt.sh

# repeating builds to workaround segfaults in windows and ghc-8.8.4
- name: Build
run: cabal build || cabal build || cabal build
run: cabal build -v3 || cabal build -v3 || cabal build -v3

- if: runner.os == 'Windows'
name: Trace cabal cache after build
run: |
if [ -d "/c/sr/ghc-${{ matrix.ghc }}" ]; then
echo "Content of /c/sr/ghc-${{ matrix.ghc }}"
ls -la /c/sr/ghc-${{ matrix.ghc }}
echo "Trace keys for computing package StateVar hash"
cat /c/sr/ghc-${{ matrix.ghc }}/StateVar*/cabal-hash.txt
fi

- name: Set test options
run: |
Expand Down
2 changes: 1 addition & 1 deletion cabal-ghc901.project
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ package *

write-ghc-environment-files: never

index-state: 2021-11-29T12:30:07Z
index-state: 2021-11-29T12:30:08Z

constraints:
-- These plugins don't work on GHC9 yet
Expand Down
2 changes: 1 addition & 1 deletion cabal-ghc921.project
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ package *

write-ghc-environment-files: never

index-state: 2021-11-29T12:30:07Z
index-state: 2021-11-29T12:30:08Z

constraints:
-- These plugins doesn't work on GHC92 yet
Expand Down
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ package *

write-ghc-environment-files: never

index-state: 2021-11-29T12:30:07Z
index-state: 2021-11-29T12:30:08Z

constraints:
hyphenation +embed
Expand Down
2 changes: 1 addition & 1 deletion stack-8.10.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extra-deps:
- monad-dijkstra-0.1.1.3@sha256:d2fc098d7c122555e726830a12ae0423ac187f89de9228f32e56e2f6fc2238e1,1900
- optparse-applicative-0.15.1.0@sha256:29ff6146aabf54d46c4c8788e8d1eadaea27c94f6d360c690c5f6c93dac4b07e,4810
- refinery-0.4.0.0@sha256:fe3a43add8ff1db5cfffee7e7694c86128b1dfe62c541f26e25a8eadf9585610,1663
- retrie-1.0.0.0@sha256:82014773115807f649f60fe4a3246911bbccd063a3c846cf5665e71f237bdd2d,4241
- retrie-1.1.0.0
- stylish-haskell-0.12.2.0@sha256:38f7fd9ca30c9aad34f176dae4564576899e9c197b6b8557b59c5e8c6a622c74,6108
- stm-containers-1.2@sha256:a887f2e7692b7cf20e0b081e2d66e21076e2bd4b57016ec59c484edfa2d29397,3244
- stm-hamt-1.2.0.6@sha256:fba86ccb4b45c5706c19b0e1315ba63dcac3b5d71de945ec001ba921fae80061,3972
Expand Down
4 changes: 2 additions & 2 deletions stack-8.10.7.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Build plan for GHC 8.10.7.
# Build plan for GHC 8.10.7.
# stack-8.10.7.yaml is for install script, stack.yaml is for default builds, keep these identical.
# https://github.com/haskell/haskell-language-server/issues/2491

Expand Down Expand Up @@ -51,7 +51,7 @@ extra-deps:
- monad-dijkstra-0.1.1.3@sha256:d2fc098d7c122555e726830a12ae0423ac187f89de9228f32e56e2f6fc2238e1,1900
- optparse-applicative-0.15.1.0@sha256:29ff6146aabf54d46c4c8788e8d1eadaea27c94f6d360c690c5f6c93dac4b07e,4810
- refinery-0.4.0.0@sha256:fe3a43add8ff1db5cfffee7e7694c86128b1dfe62c541f26e25a8eadf9585610,1663
- retrie-1.0.0.0@sha256:82014773115807f649f60fe4a3246911bbccd063a3c846cf5665e71f237bdd2d,4241
- retrie-1.1.0.0
- stylish-haskell-0.12.2.0@sha256:38f7fd9ca30c9aad34f176dae4564576899e9c197b6b8557b59c5e8c6a622c74,6108
- stm-containers-1.2@sha256:a887f2e7692b7cf20e0b081e2d66e21076e2bd4b57016ec59c484edfa2d29397,3244
- stm-hamt-1.2.0.6@sha256:fba86ccb4b45c5706c19b0e1315ba63dcac3b5d71de945ec001ba921fae80061,3972
Expand Down
2 changes: 1 addition & 1 deletion stack-8.8.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extra-deps:
- opentelemetry-0.6.1
- opentelemetry-extra-0.6.1
- refinery-0.4.0.0
- retrie-0.1.1.1
- retrie-1.1.0.0
- semigroups-0.18.5
- shake-0.19.4
- stylish-haskell-0.12.2.0
Expand Down
4 changes: 2 additions & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Build plan for GHC 8.10.7.
# Build plan for GHC 8.10.7.
# stack-8.10.7.yaml is for install script, stack.yaml is for default builds, keep these identical.
# https://github.com/haskell/haskell-language-server/issues/2491

Expand Down Expand Up @@ -51,7 +51,7 @@ extra-deps:
- monad-dijkstra-0.1.1.3@sha256:d2fc098d7c122555e726830a12ae0423ac187f89de9228f32e56e2f6fc2238e1,1900
- optparse-applicative-0.15.1.0@sha256:29ff6146aabf54d46c4c8788e8d1eadaea27c94f6d360c690c5f6c93dac4b07e,4810
- refinery-0.4.0.0@sha256:fe3a43add8ff1db5cfffee7e7694c86128b1dfe62c541f26e25a8eadf9585610,1663
- retrie-1.0.0.0@sha256:82014773115807f649f60fe4a3246911bbccd063a3c846cf5665e71f237bdd2d,4241
- retrie-1.1.0.0
- stylish-haskell-0.12.2.0@sha256:38f7fd9ca30c9aad34f176dae4564576899e9c197b6b8557b59c5e8c6a622c74,6108
- stm-containers-1.2@sha256:a887f2e7692b7cf20e0b081e2d66e21076e2bd4b57016ec59c484edfa2d29397,3244
- stm-hamt-1.2.0.6@sha256:fba86ccb4b45c5706c19b0e1315ba63dcac3b5d71de945ec001ba921fae80061,3972
Expand Down