From 93e6d6d543e8a104f23c19c2fe33d1bf082078ad Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Tue, 21 Dec 2021 18:53:07 +0200 Subject: [PATCH 1/7] 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. --- .github/workflows/caching.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index 22dbaa045b..0bf27e11ad 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -154,11 +154,11 @@ jobs: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- ${{ env.cache-name }}-${{ runner.os }}- - - if: (! steps.compiled-deps.outputs.cache-hit) + - if: steps.compiled-deps.outputs.cache-hit != 'true' run: | cabal update - - if: (! steps.compiled-deps.outputs.cache-hit) + - if: steps.compiled-deps.outputs.cache-hit != 'true' name: Download all sources run: | cabal $cabalBuild --only-download @@ -168,7 +168,7 @@ 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` - - if: (! steps.compiled-deps.outputs.cache-hit) + - if: steps.compiled-deps.outputs.cache-hit != 'true' name: Build all targets; try 3 times continue-on-error: true run: | From 08c2fe2f7b5484c1d9d3b5f64975cb86378fe90b Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Tue, 21 Dec 2021 19:01:50 +0200 Subject: [PATCH 2/7] CI: caching: fx `cabal.project` copying In the https://github.com/haskell/haskell-language-server/runs/4596861600?check_suite_focus=true of https://github.com/haskell/haskell-language-server/pull/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. --- .github/workflows/caching.yml | 3 ++- .github/workflows/test.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index 0bf27e11ad..9f3157f0c9 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -100,7 +100,8 @@ jobs: - if: matrix.ghc == '9.0.1' name: (GHC 9.0.1) Use modified `cabal.project` run: | - cp cabal-ghc901.project cabal.project + # This seems insane, but it is needed. + rm -f -v cabal.project && cp -v cabal-ghc901.project cabal.project - if: runner.os == 'Windows' && matrix.ghc == '8.8.4' name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f1bf512c9..6dadd943b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,7 +95,8 @@ jobs: - if: matrix.ghc == '9.0.1' name: (GHC 9.0.1) Use modified `cabal.project` run: | - cp cabal-ghc901.project cabal.project + # This seems insane, but it is needed. + rm -f -v cabal.project && cp -v cabal-ghc901.project cabal.project - if: runner.os == 'Windows' && matrix.ghc == '8.8.4' name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults run: | From b113bf7f30ecb57086e313780c712e484a299431 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Tue, 21 Dec 2021 19:38:28 +0200 Subject: [PATCH 3/7] cabal*.project: index-state +1s Renewing cache. --- cabal-ghc901.project | 2 +- cabal-ghc921.project | 2 +- cabal.project | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cabal-ghc901.project b/cabal-ghc901.project index 043afcca75..7e1bb92849 100644 --- a/cabal-ghc901.project +++ b/cabal-ghc901.project @@ -37,7 +37,7 @@ package * write-ghc-environment-files: never -index-state: 2021-11-29T12:30:08Z +index-state: 2021-11-29T12:30:09Z constraints: -- These plugins don't work on GHC9 yet diff --git a/cabal-ghc921.project b/cabal-ghc921.project index 113087870a..30f14b1300 100644 --- a/cabal-ghc921.project +++ b/cabal-ghc921.project @@ -36,7 +36,7 @@ package * write-ghc-environment-files: never -index-state: 2021-11-29T12:30:08Z +index-state: 2021-11-29T12:30:09Z constraints: -- These plugins doesn't work on GHC92 yet diff --git a/cabal.project b/cabal.project index 7c70a8c62a..0d8a1090d7 100644 --- a/cabal.project +++ b/cabal.project @@ -40,7 +40,7 @@ package * write-ghc-environment-files: never -index-state: 2021-11-29T12:30:08Z +index-state: 2021-11-29T12:30:09Z constraints: hyphenation +embed From 6970aa8c23032054cb722acbcef64fef1d1a2cf1 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Tue, 21 Dec 2021 19:50:47 +0200 Subject: [PATCH 4/7] CI: {caching,test}: make rm/cp comment more informative --- .github/workflows/caching.yml | 4 +++- .github/workflows/test.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index 9f3157f0c9..ddf3612c15 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -100,7 +100,9 @@ jobs: - if: matrix.ghc == '9.0.1' name: (GHC 9.0.1) Use modified `cabal.project` run: | - # This seems insane, but it is needed. + # File has some protections preventing regular `rm`. + # `&&` insures `rm -f` returns positive. + # Some platforms have `alias cp='cp -i'`. rm -f -v cabal.project && cp -v cabal-ghc901.project cabal.project - if: runner.os == 'Windows' && matrix.ghc == '8.8.4' name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6dadd943b6..01e512ac79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,7 +95,9 @@ jobs: - if: matrix.ghc == '9.0.1' name: (GHC 9.0.1) Use modified `cabal.project` run: | - # This seems insane, but it is needed. + # File has some protections preventing regular `rm`. + # `&&` insures `rm -f` returns positive. + # Some platforms have `alias cp='cp -i'`. rm -f -v cabal.project && cp -v cabal-ghc901.project cabal.project - if: runner.os == 'Windows' && matrix.ghc == '8.8.4' name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults From c7acf49b7b9a4aa71108309e8609406125a6802a Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Tue, 21 Dec 2021 20:33:01 +0200 Subject: [PATCH 5/7] CI: {caching,test}: upd commets This should short-cirquit. --- .github/workflows/caching.yml | 5 +++-- .github/workflows/test.yml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index ddf3612c15..bc3060e81e 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -101,8 +101,9 @@ jobs: name: (GHC 9.0.1) Use modified `cabal.project` run: | # File has some protections preventing regular `rm`. - # `&&` insures `rm -f` returns positive. - # Some platforms have `alias cp='cp -i'`. + # (most probably sticky bit is set on $HOME) + # `&&` insures `rm -f` return is positive. + # Many platforms aslo have `alias cp='cp -i'`. rm -f -v cabal.project && cp -v cabal-ghc901.project cabal.project - if: runner.os == 'Windows' && matrix.ghc == '8.8.4' name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 01e512ac79..04306839b1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -96,8 +96,9 @@ jobs: name: (GHC 9.0.1) Use modified `cabal.project` run: | # File has some protections preventing regular `rm`. - # `&&` insures `rm -f` returns positive. - # Some platforms have `alias cp='cp -i'`. + # (most probably sticky bit is set on $HOME) + # `&&` insures `rm -f` return is positive. + # Many platforms aslo have `alias cp='cp -i'`. rm -f -v cabal.project && cp -v cabal-ghc901.project cabal.project - if: runner.os == 'Windows' && matrix.ghc == '8.8.4' name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults From e4076edb21eacf3acda409a0134c67b95e369300 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Tue, 21 Dec 2021 21:24:06 +0200 Subject: [PATCH 6/7] cabal*.project: index-state +1s --- cabal-ghc901.project | 2 +- cabal-ghc921.project | 2 +- cabal.project | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cabal-ghc901.project b/cabal-ghc901.project index 7e1bb92849..c536524a45 100644 --- a/cabal-ghc901.project +++ b/cabal-ghc901.project @@ -37,7 +37,7 @@ package * write-ghc-environment-files: never -index-state: 2021-11-29T12:30:09Z +index-state: 2021-11-29T12:30:10Z constraints: -- These plugins don't work on GHC9 yet diff --git a/cabal-ghc921.project b/cabal-ghc921.project index 30f14b1300..fa7ced63d0 100644 --- a/cabal-ghc921.project +++ b/cabal-ghc921.project @@ -36,7 +36,7 @@ package * write-ghc-environment-files: never -index-state: 2021-11-29T12:30:09Z +index-state: 2021-11-29T12:30:10Z constraints: -- These plugins doesn't work on GHC92 yet diff --git a/cabal.project b/cabal.project index 0d8a1090d7..ffc53d8fae 100644 --- a/cabal.project +++ b/cabal.project @@ -40,7 +40,7 @@ package * write-ghc-environment-files: never -index-state: 2021-11-29T12:30:09Z +index-state: 2021-11-29T12:30:10Z constraints: hyphenation +embed From 9b2fad85062f76bf1ec6c5ce50e9f9a9c1fb8cbd Mon Sep 17 00:00:00 2001 From: Javier Neira Date: Wed, 22 Dec 2021 10:30:50 +0100 Subject: [PATCH 7/7] Correct small typo --- .github/workflows/caching.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index bc3060e81e..4848e819bd 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -103,7 +103,7 @@ jobs: # File has some protections preventing regular `rm`. # (most probably sticky bit is set on $HOME) # `&&` insures `rm -f` return is positive. - # Many platforms aslo have `alias cp='cp -i'`. + # Many platforms also have `alias cp='cp -i'`. rm -f -v cabal.project && cp -v cabal-ghc901.project cabal.project - if: runner.os == 'Windows' && matrix.ghc == '8.8.4' name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults