Skip to content

Commit bc7a1f1

Browse files
authored
Merge pull request #8806 from haskell/mergify/bp/3.10/pr-8805
CI: add GHC pre-release (backport #8754) (backport #8805)
2 parents 14550da + 4acdf8a commit bc7a1f1

File tree

9 files changed

+141
-9
lines changed

9 files changed

+141
-9
lines changed

.github/workflows/changelogs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
3030
run: |
3131
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
32-
- uses: actions/cache@v1
32+
- uses: actions/cache@v3
3333
with:
3434
path: ~/.cabal/store
3535
key: linux-store-changelogs

.github/workflows/quick-jobs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
2525
run: |
2626
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
27-
- uses: actions/cache@v1
27+
- uses: actions/cache@v3
2828
with:
2929
path: ~/.cabal/store
3030
key: linux-store-meta
@@ -65,7 +65,7 @@ jobs:
6565
- name: Set PATH
6666
run: |
6767
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
68-
- uses: actions/cache@v1
68+
- uses: actions/cache@v3
6969
with:
7070
path: ~/.cabal/store
7171
key: linux-store-doctest

.github/workflows/validate.yml

+130-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
#
7979
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
8080
- if: ${{ runner.os != 'Windows' }}
81-
uses: actions/cache@v2
81+
uses: actions/cache@v3
8282
with:
8383
# validate.sh uses a special build dir
8484
path: |
@@ -187,6 +187,134 @@ jobs:
187187
if: matrix.cli != 'false'
188188
run: sh validate.sh $FLAGS -s cli-suite
189189

190+
# The job below is a copy-paste of validate with the necessary tweaks
191+
# to make all work with an upcoming GHC. Those tweaks include:
192+
# - ghcup needs the prerelease channel activated
193+
# - allow-newer for base libraries and Cabal* libraries
194+
# - (sometimes) disabling some parts on Windows because it's hard to figure
195+
# out why they fail
196+
validate-prerelease:
197+
name: Validate ${{ matrix.os }} ghc-prerelease
198+
runs-on: ${{ matrix.os }}
199+
outputs:
200+
GHC_FOR_RELEASE: ${{ format('["{0}"]', env.GHC_FOR_RELEASE) }}
201+
strategy:
202+
matrix:
203+
os: ["ubuntu-20.04", "macos-latest", "windows-latest"]
204+
205+
steps:
206+
207+
- uses: actions/checkout@v3
208+
209+
# See https://github.com/haskell/cabal/pull/8739
210+
- name: Sudo chmod to permit ghcup to update its cache
211+
run: |
212+
if [[ "${{ runner.os }}" == "Linux" ]]; then
213+
sudo ls -lah /usr/local/.ghcup/cache
214+
sudo mkdir -p /usr/local/.ghcup/cache
215+
sudo ls -lah /usr/local/.ghcup/cache
216+
sudo chown -R $USER /usr/local/.ghcup
217+
sudo chmod -R 777 /usr/local/.ghcup
218+
fi
219+
220+
- name: ghcup
221+
run: |
222+
ghcup --version
223+
ghcup config set cache true
224+
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml
225+
ghcup install ghc --set 9.6.0.20230210
226+
ghcup install cabal --set latest
227+
ghc --version
228+
cabal update
229+
230+
# See the following link for a breakdown of the following step
231+
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
232+
#
233+
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
234+
- if: ${{ runner.os != 'Windows' }}
235+
uses: actions/cache@v3
236+
with:
237+
# validate.sh uses a special build dir
238+
path: |
239+
${{ steps.setup-haskell.outputs.cabal-store }}
240+
dist-*
241+
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
242+
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
243+
244+
- name: Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR #8546)
245+
run: |
246+
git config --global protocol.file.allow always
247+
248+
# The '+exe' constraint below is important, otherwise cabal-install
249+
# might decide to build the library but not the executable which is
250+
# what we need.
251+
- name: Install cabal-plan
252+
run: |
253+
cd $(mktemp -d)
254+
cabal install cabal-plan --constraint='cabal-plan +exe' --allow-newer
255+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
256+
257+
# The tool is not essential to the rest of the test suite. If
258+
# hackage-repo-tool is not present, any test that requires it will
259+
# be skipped.
260+
# We want to keep this in the loop but we don't want to fail if
261+
# hackage-repo-tool breaks or fails to support a newer GHC version.
262+
- name: Install hackage-repo-tool
263+
continue-on-error: true
264+
run: |
265+
cd $(mktemp -d)
266+
cabal install hackage-repo-tool
267+
268+
# Needed by cabal-testsuite/PackageTests/Configure/setup.test.hs
269+
- name: Install Autotools
270+
if: runner.os == 'macOS'
271+
run: |
272+
brew install automake
273+
274+
- name: Allow newer boot libraries
275+
run: |
276+
echo "allow-newer: base, template-haskell, ghc-prim, Cabal-syntax, Cabal-described, Cabal, cabal-install-solver, cabal-install" >> cabal.project.validate
277+
278+
- name: Set validate inputs
279+
run: |
280+
FLAGS="${{ env.COMMON_FLAGS }}"
281+
if [[ "${{ matrix.cli }}" == "false" ]]; then
282+
FLAGS="$FLAGS --lib-only"
283+
fi
284+
echo "FLAGS=$FLAGS" >> $GITHUB_ENV
285+
286+
- name: Validate print-config
287+
run: sh validate.sh $FLAGS -s print-config
288+
289+
- name: Validate print-tool-versions
290+
run: sh validate.sh $FLAGS -s print-tool-versions
291+
292+
- name: Validate build
293+
run: sh validate.sh $FLAGS -s build
294+
295+
- name: Validate lib-tests
296+
env:
297+
# `rawSystemStdInOut reports text decoding errors`
298+
# test does not find ghc without the full path in windows
299+
GHCPATH: ${{ steps.setup-haskell.outputs.ghc-exe }}
300+
run: sh validate.sh $FLAGS -s lib-tests
301+
302+
- name: Validate lib-suite
303+
# see https://github.com/haskell/cabal/pull/8754#issuecomment-1435025848
304+
# for discussion about the trouble on Windows
305+
if: ${{ runner.os != 'Windows' }}
306+
run: sh validate.sh $FLAGS -s lib-suite
307+
308+
- name: Validate cli-tests
309+
if: matrix.cli != 'false'
310+
run: sh validate.sh $FLAGS -s cli-tests
311+
312+
- name: Validate cli-suite
313+
# see https://github.com/haskell/cabal/pull/8754#issuecomment-1435025848
314+
# for discussion about the trouble on Windows
315+
if: ( runner.os != 'Windows' ) && ( matrix.cli != 'false' )
316+
run: sh validate.sh $FLAGS -s cli-suite
317+
190318
validate-old-ghcs:
191319
name: Validate old ghcs ${{ matrix.extra-ghc }}
192320
runs-on: ubuntu-20.04
@@ -234,7 +362,7 @@ jobs:
234362
# As we are reusing the cached build dir from the previous step
235363
# the generated artifacts are available here,
236364
# including the cabal executable and the test suite
237-
- uses: actions/cache@v2
365+
- uses: actions/cache@v3
238366
with:
239367
path: |
240368
${{ steps.setup-haskell.outputs.cabal-store }}

Cabal-syntax/src/Distribution/Utils/Structured.hs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
{-# LANGUAGE TypeFamilies #-}
88
{-# LANGUAGE TypeOperators #-}
99
{-# LANGUAGE PatternSynonyms #-}
10-
{-# LANGUAGE TypeInType #-}
1110
-- |
1211
--
1312
-- Copyright: (c) 2019 Oleg Grenrus

cabal-install/src/Distribution/Client/VCS.hs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE LambdaCase #-}
23
{-# LANGUAGE ScopedTypeVariables #-}
34
{-# LANGUAGE NamedFieldPuns, RecordWildCards, RankNTypes #-}
@@ -53,8 +54,11 @@ import Distribution.Version
5354
( mkVersion )
5455
import qualified Distribution.PackageDescription as PD
5556

57+
#if !MIN_VERSION_base(4,18,0)
5658
import Control.Applicative
5759
( liftA2 )
60+
#endif
61+
5862
import Control.Exception
5963
( throw, try )
6064
import Control.Monad.Trans

cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Test.Cabal.Prelude
22
main = setupAndCabalTest $ do
33
skipUnlessGhcVersion ">= 8.1"
4-
ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*"
4+
ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*"
55
expectBrokenIf ghc 7987 $ do
66
withPackageDb $ do
77
withDirectory "mylib" $ setup_install_with_docs ["--ipid", "mylib-0.1.0.0"]

cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Test.Cabal.Prelude
22
main = setupTest $ do
33
-- No cabal test because per-component is broken with it
44
skipUnlessGhcVersion ">= 8.1"
5-
ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*"
5+
ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*"
66
expectBrokenIf ghc 7987 $
77
withPackageDb $ do
88
let setup_install' args = setup_install_with_docs (["--cabal-file", "Includes2.cabal"] ++ args)

cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Data.List
33
import qualified Data.Char as Char
44
main = setupAndCabalTest $ do
55
skipUnlessGhcVersion ">= 8.1"
6-
ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*"
6+
ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*"
77
expectBrokenIf ghc 7987 $
88
withPackageDb $ do
99
containers_id <- getIPID "containers"

cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Test.Cabal.Prelude
33
main = setupAndCabalTest $ do
44
skipUnlessGhcVersion ">= 9.6"
55
skipUnlessJavaScript
6+
skipIfWindows
67

78
res <- cabal' "v2-run" ["demo"]
89
assertOutputContains "Hello JS!" res

0 commit comments

Comments
 (0)