Skip to content

Commit e6c1fca

Browse files
Anton-Latukhajneiramergify[bot]
authored
CI: caching: fix early termination expression check & cabal.project replacement (#2520)
* CI: caching: fix early termination expression check It is obscure bug. Details are in https://matrix.to/#/!oOjZFsoNYPAbTEgSOA:libera.chat/$tB_L6wbaxe1ElQtYzMI9woID4hZyscS6Rhpn-nsCc6Y?via=libera.chat&via=matrix.org&via=monoid.al Because after the second path somehow it always returned `False` - the caching runs always resulted in early termination. * CI: caching: fx `cabal.project` copying In the https://github.com/haskell/haskell-language-server/runs/4596861600?check_suite_focus=true of #2503 Noted that: I rm cabal.project. The sources of cabal-ghc921.project contain: index-state: 2021-12-18T00:00:07Z cp cabal-ghc921.project cabal.project Then from cabal.project CI retrieves finderprint 2021-11-29T08:11:08Z. Seems like GitHub uses alias cp=cp -i - preventing UNIX-like default copying over behaviour. & rm cabal.project does not remove the file. cabal.project seems to be protected from deletion. * cabal*.project: index-state +1s Renewing cache. * CI: {caching,test}: make rm/cp comment more informative * CI: {caching,test}: upd commets This should short-cirquit. * cabal*.project: index-state +1s * Correct small typo Co-authored-by: Javier Neira <atreyu.bbb@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 3de244e commit e6c1fca

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

.github/workflows/caching.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ jobs:
100100
- if: matrix.ghc == '9.0.1'
101101
name: (GHC 9.0.1) Use modified `cabal.project`
102102
run: |
103-
cp cabal-ghc901.project cabal.project
103+
# File has some protections preventing regular `rm`.
104+
# (most probably sticky bit is set on $HOME)
105+
# `&&` insures `rm -f` return is positive.
106+
# Many platforms also have `alias cp='cp -i'`.
107+
rm -f -v cabal.project && cp -v cabal-ghc901.project cabal.project
104108
- if: runner.os == 'Windows' && matrix.ghc == '8.8.4'
105109
name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults
106110
run: |
@@ -154,11 +158,11 @@ jobs:
154158
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-
155159
${{ env.cache-name }}-${{ runner.os }}-
156160
157-
- if: (! steps.compiled-deps.outputs.cache-hit)
161+
- if: steps.compiled-deps.outputs.cache-hit != 'true'
158162
run: |
159163
cabal update
160164
161-
- if: (! steps.compiled-deps.outputs.cache-hit)
165+
- if: steps.compiled-deps.outputs.cache-hit != 'true'
162166
name: Download all sources
163167
run: |
164168
cabal $cabalBuild --only-download
@@ -168,7 +172,7 @@ jobs:
168172
# but to cache what can be cached, so step is fault tolerant & would always succseed.
169173
# 2021-12-11: NOTE: Building all targets, since
170174
# current Cabal does not allow `all --enable-tests --enable-benchmarks --only-dependencies`
171-
- if: (! steps.compiled-deps.outputs.cache-hit)
175+
- if: steps.compiled-deps.outputs.cache-hit != 'true'
172176
name: Build all targets; try 3 times
173177
continue-on-error: true
174178
run: |

.github/workflows/test.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ jobs:
9595
- if: matrix.ghc == '9.0.1'
9696
name: (GHC 9.0.1) Use modified `cabal.project`
9797
run: |
98-
cp cabal-ghc901.project cabal.project
98+
# File has some protections preventing regular `rm`.
99+
# (most probably sticky bit is set on $HOME)
100+
# `&&` insures `rm -f` return is positive.
101+
# Many platforms aslo have `alias cp='cp -i'`.
102+
rm -f -v cabal.project && cp -v cabal-ghc901.project cabal.project
99103
- if: runner.os == 'Windows' && matrix.ghc == '8.8.4'
100104
name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults
101105
run: |

cabal-ghc901.project

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ package *
3737

3838
write-ghc-environment-files: never
3939

40-
index-state: 2021-11-29T12:30:08Z
40+
index-state: 2021-11-29T12:30:10Z
4141

4242
constraints:
4343
-- These plugins don't work on GHC9 yet

cabal-ghc921.project

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ package *
3636

3737
write-ghc-environment-files: never
3838

39-
index-state: 2021-11-29T12:30:08Z
39+
index-state: 2021-11-29T12:30:10Z
4040

4141
constraints:
4242
-- These plugins doesn't work on GHC92 yet

cabal.project

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ package *
4040

4141
write-ghc-environment-files: never
4242

43-
index-state: 2021-11-29T12:30:08Z
43+
index-state: 2021-11-29T12:30:10Z
4444

4545
constraints:
4646
hyphenation +embed

0 commit comments

Comments
 (0)