diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 5195abd..4b68978 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -14,17 +14,17 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - ghc: ['8.10.7'] - cabal: ['3.6.2.0'] + ghc: ['9.6'] + cabal: ['3.10'] exclude: # can't build zlib - os: windows-latest - ghc: '8.10.7' - cabal: '3.6.2.0' + ghc: '9.6' + cabal: '3.10' steps: - uses: actions/checkout@v2 - - uses: haskell/actions/setup@v1.2 + - uses: haskell-actions/setup@v2 with: ghc-version: ${{ matrix.ghc }} cabal-version: ${{ matrix.cabal }} @@ -99,7 +99,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: haskell/actions/setup@v1.2 + - uses: haskell-actions/setup@v2 with: enable-stack: true stack-no-global: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 86641f9..677169a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -48,8 +48,8 @@ jobs: - name: Install GHC and cabal run: | - ghcup install ghc --force -i /usr/local 8.10.7 - ghcup install cabal --force -i /usr/local/bin 3.6.2.0 + ghcup install ghc --force -i /usr/local 9.6.4 + ghcup install cabal --force -i /usr/local/bin 3.10.2.1 shell: bash - name: Update cabal cache @@ -144,7 +144,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - uses: haskell/actions/setup@v1.2 + - uses: haskell-actions/setup@v2 with: ghc-version: 8.10.7 cabal-version: 3.6.2.0 diff --git a/Dockerfile b/Dockerfile index 5f123b2..d2ab63d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.12 as builder -ARG GHC=8.10.7 +ARG GHC=9.6.4 # install ghc and stack RUN \ diff --git a/cabal.project.freeze b/cabal.project.freeze deleted file mode 100644 index fa4ae49..0000000 --- a/cabal.project.freeze +++ /dev/null @@ -1,196 +0,0 @@ -active-repositories: hackage.haskell.org:merge -constraints: any.Cabal ==3.2.1.0, - any.Glob ==0.10.2, - any.HUnit ==1.6.2.0, - any.HsYAML ==0.2.1.1, - HsYAML -exe, - any.OneTuple ==0.3.1, - any.QuickCheck ==2.14.2, - QuickCheck -old-random +templatehaskell, - any.StateVar ==1.2.2, - any.adjunctions ==4.4.2, - any.aeson ==2.1.1.0, - aeson -cffi +ordered-keymap, - any.ansi-terminal ==0.11.3, - ansi-terminal -example, - any.ansi-wl-pprint ==0.6.9, - ansi-wl-pprint -example, - any.appar ==0.1.8, - any.array ==0.5.4.0, - any.asn1-encoding ==0.9.6, - any.asn1-parse ==0.9.5, - any.asn1-types ==0.3.4, - any.assoc ==1.0.2, - any.async ==2.2.4, - async -bench, - any.attoparsec ==0.14.4, - attoparsec -developer, - any.base ==4.14.3.0, - any.base-compat ==0.12.2, - any.base-compat-batteries ==0.12.2, - any.base-orphans ==0.8.7, - any.base64-bytestring ==1.2.1.0, - any.basement ==0.0.15, - any.bifunctors ==5.5.13, - bifunctors +semigroups +tagged, - any.binary ==0.8.8.0, - any.bitvec ==1.1.3.0, - bitvec -libgmp, - any.blaze-builder ==0.4.2.2, - any.byteorder ==1.0.4, - any.bytestring ==0.10.12.0, - any.call-stack ==0.4.0, - any.case-insensitive ==1.2.1.0, - any.cereal ==0.5.8.3, - cereal -bytestring-builder, - any.clock ==0.8.3, - clock -llvm, - any.colour ==2.3.6, - any.comonad ==5.0.8, - comonad +containers +distributive +indexed-traversable, - any.conduit ==1.3.4.2, - any.connection ==0.3.1, - any.containers ==0.6.5.1, - any.contravariant ==1.5.5, - contravariant +semigroups +statevar +tagged, - any.cookie ==0.4.5, - any.cryptonite ==0.30, - cryptonite -check_alignment +integer-gmp -old_toolchain_inliner +support_aesni +support_deepseq -support_pclmuldq +support_rdrand -support_sse +use_target_attributes, - any.data-default-class ==0.1.2.0, - any.data-fix ==0.3.2, - any.deepseq ==1.4.4.0, - any.directory ==1.3.6.0, - any.distributive ==0.6.2.1, - distributive +semigroups +tagged, - any.dlist ==1.0, - dlist -werror, - any.exceptions ==0.10.4, - any.extra ==1.7.12, - any.filepath ==1.4.2.1, - any.filepattern ==0.1.3, - any.free ==5.1.9, - any.fuzzy-dates ==0.1.1.2, - any.generically ==0.1, - any.ghc ==8.10.7, - any.ghc-boot ==8.10.7, - any.ghc-boot-th ==8.10.7, - any.ghc-heap ==8.10.7, - any.ghc-prim ==0.6.1, - any.ghci ==8.10.7, - any.hashable ==1.4.1.0, - hashable +containers +integer-gmp -random-initial-seed, - any.hourglass ==0.2.12, - any.hpack ==0.35.0, - any.hpc ==0.6.1.0, - any.hsc2hs ==0.68.8, - hsc2hs -in-ghc-tree, - any.hspec ==2.10.6, - any.hspec-core ==2.10.6, - any.hspec-discover ==2.10.6, - any.hspec-expectations ==0.8.2, - any.http-client ==0.7.13.1, - http-client +network-uri, - any.http-client-tls ==0.3.6.1, - any.http-types ==0.12.3, - any.indexed-traversable ==0.1.2, - any.indexed-traversable-instances ==0.1.1.1, - any.infer-license ==0.2.0, - any.integer-gmp ==1.0.3.0, - any.integer-logarithms ==1.0.3.1, - integer-logarithms -check-bounds +integer-gmp, - any.invariant ==0.6, - any.iproute ==1.7.12, - any.kan-extensions ==5.2.5, - any.lens ==5.2, - lens -benchmark-uniplate -dump-splices +inlining -j +test-hunit +test-properties +test-templates +trustworthy, - any.libyaml ==0.1.2, - libyaml -no-unicode -system-libyaml, - any.memory ==0.18.0, - memory +support_bytestring +support_deepseq, - any.mime-types ==0.1.1.0, - any.mono-traversable ==1.0.15.3, - any.mtl ==2.2.2, - any.network ==3.1.2.7, - network -devel, - any.network-uri ==2.6.4.1, - any.optparse-applicative ==0.17.0.0, - optparse-applicative +process, - any.parallel ==3.2.2.0, - any.parsec ==3.1.14.0, - any.pem ==0.2.4, - any.pretty ==1.1.3.6, - any.primitive ==0.7.4.0, - any.process ==1.6.13.2, - any.profunctors ==5.6.2, - any.quickcheck-io ==0.2.0, - any.random ==1.2.1.1, - any.reflection ==2.1.6, - reflection -slow +template-haskell, - any.resourcet ==1.2.6, - any.rts ==1.0.1, - any.safe ==0.3.19, - any.scientific ==0.3.7.0, - scientific -bytestring-builder -integer-simple, - any.semialign ==1.2.0.1, - semialign +semigroupoids, - any.semigroupoids ==5.3.7, - semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers, - any.semigroups ==0.20, - semigroups +binary +bytestring -bytestring-builder +containers +deepseq +hashable +tagged +template-haskell +text +transformers +unordered-containers, - any.setenv ==0.1.1.3, - any.socks ==0.6.1, - any.split ==0.2.3.5, - any.splitmix ==0.1.0.4, - splitmix -optimised-mixer, - stack2cabal -ghcflags, - any.stm ==2.5.0.1, - any.streaming-commons ==0.2.2.4, - streaming-commons -use-bytestring-builder, - any.strict ==0.4.0.1, - strict +assoc, - any.tagged ==0.8.6.1, - tagged +deepseq +transformers, - any.template-haskell ==2.16.0.0, - any.temporary ==1.3, - any.terminfo ==0.4.1.4, - any.text ==1.2.4.1, - any.text-metrics ==0.3.2, - text-metrics -dev, - any.text-short ==0.1.5, - text-short -asserts, - any.tf-random ==0.5, - any.th-abstraction ==0.4.5.0, - any.th-compat ==0.1.4, - any.these ==1.1.1.1, - these +assoc, - any.time ==1.9.3, - any.time-compat ==1.9.6.1, - time-compat -old-locale, - any.tls ==1.6.0, - tls +compat -hans +network, - any.transformers ==0.5.6.2, - any.transformers-base ==0.4.6, - transformers-base +orphaninstances, - any.transformers-compat ==0.7.2, - transformers-compat -five +five-three -four +generic-deriving +mtl -three -two, - any.unix ==2.7.2.2, - any.unliftio-core ==0.2.0.1, - any.unordered-containers ==0.2.19.1, - unordered-containers -debug, - any.uuid-types ==1.0.5, - any.vector ==0.12.3.1, - vector +boundschecks -internalchecks -unsafechecks -wall, - any.vector-algorithms ==0.9.0.1, - vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks, - any.void ==0.7.3, - void -safe, - any.witherable ==0.4.2, - any.x509 ==1.7.7, - any.x509-store ==1.6.9, - any.x509-system ==1.6.7, - any.x509-validation ==1.6.12, - any.yaml ==0.11.8.0, - yaml +no-examples +no-exe, - any.zlib ==0.6.3.0, - zlib -bundled-c-zlib -non-blocking-ffi -pkg-config -index-state: hackage.haskell.org 2022-09-28T17:08:53Z diff --git a/lib/StackageToHackage/Hackage.hs b/lib/StackageToHackage/Hackage.hs index 0939e60..1f5b3fd 100644 --- a/lib/StackageToHackage/Hackage.hs +++ b/lib/StackageToHackage/Hackage.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} @@ -39,7 +40,11 @@ import Data.List.Extra (nubOrd, nubOrdOn, lower, dropPrefix, dropSuffix) import Data.List.NonEmpty (NonEmpty((:|))) import Data.Maybe (fromMaybe, mapMaybe, catMaybes) import Data.Text (Text) +#if MIN_VERSION_Cabal(3, 8, 0) +import Distribution.Simple.PackageDescription (readGenericPackageDescription) +#else import Distribution.PackageDescription.Parsec (readGenericPackageDescription) +#endif import Distribution.Pretty (prettyShow) import Distribution.Types.GenericPackageDescription (GenericPackageDescription(..)) diff --git a/lib/StackageToHackage/Stackage.hs b/lib/StackageToHackage/Stackage.hs index 4d36952..5d8232c 100644 --- a/lib/StackageToHackage/Stackage.hs +++ b/lib/StackageToHackage/Stackage.hs @@ -141,8 +141,8 @@ mergeResolvers (Resolver r c p f) (Resolver r' c' p' f') = mergeDeps :: [Dep] -> [Dep] -> [Dep] mergeDeps lhs rhs = let nonGits = filter (not . isGitDep) lhs <> filter (not . isGitDep) rhs - gitsLhs = (\(SourceDep dep) -> dep) <$> filter isGitDep lhs - gitsRhs = (\(SourceDep dep) -> dep) <$> filter isGitDep rhs + gitsLhs = [dep | SourceDep dep <- lhs] + gitsRhs = [dep | SourceDep dep <- rhs] gitMerged = foldl' (\m key -> update key m) gitsRhs gitsLhs in (SourceDep <$> gitMerged) <> nonGits diff --git a/stack.yaml b/stack.yaml index 95bc743..aaaa949 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,5 +1,3 @@ -resolver: lts-18.28 +resolver: lts-22.13 packages: - . -extra-deps: -- hpack-0.35.0@sha256:8cd6146fae269390f41dc7237ebd2c479074d4163806d349a41f5a7751d6cea5,4726 \ No newline at end of file diff --git a/stack2cabal.cabal b/stack2cabal.cabal index 95cbf1a..d1ef0ea 100644 --- a/stack2cabal.cabal +++ b/stack2cabal.cabal @@ -34,7 +34,7 @@ common deps build-depends: , base >=4.13 && <5.0 , bytestring - , Cabal >=3.0 && <3.8 + , Cabal >=3.0 && <3.12 , containers , directory , exceptions ^>=0.10.4 diff --git a/tests/hpack/hpack.cabal b/tests/hpack/hpack.cabal index 9dd11e7..28e996b 100644 --- a/tests/hpack/hpack.cabal +++ b/tests/hpack/hpack.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.5. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack --