Skip to content

Commit 9eed20d

Browse files
Mikolajmergify[bot]
authored andcommitted
Hack around CI problems by sudo chown and disabling cache for Windows validate (#8739)
* Try to fix ghcup cache in CI via sudo chmod * Revert "Try to fix ghcup cache in CI via sudo chmod" This reverts commit 0bb71d1. * Try not caching store in validate jobs to avoid double package bugs * Revert "Try not caching store in validate jobs to avoid double package bugs" This reverts commit b3f3782. * Try not to cache store on Windows in validate jobs to avoid double directory package bugs. * Revert "Revert "Try to fix ghcup cache in CI via sudo chmod"" This reverts commit b3a843a. * Try sudo only on (new) Linux, where it should be available * Also change the user * Document the particular hack snippets in validate.yml * Add an extra diagnostic ls for ghcup dirs * Also hack the other affected CI scripts * Also print the version of ghcup used for debugging (cherry picked from commit 22dcb3c)
1 parent ebfb302 commit 9eed20d

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

.github/workflows/bootstrap.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,20 @@ jobs:
3535
restore-keys: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-
3636

3737
- uses: actions/checkout@v3
38+
# See https://github.com/haskell/cabal/pull/8739
39+
- name: Sudo chmod to permit ghcup to update its cache
40+
run: |
41+
if [[ "${{ runner.os }}" == "Linux" ]]; then
42+
sudo ls -lah /usr/local/.ghcup/cache
43+
sudo mkdir -p /usr/local/.ghcup/cache
44+
sudo ls -lah /usr/local/.ghcup/cache
45+
sudo chown -R $USER /usr/local/.ghcup
46+
sudo chmod -R 777 /usr/local/.ghcup
47+
fi
3848
- name: bootstrap.py
3949
run: |
4050
GHC_VERSION=${{ matrix.ghc }}
51+
ghcup --version
4152
ghcup config set cache true
4253
ghcup install ghc $GHC_VERSION
4354

.github/workflows/quick-jobs.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,19 @@ jobs:
2828
with:
2929
path: ~/.cabal/store
3030
key: linux-store-meta
31+
# See https://github.com/haskell/cabal/pull/8739
32+
- name: Sudo chmod to permit ghcup to update its cache
33+
run: |
34+
if [[ "${{ runner.os }}" == "Linux" ]]; then
35+
sudo ls -lah /usr/local/.ghcup/cache
36+
sudo mkdir -p /usr/local/.ghcup/cache
37+
sudo ls -lah /usr/local/.ghcup/cache
38+
sudo chown -R $USER /usr/local/.ghcup
39+
sudo chmod -R 777 /usr/local/.ghcup
40+
fi
3141
- name: ghcup
3242
run: |
43+
ghcup --version
3344
ghcup config set cache true
3445
ghcup install ghc recommended
3546
ghcup set ghc recommended
@@ -66,8 +77,19 @@ jobs:
6677
with:
6778
path: ~/.cabal/store
6879
key: linux-store-doctest
80+
# See https://github.com/haskell/cabal/pull/8739
81+
- name: Sudo chmod to permit ghcup to update its cache
82+
run: |
83+
if [[ "${{ runner.os }}" == "Linux" ]]; then
84+
sudo ls -lah /usr/local/.ghcup/cache
85+
sudo mkdir -p /usr/local/.ghcup/cache
86+
sudo ls -lah /usr/local/.ghcup/cache
87+
sudo chown -R $USER /usr/local/.ghcup
88+
sudo chmod -R 777 /usr/local/.ghcup
89+
fi
6990
- name: ghcup
7091
run: |
92+
ghcup --version
7193
ghcup config set cache true
7294
ghcup install ghc recommended
7395
ghcup set ghc recommended

.github/workflows/validate.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ jobs:
5757

5858
- uses: actions/checkout@v3
5959

60+
# See https://github.com/haskell/cabal/pull/8739
61+
- name: Sudo chmod to permit ghcup to update its cache
62+
run: |
63+
if [[ "${{ runner.os }}" == "Linux" ]]; then
64+
sudo ls -lah /usr/local/.ghcup/cache
65+
sudo mkdir -p /usr/local/.ghcup/cache
66+
sudo ls -lah /usr/local/.ghcup/cache
67+
sudo chown -R $USER /usr/local/.ghcup
68+
sudo chmod -R 777 /usr/local/.ghcup
69+
fi
6070
- uses: haskell/actions/setup@v2
6171
id: setup-haskell
6272
with:
@@ -65,7 +75,10 @@ jobs:
6575

6676
# See the following link for a breakdown of the following step
6777
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
68-
- uses: actions/cache@v2
78+
#
79+
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
80+
- if: ${{ runner.os != 'Windows' }}
81+
uses: actions/cache@v2
6982
with:
7083
# validate.sh uses a special build dir
7184
path: |

0 commit comments

Comments
 (0)