diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 50bf26d..7d598f8 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.18 +# version: 0.19.20240608 # -# REGENDATA ("0.18",["github","cabal.project"]) +# REGENDATA ("0.19.20240608",["github","cabal.project"]) # name: Haskell-CI on: @@ -27,19 +27,24 @@ jobs: timeout-minutes: 60 container: - image: buildpack-deps:bionic + image: buildpack-deps:jammy continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include: - - compiler: ghc-9.8.1 + - compiler: ghc-9.10.1 compilerKind: ghc - compilerVersion: 9.8.1 + compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false - - compiler: ghc-9.6.4 + - compiler: ghc-9.8.2 compilerKind: ghc - compilerVersion: 9.6.4 + compilerVersion: 9.8.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.6.5 + compilerKind: ghc + compilerVersion: 9.6.5 setup-method: ghcup allow-failure: false - compiler: ghc-9.4.8 @@ -65,22 +70,12 @@ jobs: - compiler: ghc-8.8.4 compilerKind: ghc compilerVersion: 8.8.4 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - compiler: ghc-8.6.5 compilerKind: ghc compilerVersion: 8.6.5 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.2.2 - compilerKind: ghc - compilerVersion: 8.2.2 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false fail-fast: false steps: @@ -88,21 +83,11 @@ jobs: 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.20.0/x86_64-linux-ghcup-0.1.20.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.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - else - apt-add-repository -y 'ppa:hvr/ghc' - apt-get update - apt-get install -y "$HCNAME" - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.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.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -114,22 +99,13 @@ 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/ghcup" whereis ghc "$HCVER") - HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') - HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" - echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.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.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - + HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") + HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') + HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.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" @@ -186,7 +162,7 @@ jobs: chmod a+x $HOME/.cabal/bin/cabal-plan cabal-plan --version - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: source - name: initial cabal.project for sdist @@ -216,7 +192,7 @@ jobs: allow-newer: cabal-install-parsers-0.6.1:base allow-newer: cabal-install-parsers-0.6.1:transformers EOF - $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(Cabal|Cabal-syntax|cabal-plan)$/; }' >> cabal.project.local + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(Cabal|Cabal-syntax|cabal-plan)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -224,7 +200,7 @@ jobs: $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan - name: restore cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store @@ -251,7 +227,7 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 if: always() with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} diff --git a/ChangeLog.md b/ChangeLog.md index 523f6d1..99af89b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,14 @@ # Revision history for `cabal-plan` +## 0.7.4.0 + +* Use Cabal-syntax-3.12 +* Support GHC-8.6.5...9.10.1 + +## 0.7.3.0 + +* Use Cabal-syntax-3.10 + ## 0.7.2.3 * Fix issue in previous release (license generation didn't work at all) diff --git a/cabal-plan.cabal b/cabal-plan.cabal index e6762ee..52c50a5 100644 --- a/cabal-plan.cabal +++ b/cabal-plan.cabal @@ -1,54 +1,52 @@ -cabal-version: 2.2 -name: cabal-plan -version: 0.7.3.0 -x-revision: 3 - -synopsis: Library and utility for processing cabal's plan.json file -description: { -This package provides a library (see "Cabal.Plan") for decoding @plan.json@ files as -well as the simple tool @cabal-plan@ for extracting and pretty printing -the information contained in the @plan.json@ file. -. -@plan.json@ files are generated by [cabal](https://hackage.haskell.org/package/cabal-install)'s [Nix-style local builds](http://cabal.readthedocs.io/en/latest/nix-local-build.html) and contain detailed information about the build/install plan computed by the cabal solver. -. -== @cabal-plan@ utility -. -The @cabal-plan@ executable (enabled via the @exe@ cabal flag) provides various operations: -. -[info] Show basic report of dependency tree -[show] Dump 'PlanJson' data-structure via 'Show' instance -[tred] Show dependency tree as a graph -[diff] Diff two install plans -[list-bins] List all binaries -[list-bin] List single binary (useful for scripting, e.g. @cabal list-bin exe:cabal-plan@) -[fingerprint] Print SHA256 sums of dependencies' source tarballs and cabal files -[dot] Generate graph of dependencies in @.dot@ format -[topo] Print plan topologically sorted -[license-report] Generate license report for a component (only available when built with @license-report@ flag enabled); see () -. -See also ["New things in Haskell package QA" Blogpost](https://oleg.fi/gists/posts/2018-01-08-haskell-package-qa.html) for a description of the @topo@ and @dot@ operations as well as how to enable tab-completion. -} - -bug-reports: https://github.com/hvr/cabal-plan/issues -license: GPL-2.0-or-later -license-files: LICENSE.GPLv2 LICENSE.GPLv3 -author: Herbert Valerio Riedel -maintainer: hvr@gnu.org -copyright: 2016 Herbert Valerio Riedel -category: Development -build-type: Simple - +cabal-version: 2.2 +name: cabal-plan +version: 0.7.4.0 +synopsis: Library and utility for processing cabal's plan.json file +description: + This package provides a library (see "Cabal.Plan") for decoding @plan.json@ files as + well as the simple tool @cabal-plan@ for extracting and pretty printing + the information contained in the @plan.json@ file. + . + @plan.json@ files are generated by [cabal](https://hackage.haskell.org/package/cabal-install)'s [Nix-style local builds](http://cabal.readthedocs.io/en/latest/nix-local-build.html) and contain detailed information about the build/install plan computed by the cabal solver. + . + == @cabal-plan@ utility + . + The @cabal-plan@ executable (enabled via the @exe@ cabal flag) provides various operations: + . + [info] Show basic report of dependency tree + [show] Dump 'PlanJson' data-structure via 'Show' instance + [tred] Show dependency tree as a graph + [diff] Diff two install plans + [list-bins] List all binaries + [list-bin] List single binary (useful for scripting, e.g. @cabal list-bin exe:cabal-plan@) + [fingerprint] Print SHA256 sums of dependencies' source tarballs and cabal files + [dot] Generate graph of dependencies in @.dot@ format + [topo] Print plan topologically sorted + [license-report] Generate license report for a component (only available when built with @license-report@ flag enabled); see () + . + See also ["New things in Haskell package QA" Blogpost](https://oleg.fi/gists/posts/2018-01-08-haskell-package-qa.html) for a description of the @topo@ and @dot@ operations as well as how to enable tab-completion. + +bug-reports: https://github.com/hvr/cabal-plan/issues +license: GPL-2.0-or-later +license-files: + LICENSE.GPLv2 + LICENSE.GPLv3 + +author: Herbert Valerio Riedel +maintainer: hvr@gnu.org +copyright: 2016 Herbert Valerio Riedel +category: Development +build-type: Simple tested-with: - GHC==9.8.1, - GHC==9.6.4, - GHC==9.4.8, - GHC==9.2.8, - GHC==9.0.2, - GHC==8.10.7, - GHC==8.8.4, - GHC==8.6.5, - GHC==8.4.4, - GHC==8.2.2 + GHC ==8.6.5 + || ==8.8.4 + || ==8.10.7 + || ==9.0.2 + || ==9.2.8 + || ==9.4.8 + || ==9.6.5 + || ==9.8.2 + || ==9.10.1 extra-source-files: ChangeLog.md @@ -63,86 +61,96 @@ flag exe description: Enable @exe:cabal-plan@ component flag license-report - description: Enable @license-report@ sub-command (only relevant when the @exe@ flag is active) - manual: True - default: False + description: + Enable @license-report@ sub-command (only relevant when the @exe@ flag is active) + + manual: True + default: False flag _ description: Enable underlining of primary unit-ids - manual: True - default: False + manual: True + default: False library - default-language: Haskell2010 - other-extensions: OverloadedStrings - GeneralizedNewtypeDeriving - RecordWildCards - exposed-modules: Cabal.Plan - - build-depends: base ^>= 4.10.0.0 || ^>=4.11.0.0 || ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0 || ^>=4.15.0.0 || ^>=4.16.0.0 || ^>=4.17.0.0 || ^>=4.18.0.0 || ^>=4.19.0.0 - , aeson ^>= 2.0.0.0 || ^>=2.1.0.0 || ^>=2.2.0.0 - , bytestring ^>= 0.10.8.0 || ^>=0.11.1.0 || ^>=0.12.0.0 - , containers ^>= 0.5.10 || ^>= 0.6.0.1 - , text ^>= 1.2.3 || ^>=2.0.1 || ^>=2.1 - , directory ^>= 1.3.0.2 - , filepath ^>= 1.4.1.2 - , base16-bytestring ^>= 1.0.0.0 - - hs-source-dirs: src - - ghc-options: -Wall + default-language: Haskell2010 + other-extensions: + GeneralizedNewtypeDeriving + OverloadedStrings + RecordWildCards + + exposed-modules: Cabal.Plan + build-depends: + , aeson ^>=2.2.0.0 + , base ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0 || ^>=4.15.0.0 || ^>=4.16.0.0 || ^>=4.17.0.0 || ^>=4.18.0.0 || ^>=4.19.0.0 || ^>=4.20.0.0 + , base16-bytestring ^>=1.0.2.0 + , bytestring ^>=0.10.8.2 || ^>=0.11.1.0 || ^>=0.12.0.0 + , containers ^>=0.6.0.1 || ^>=0.7 + , directory ^>=1.3.0.2 + , filepath ^>=1.4.1.2 || ^>=1.5.2.0 + , text ^>=1.2.3.0 || ^>=2.0.1 || ^>=2.1 + + hs-source-dirs: src + ghc-options: -Wall executable cabal-plan - default-language: Haskell2010 - other-extensions: RecordWildCards - - hs-source-dirs: src-exe - main-is: cabal-plan.hs - other-modules: Paths_cabal_plan LicenseReport Flag ProcessLazyByteString - other-modules: CText - autogen-modules: Paths_cabal_plan - ghc-options: -Wall + default-language: Haskell2010 + other-extensions: RecordWildCards + hs-source-dirs: src-exe + main-is: cabal-plan.hs + other-modules: + Flag + LicenseReport + Paths_cabal_plan + ProcessLazyByteString + + other-modules: CText + autogen-modules: Paths_cabal_plan + ghc-options: -Wall if flag(exe) -- dependencies w/ inherited version ranges via 'cabal-plan' library -- Note: exe is installable only with GHC-8.0+ - build-depends: cabal-plan - , base - , text - , containers - , bytestring - , directory + build-depends: + , base + , bytestring + , cabal-plan + , containers + , directory + , text -- dependencies which require version bounds - build-depends: mtl ^>= 2.2.2 || ^>=2.3.1 - , async ^>= 2.2.2 - , ansi-terminal ^>= 0.11 || ^>=1.0 || ^>=1.1 - , base-compat ^>= 0.13.0 - , optics-core ^>= 0.4 - , optparse-applicative ^>=0.17.0.0 || ^>=0.18.1.0 - , parsec ^>= 3.1.13 - , process ^>= 1.6.1.0 - , semialign ^>= 1.3 - , singleton-bool ^>= 0.1.5 - , these ^>= 1.2 - , topograph ^>= 1.0.0.2 - , transformers ^>= 0.5.2.0 || ^>=0.6.1.0 - , vector ^>= 0.12.0.1 || ^>=0.13.0.0 + build-depends: + , ansi-terminal ^>=1.1 + , async ^>=2.2.2 + , mtl ^>=2.2.2 || ^>=2.3.1 + , optics-core ^>=0.4 + , optparse-applicative ^>=0.18.1.0 + , parsec ^>=3.1.13 + , process ^>=1.6.1.0 + , semialign ^>=1.3 + , singleton-bool ^>=0.1.8 + , these ^>=1.2.1 + , topograph ^>=1.0.0.2 + , transformers ^>=0.5.6.2 || ^>=0.6.1.0 + , vector ^>=0.13.0.0 if flag(license-report) - build-depends: Cabal-syntax ^>=3.10.1.0 - , cabal-install-parsers ^>=0.6 - , tar ^>= 0.5.1.0 || ^>=0.6.1.0 - , zlib ^>= 0.6.2 - , filepath ^>= 1.4.1.1 + build-depends: + , cabal-install-parsers ^>=0.6.2 + , Cabal-syntax ^>=3.12.0.0 + , filepath ^>=1.4.1.2 || ^>=1.5.2.0 + , tar ^>=0.6.1.0 + , zlib ^>=0.7.1.0 if flag(_) cpp-options: -DUNDERLINE_SUPPORT + else buildable: False - ghc-options: -Wall + ghc-options: -Wall source-repository head - type: git + type: git location: https://github.com/hvr/cabal-plan diff --git a/cabal.haskell-ci b/cabal.haskell-ci index b815a28..5772f52 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,3 +1,2 @@ -distribution: bionic branches: master installed: +all -Cabal -Cabal-syntax diff --git a/src-exe/CText.hs b/src-exe/CText.hs index 83261b8..2fa71d6 100644 --- a/src-exe/CText.hs +++ b/src-exe/CText.hs @@ -21,7 +21,7 @@ module CText ( module System.Console.ANSI, ) where -import Control.Monad.Compat (ap, unless) +import Control.Monad (ap, unless) import Control.Monad.State.Strict (StateT) import Control.Monad.Trans.Class (lift) import Data.Foldable (for_) diff --git a/src-exe/Flag.hs b/src-exe/Flag.hs index b09cad1..763f52e 100644 --- a/src-exe/Flag.hs +++ b/src-exe/Flag.hs @@ -14,9 +14,6 @@ module Flag ( switchM, ) where -import Prelude () -import Prelude.Compat - import Control.Applicative ((<|>)) import Data.Semigroup (Semigroup (..)) import Data.Singletons.Bool diff --git a/src-exe/LicenseReport.hs b/src-exe/LicenseReport.hs index cc9ec0b..849bb1b 100644 --- a/src-exe/LicenseReport.hs +++ b/src-exe/LicenseReport.hs @@ -14,7 +14,7 @@ import Cabal.Plan import qualified Codec.Archive.Tar as Tar import qualified Codec.Archive.Tar.Entry as Tar import qualified Codec.Compression.GZip as GZip -import Control.Monad.Compat (forM, forM_, guard, unless, when) +import Control.Monad (forM, forM_, guard, unless, when) import qualified Data.ByteString.Lazy as BSL import qualified Data.ByteString as BS import Data.Functor.Identity (Identity (..)) @@ -35,8 +35,6 @@ import System.Directory import System.FilePath import System.IO (stderr) import Text.ParserCombinators.ReadP -import Prelude () -import Prelude.Compat import Cabal.Config (readConfig, Config (..), cfgRepoIndex, hackageHaskellOrg) diff --git a/src-exe/cabal-plan.hs b/src-exe/cabal-plan.hs index 134fe42..70949d1 100644 --- a/src-exe/cabal-plan.hs +++ b/src-exe/cabal-plan.hs @@ -7,10 +7,7 @@ -- | SPDX-License-Identifier: GPL-2.0-or-later module Main where -import Prelude () -import Prelude.Compat - -import Control.Monad.Compat (guard, unless, when) +import Control.Monad (guard, unless, when) import Control.Monad.ST (runST) import Control.Monad.State.Strict (StateT, evalStateT, gets, modify') import Data.Align (align)