From 22613d5308e6056401bbda6cdd2972cc6fedcc8e Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Tue, 25 Oct 2022 23:02:05 +0200 Subject: [PATCH 1/7] Build with Cabal-3.8 and GHC 9.4 --- .github/workflows/haskell-ci.yml | 9 +++++-- hackage-server.cabal | 10 ++++---- .../Features/BuildReports/BuildReport.hs | 14 ++++++++++- .../Server/Framework/Instances.hs | 6 +++++ .../Server/Util/CabalRevisions.hs | 25 +++++++++++++++++-- 5 files changed, 54 insertions(+), 10 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 4f2631d62..2cfba1ab7 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.15.20220822 +# version: 0.15.20221009 # -# REGENDATA ("0.15.20220822",["github","hackage-server.cabal"]) +# REGENDATA ("0.15.20221009",["github","hackage-server.cabal"]) # name: Haskell-CI on: @@ -34,6 +34,11 @@ jobs: strategy: matrix: include: + - compiler: ghc-9.4.2 + compilerKind: ghc + compilerVersion: 9.4.2 + setup-method: ghcup + allow-failure: false - compiler: ghc-9.2.4 compilerKind: ghc compilerVersion: 9.2.4 diff --git a/hackage-server.cabal b/hackage-server.cabal index 74e511955..9120afead 100644 --- a/hackage-server.cabal +++ b/hackage-server.cabal @@ -27,7 +27,7 @@ copyright: 2008-2015 Duncan Coutts, license: BSD-3-Clause license-file: LICENSE -tested-with: GHC == { 9.2.4, 9.0.2, 8.10.7, 8.8.4 } +tested-with: GHC == { 9.4.2, 9.2.4, 9.0.2, 8.10.7, 8.8.4 } data-dir: datafiles data-files: @@ -99,7 +99,7 @@ common defaults -- see `cabal.project.local-ghc-${VERSION}` files build-depends: , array >= 0.5 && < 0.6 - , base >= 4.13 && < 4.17 + , base >= 4.13 && < 4.18 , binary >= 0.8 && < 0.9 , bytestring >= 0.10 && < 0.12 , containers ^>= 0.6.0 @@ -117,8 +117,8 @@ common defaults -- other dependencies shared by most components build-depends: , aeson ^>= 2.0.3.0 || ^>= 2.1.0.0 - , Cabal ^>= 3.6.3.0 - , Cabal-syntax ^>= 3.6.0.0 + , Cabal ^>= 3.8.1.0 + , Cabal-syntax ^>= 3.8.1.0 -- Cabal-syntax needs to be bound to constrain hackage-security -- see https://github.com/haskell/hackage-server/issues/1130 , fail ^>= 4.9.0 @@ -371,7 +371,7 @@ library lib-server -- NB: see also build-depends in `common defaults`! build-depends: , HStringTemplate ^>= 0.8 - , HTTP ^>= 4000.3.16 + , HTTP ^>= 4000.3.16 || ^>= 4000.4.1 , QuickCheck ^>= 2.14 , acid-state ^>= 0.16 , async ^>= 2.2.1 diff --git a/src/Distribution/Server/Features/BuildReports/BuildReport.hs b/src/Distribution/Server/Features/BuildReports/BuildReport.hs index 1d85cce5f..73d22b57d 100644 --- a/src/Distribution/Server/Features/BuildReports/BuildReport.hs +++ b/src/Distribution/Server/Features/BuildReports/BuildReport.hs @@ -1,9 +1,11 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} @@ -57,6 +59,10 @@ import Distribution.CabalSpecVersion ( CabalSpecVersion(CabalSpecV2_4) ) import Distribution.Pretty ( Pretty(..), pretty, prettyShow ) +#if MIN_VERSION_Cabal(3,7,0) +import Distribution.Fields.Pretty + ( pattern NoComment ) +#endif import qualified Text.PrettyPrint as Disp import Distribution.Parsec @@ -311,7 +317,13 @@ intPair = do -- Pretty-printing show :: BuildReport -> String -show = showFields (const []) . prettyFieldGrammar CabalSpecV2_4 fieldDescrs +show = showFields noComment . prettyFieldGrammar CabalSpecV2_4 fieldDescrs + where +#if MIN_VERSION_Cabal(3,7,0) + noComment _ = NoComment +#else + noComment _ = [] +#endif -- ----------------------------------------------------------------------------- -- Description of the fields, for parsing/printing diff --git a/src/Distribution/Server/Framework/Instances.hs b/src/Distribution/Server/Framework/Instances.hs index 442e9c15f..d2a68cf57 100644 --- a/src/Distribution/Server/Framework/Instances.hs +++ b/src/Distribution/Server/Framework/Instances.hs @@ -136,6 +136,7 @@ instance SafeCopy OS where putCopy Ghcjs = contain $ putWord8 14 putCopy Hurd = contain $ putWord8 15 putCopy Android = contain $ putWord8 16 + putCopy Wasi = contain $ putWord8 17 getCopy = contain $ do tag <- getWord8 @@ -157,6 +158,7 @@ instance SafeCopy OS where 14 -> return Ghcjs 15 -> return Hurd 16 -> return Android + 17 -> return Wasi _ -> fail "SafeCopy OS getCopy: unexpected tag" instance SafeCopy Arch where @@ -180,6 +182,8 @@ instance SafeCopy Arch where putCopy Vax = contain $ putWord8 15 putCopy JavaScript = contain $ putWord8 16 putCopy AArch64 = contain $ putWord8 17 + putCopy S390X = contain $ putWord8 18 + putCopy Wasm32 = contain $ putWord8 19 getCopy = contain $ do tag <- getWord8 @@ -202,6 +206,8 @@ instance SafeCopy Arch where 15 -> return Vax 16 -> return JavaScript 17 -> return AArch64 + 18 -> return S390X + 19 -> return Wasm32 _ -> fail "SafeCopy Arch getCopy: unexpected tag" instance SafeCopy CompilerFlavor where diff --git a/src/Distribution/Server/Util/CabalRevisions.hs b/src/Distribution/Server/Util/CabalRevisions.hs index f417dee1e..d984c4cc3 100644 --- a/src/Distribution/Server/Util/CabalRevisions.hs +++ b/src/Distribution/Server/Util/CabalRevisions.hs @@ -2,6 +2,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} @@ -39,6 +40,9 @@ import Distribution.Version import Distribution.Compiler (CompilerFlavor) import Distribution.FieldGrammar (prettyFieldGrammar) import Distribution.Fields.Pretty (PrettyField (..), showFields) +#if MIN_VERSION_Cabal(3,7,0) +import Distribution.Fields.Pretty (pattern NoComment) +#endif import Distribution.PackageDescription import Distribution.PackageDescription.Parsec (parseGenericPackageDescription, runParseResult) import Distribution.PackageDescription.FieldGrammar (sourceRepoFieldGrammar) @@ -340,7 +344,7 @@ checkPackageDescriptions checkXRevision checkSame "The package-url field is unused, don't bother changing it." pkgUrlA pkgUrlB changesOk "bug-reports" fromShortText bugReportsA bugReportsB - changesOkList changesOk "source-repository" (showFields (const []) . (:[]) . ppSourceRepo) + changesOkList changesOk "source-repository" (showFields noComment . (:[]) . ppSourceRepo) sourceReposA sourceReposB changesOk "synopsis" fromShortText synopsisA synopsisB changesOk "description" fromShortText descriptionA descriptionB @@ -365,6 +369,12 @@ checkPackageDescriptions checkXRevision when checkXRevision $ checkRevision customFieldsPDA customFieldsPDB checkCuration customFieldsPDA customFieldsPDB + where +#if MIN_VERSION_Cabal(3,7,0) + noComment _ = NoComment +#else + noComment _ = [] +#endif checkSpecVersionRaw :: Check PackageDescription checkSpecVersionRaw pdA pdB @@ -625,10 +635,20 @@ checkExecutable componentName checkTestSuite :: ComponentName -> Check TestSuite checkTestSuite componentName +#if MIN_VERSION_Cabal(3,7,0) + (TestSuite _nameA interfaceA buildInfoA testGeneratorsA) + (TestSuite _nameB interfaceB buildInfoB testGeneratorsB) +#else (TestSuite _nameA interfaceA buildInfoA) - (TestSuite _nameB interfaceB buildInfoB) = do + (TestSuite _nameB interfaceB buildInfoB) +#endif + = do checkSame "Cannot change test-suite type" interfaceA interfaceB checkBuildInfo componentName buildInfoA buildInfoB +#if MIN_VERSION_Cabal(3,7,0) + -- @test-generators@ + checkSame "Cannot change test-generators" testGeneratorsA testGeneratorsB +#endif checkBenchmark :: ComponentName -> Check Benchmark checkBenchmark componentName @@ -690,6 +710,7 @@ changesOkSet what render old new = do logChange (Change Normal ("removed " ++ what) (renderSet removed) "") unless (Set.null added) $ logChange (Change Normal ("added " ++ what) "" (renderSet added)) + return () where added = new Set.\\ old removed = old Set.\\ new From 32505ede3a904a918a7f2bc4f8e6eba3d034ecfa Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Tue, 25 Oct 2022 23:45:14 +0200 Subject: [PATCH 2/7] CI: relax constraint on installed packages --- .github/workflows/haskell-ci.yml | 1 - cabal.haskell-ci | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 2cfba1ab7..bdeb4501c 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -191,7 +191,6 @@ jobs: echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan diff --git a/cabal.haskell-ci b/cabal.haskell-ci index e8ddbd02d..214c9e1be 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,6 +1,7 @@ branches: master ci* -installed: +all -Cabal -text -parsec +installed: -all +-- installed: +all -Cabal -text -parsec -- -- irc-channels works with GHA, but why send to a channel -- -- when one can subscribe to github notifications? From 2caabc9ec5b99900dab0fbe57d3289fa69d9517d Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Wed, 26 Oct 2022 09:27:39 +0200 Subject: [PATCH 3/7] Drop GHC 8.8 and fix ghc to installed version on CI --- .github/workflows/haskell-ci.yml | 51 ++++++++++---------------------- cabal.haskell-ci | 2 +- hackage-server.cabal | 2 +- 3 files changed, 17 insertions(+), 38 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index bdeb4501c..8727e90f6 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -54,34 +54,19 @@ jobs: compilerVersion: 8.10.7 setup-method: ghcup allow-failure: false - - compiler: ghc-8.8.4 - compilerKind: ghc - compilerVersion: 8.8.4 - setup-method: hvr-ppa - allow-failure: false fail-fast: false steps: - name: apt run: | apt-get update apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 - if [ "${{ matrix.setup-method }}" = ghcup ]; then - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - apt-get update - apt-get install -y libbrotli-dev - else - apt-add-repository -y 'ppa:hvr/ghc' - apt-get update - apt-get install -y "$HCNAME" libbrotli-dev - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup" + chmod a+x "$HOME/.ghcup/bin/ghcup" + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + apt-get update + apt-get install -y libbrotli-dev env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -93,20 +78,11 @@ jobs: echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" HCDIR=/opt/$HCKIND/$HCVER - if [ "${{ matrix.setup-method }}" = ghcup ]; then - HC=$HOME/.ghcup/bin/$HCKIND-$HCVER - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" - echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" - else - HC=$HCDIR/bin/$HCKIND - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" - echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - + HC=$HOME/.ghcup/bin/$HCKIND-$HCVER + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" + echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" @@ -191,6 +167,9 @@ jobs: echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local < Date: Wed, 26 Oct 2022 15:55:02 +0200 Subject: [PATCH 4/7] Haskell CI: switch off testing for GHC 9.2 and below Reason: https://github.com/haskell/cabal/issues/8554 Cabal-3.8.1.0 does not work with ghc < 9.4 needed by doctest-parallel --- .github/workflows/haskell-ci.yml | 8 +++----- cabal.haskell-ci | 14 ++++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 8727e90f6..8f6b7ce2c 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -85,7 +85,7 @@ jobs: echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" - echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" ; else echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" ; fi echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" echo "HEADHACKAGE=false" >> "$GITHUB_ENV" echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" @@ -167,9 +167,7 @@ jobs: echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local <> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -194,7 +192,7 @@ jobs: $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - name: tests run: | - $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct ; fi - name: cabal check run: | cd ${PKGDIR_hackage_server} || false diff --git a/cabal.haskell-ci b/cabal.haskell-ci index f6c1cffd7..1f750fc33 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,11 +1,8 @@ branches: master ci* -installed: -all +ghc --- installed: +all -Cabal -text -parsec - --- -- irc-channels works with GHA, but why send to a channel --- -- when one can subscribe to github notifications? --- irc-channels: irc.libera.chat#hackage +installed: +all -Cabal -text -parsec +-- Did not help to salvage ghc-9.2 and below: +-- installed: -all +ghc -- Does not work with GHA: -- -- allow failures with ghc-7.6 and ghc-7.8 @@ -20,3 +17,8 @@ apt: libbrotli-dev -- even though we don't define any library. haddock-components: all -- since haskell-ci 0.15.20220822 + +tests: >= 9.4 + -- parallel-doctest uses the ghc package + -- and thus does not build with Cabal-3.8.1.0 below GHC 9.4 + -- See: https://github.com/haskell/cabal/issues/8554 From ea741988d7b182b0463fc49ee5eefc7be5a567de Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Wed, 26 Oct 2022 17:21:45 +0200 Subject: [PATCH 5/7] Haskell CI: relax `process`, so `Cabal-3.8.1.0` can get its beloved 1.6.14 --- .github/workflows/haskell-ci.yml | 2 +- cabal.haskell-ci | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 8f6b7ce2c..4a2f3c65d 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -167,7 +167,7 @@ jobs: echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(Cabal|hackage-server|parsec|process|text)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 1f750fc33..47b30a66e 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,6 +1,8 @@ branches: master ci* -installed: +all -Cabal -text -parsec +installed: +all -Cabal -text -parsec -process + -- Cabal-3.8.1.0 wants process-1.6.14 or newer + -- Did not help to salvage ghc-9.2 and below: -- installed: -all +ghc From 70d942d07adef89d4b08493d578f1daf26036eb3 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Fri, 28 Oct 2022 07:52:16 +0200 Subject: [PATCH 6/7] allow-older: Cabal:process to work around haskell/cabal#8554 --- cabal.project | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cabal.project b/cabal.project index c8dcbd200..82a1e8f21 100644 --- a/cabal.project +++ b/cabal.project @@ -11,6 +11,17 @@ packages: . allow-newer: rss:time, rss:base +-- Andreas, 2022-10-28: `Cabal-3.8.1.0` wants `process >= 1.6.14` +-- which is too new for the `ghc < 9.4` package that is pulled in +-- by `doctest-parallel`. +-- Since, Cabal-3.8.1.0 has no reason to want such a new version +-- of process, we can solve the conflict here by allowing +-- `Cabal` to use the shipped version of `process`. +-- This workaround can be removed once `Cabal-3.8` drops +-- its (unreasonable) constraint on `process`. +-- See: https://github.com/haskell/cabal/issues/8554 +allow-older: Cabal:process + ----------------------------------------------------------------------------- -- Anti-constraints From c1002d49a02befbef638b26c2fcaeb1747e428f8 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Sat, 29 Oct 2022 06:30:16 +0200 Subject: [PATCH 7/7] Haskell CI: bring back GHC 8.8.4 --- .github/workflows/haskell-ci.yml | 48 ++++++++++++++++++++++++-------- hackage-server.cabal | 2 +- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 4a2f3c65d..0227cfcab 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -54,19 +54,34 @@ jobs: compilerVersion: 8.10.7 setup-method: ghcup allow-failure: false + - compiler: ghc-8.8.4 + compilerKind: ghc + compilerVersion: 8.8.4 + setup-method: hvr-ppa + allow-failure: false fail-fast: false steps: - name: apt run: | apt-get update apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - apt-get update - apt-get install -y libbrotli-dev + if [ "${{ matrix.setup-method }}" = ghcup ]; then + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup" + chmod a+x "$HOME/.ghcup/bin/ghcup" + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + apt-get update + apt-get install -y libbrotli-dev + else + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" libbrotli-dev + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup" + chmod a+x "$HOME/.ghcup/bin/ghcup" + "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + fi env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -78,11 +93,20 @@ jobs: echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" HCDIR=/opt/$HCKIND/$HCVER - HC=$HOME/.ghcup/bin/$HCKIND-$HCVER - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" - echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" + if [ "${{ matrix.setup-method }}" = ghcup ]; then + HC=$HOME/.ghcup/bin/$HCKIND-$HCVER + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" + echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" + else + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" + fi + HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" ; else echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" ; fi diff --git a/hackage-server.cabal b/hackage-server.cabal index 40c7595ef..9120afead 100644 --- a/hackage-server.cabal +++ b/hackage-server.cabal @@ -27,7 +27,7 @@ copyright: 2008-2015 Duncan Coutts, license: BSD-3-Clause license-file: LICENSE -tested-with: GHC == { 9.4.2, 9.2.4, 9.0.2, 8.10.7 } +tested-with: GHC == { 9.4.2, 9.2.4, 9.0.2, 8.10.7, 8.8.4 } data-dir: datafiles data-files: