pantry 0.11.4 → 0.11.5
raw patch · 3 files changed
+368/−345 lines, 3 filesdep ~CabalPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Cabal
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- pantry.cabal +343/−343
- src/Pantry/Tree.hs +21/−2
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for pantry +## v0.11.5 + +* Support `Cabal-3.18.1.0`. + ## v0.11.4 * If snapshot locations are cyclic, loading a snapshot throws an exception
pantry.cabal view
@@ -1,344 +1,344 @@ cabal-version: 2.0 - --- This file has been generated from package.yaml by hpack version 0.39.6. --- --- see: https://github.com/sol/hpack - -name: pantry -version: 0.11.4 -synopsis: Content addressable Haskell package management -description: Please see the README on GitHub at <https://github.com/commercialhaskell/pantry#readme> -category: Development -homepage: https://github.com/commercialhaskell/pantry#readme -bug-reports: https://github.com/commercialhaskell/pantry/issues -author: Michael Snoyman -maintainer: michael@snoyman.com -copyright: 2018-2026 FP Complete -license: BSD3 -license-file: LICENSE -build-type: Simple -extra-source-files: - CONTRIBUTING.md - README.md - ChangeLog.md - attic/hpack-0.1.2.3.tar.gz - attic/package-0.1.2.3.tar.gz - attic/symlink-to-dir.tar.gz - -source-repository head - type: git - location: https://github.com/commercialhaskell/pantry - -flag test-pretty-exceptions - description: Build an executable to test pretty exceptions - manual: False - default: False - -library - exposed-modules: - Pantry - Pantry.SQLite - Pantry.Internal.Stackage - other-modules: - Hackage.Security.Client.Repository.HttpLib.HttpClient - Pantry.Archive - Pantry.HTTP - Pantry.Hackage - Pantry.Repo - Pantry.Storage - Pantry.Casa - Pantry.Tree - reexported-modules: - Pantry.SHA256 - hs-source-dirs: - src/ - ghc-options: -fwrite-ide-info -hiedir=.hie -Wall - build-depends: - Cabal >=3 && <3.17 - , aeson - , aeson-warning-parser >=0.1.1 - , ansi-terminal - , base >=4.13 && <5 - , bytestring - , casa-client >=0.0.2 - , casa-types - , companion - , conduit - , conduit-extra - , containers - , crypton - , crypton-conduit - , digest - , filelock - , generic-deriving - , hackage-security - , hpack >=0.35.3 - , http-client - , http-client-tls >=0.3.6.2 - , http-conduit - , http-download >=0.2.2.0 - , http-types - , internal - , mtl - , network-uri - , path - , path-io - , persistent - , persistent-sqlite >=2.9.3 - , persistent-template - , primitive - , ram - , resourcet - , rio - , rio-orphans - , rio-prettyprint >=0.1.7.0 - , static-bytes >=0.2.0 - , tar-conduit >=0.4.1 - , text - , text-metrics - , time - , transformers - , unix-compat - , unliftio - , unordered-containers - , vector - , yaml - , zip-archive - default-language: Haskell2010 - if impl(ghc >= 9.4.5) && os(windows) - build-depends: - network >=3.1.2.9 - if os(windows) - other-modules: - System.IsWindows - hs-source-dirs: - src/windows/ - else - other-modules: - System.IsWindows - hs-source-dirs: - src/unix/ - -library internal - exposed-modules: - Pantry.HPack - Pantry.Internal - Pantry.SHA256 - Pantry.Types - hs-source-dirs: - int/ - ghc-options: -fwrite-ide-info -hiedir=.hie -Wall - build-depends: - Cabal >=3 && <3.17 - , aeson - , aeson-warning-parser >=0.1.1 - , ansi-terminal - , base >=4.13 && <5 - , bytestring - , casa-client >=0.0.2 - , casa-types - , companion - , conduit - , conduit-extra - , containers - , crypton - , crypton-conduit - , digest - , filelock - , generic-deriving - , hackage-security - , hpack >=0.35.3 - , http-client - , http-client-tls >=0.3.6.2 - , http-conduit - , http-download >=0.2.2.0 - , http-types - , mtl - , network-uri - , path - , path-io - , persistent - , persistent-sqlite >=2.9.3 - , persistent-template - , primitive - , ram - , resourcet - , rio - , rio-orphans - , rio-prettyprint >=0.1.7.0 - , static-bytes >=0.2.0 - , tar-conduit >=0.4.1 - , text - , text-metrics - , time - , transformers - , unix-compat - , unliftio - , unordered-containers - , vector - , yaml - , zip-archive - default-language: Haskell2010 - if impl(ghc >= 9.4.5) && os(windows) - build-depends: - network >=3.1.2.9 - -executable test-pretty-exceptions - main-is: Main.hs - hs-source-dirs: - app/test-pretty-exceptions - ghc-options: -fwrite-ide-info -hiedir=.hie -Wall - build-depends: - Cabal >=3 && <3.17 - , aeson - , aeson-warning-parser >=0.1.1 - , ansi-terminal - , base >=4.13 && <5 - , bytestring - , casa-client >=0.0.2 - , casa-types - , companion - , conduit - , conduit-extra - , containers - , crypton - , crypton-conduit - , digest - , filelock - , generic-deriving - , hackage-security - , hpack >=0.35.3 - , http-client - , http-client-tls >=0.3.6.2 - , http-conduit - , http-download >=0.2.2.0 - , http-types - , mtl - , network-uri - , optparse-applicative - , pantry - , path - , path-io - , persistent - , persistent-sqlite >=2.9.3 - , persistent-template - , primitive - , ram - , resourcet - , rio - , rio-orphans - , rio-prettyprint >=0.1.7.0 - , static-bytes >=0.2.0 - , tar-conduit >=0.4.1 - , text - , text-metrics - , time - , transformers - , unix-compat - , unliftio - , unordered-containers - , vector - , yaml - , zip-archive - default-language: Haskell2010 - if impl(ghc >= 9.4.5) && os(windows) - build-depends: - network >=3.1.2.9 - if !flag(test-pretty-exceptions) - buildable: False - if os(windows) - other-modules: - PathAbsExamples - System.Terminal - hs-source-dirs: - app/test-pretty-exceptions/windows/ - build-depends: - Win32 - , process - else - other-modules: - PathAbsExamples - System.Terminal - hs-source-dirs: - app/test-pretty-exceptions/unix/ - -test-suite spec - type: exitcode-stdio-1.0 - main-is: Spec.hs - other-modules: - Pantry.ArchiveSpec - Pantry.BuildPlanSpec - Pantry.CabalSpec - Pantry.CasaSpec - Pantry.FileSpec - Pantry.GlobalHintsSpec - Pantry.HackageSpec - Pantry.InternalSpec - Pantry.TreeSpec - Pantry.TypesSpec - hs-source-dirs: - test - ghc-options: -fwrite-ide-info -hiedir=.hie -Wall - build-tool-depends: - hspec-discover:hspec-discover - build-depends: - Cabal >=3 && <3.17 - , QuickCheck - , aeson - , aeson-warning-parser >=0.1.1 - , ansi-terminal - , base >=4.13 && <5 - , bytestring - , casa-client >=0.0.2 - , casa-types - , companion - , conduit - , conduit-extra - , containers - , crypton - , crypton-conduit - , digest - , exceptions - , filelock - , generic-deriving - , hackage-security - , hedgehog - , hpack >=0.35.3 - , hspec - , http-client - , http-client-tls >=0.3.6.2 - , http-conduit - , http-download >=0.2.2.0 - , http-types - , internal - , mtl - , network-uri - , pantry - , path - , path-io - , persistent - , persistent-sqlite >=2.9.3 - , persistent-template - , primitive - , ram - , raw-strings-qq - , resourcet - , rio - , rio-orphans - , rio-prettyprint >=0.1.7.0 - , static-bytes >=0.2.0 - , tar-conduit >=0.4.1 - , text - , text-metrics - , time - , transformers - , unix-compat - , unliftio - , unordered-containers - , vector - , yaml - , zip-archive - default-language: Haskell2010 - if impl(ghc >= 9.4.5) && os(windows) - build-depends: - network >=3.1.2.9 ++-- This file has been generated from package.yaml by hpack version 0.39.6.+--+-- see: https://github.com/sol/hpack++name: pantry+version: 0.11.5+synopsis: Content addressable Haskell package management+description: Please see the README on GitHub at <https://github.com/commercialhaskell/pantry#readme>+category: Development+homepage: https://github.com/commercialhaskell/pantry#readme+bug-reports: https://github.com/commercialhaskell/pantry/issues+author: Michael Snoyman+maintainer: michael@snoyman.com+copyright: 2018-2026 FP Complete+license: BSD3+license-file: LICENSE+build-type: Simple+extra-source-files:+ CONTRIBUTING.md+ README.md+ ChangeLog.md+ attic/hpack-0.1.2.3.tar.gz+ attic/package-0.1.2.3.tar.gz+ attic/symlink-to-dir.tar.gz++source-repository head+ type: git+ location: https://github.com/commercialhaskell/pantry++flag test-pretty-exceptions+ description: Build an executable to test pretty exceptions+ manual: False+ default: False++library+ exposed-modules:+ Pantry+ Pantry.SQLite+ Pantry.Internal.Stackage+ other-modules:+ Hackage.Security.Client.Repository.HttpLib.HttpClient+ Pantry.Archive+ Pantry.HTTP+ Pantry.Hackage+ Pantry.Repo+ Pantry.Storage+ Pantry.Casa+ Pantry.Tree+ reexported-modules:+ Pantry.SHA256+ hs-source-dirs:+ src/+ ghc-options: -fwrite-ide-info -hiedir=.hie -Wall+ build-depends:+ Cabal >=3 && <3.19+ , aeson+ , aeson-warning-parser >=0.1.1+ , ansi-terminal+ , base >=4.13 && <5+ , bytestring+ , casa-client >=0.0.2+ , casa-types+ , companion+ , conduit+ , conduit-extra+ , containers+ , crypton+ , crypton-conduit+ , digest+ , filelock+ , generic-deriving+ , hackage-security+ , hpack >=0.35.3+ , http-client+ , http-client-tls >=0.3.6.2+ , http-conduit+ , http-download >=0.2.2.0+ , http-types+ , internal+ , mtl+ , network-uri+ , path+ , path-io+ , persistent+ , persistent-sqlite >=2.9.3+ , persistent-template+ , primitive+ , ram+ , resourcet+ , rio+ , rio-orphans+ , rio-prettyprint >=0.1.7.0+ , static-bytes >=0.2.0+ , tar-conduit >=0.4.1+ , text+ , text-metrics+ , time+ , transformers+ , unix-compat+ , unliftio+ , unordered-containers+ , vector+ , yaml+ , zip-archive+ default-language: Haskell2010+ if impl(ghc >= 9.4.5) && os(windows)+ build-depends:+ network >=3.1.2.9+ if os(windows)+ other-modules:+ System.IsWindows+ hs-source-dirs:+ src/windows/+ else+ other-modules:+ System.IsWindows+ hs-source-dirs:+ src/unix/++library internal+ exposed-modules:+ Pantry.HPack+ Pantry.Internal+ Pantry.SHA256+ Pantry.Types+ hs-source-dirs:+ int/+ ghc-options: -fwrite-ide-info -hiedir=.hie -Wall+ build-depends:+ Cabal >=3 && <3.19+ , aeson+ , aeson-warning-parser >=0.1.1+ , ansi-terminal+ , base >=4.13 && <5+ , bytestring+ , casa-client >=0.0.2+ , casa-types+ , companion+ , conduit+ , conduit-extra+ , containers+ , crypton+ , crypton-conduit+ , digest+ , filelock+ , generic-deriving+ , hackage-security+ , hpack >=0.35.3+ , http-client+ , http-client-tls >=0.3.6.2+ , http-conduit+ , http-download >=0.2.2.0+ , http-types+ , mtl+ , network-uri+ , path+ , path-io+ , persistent+ , persistent-sqlite >=2.9.3+ , persistent-template+ , primitive+ , ram+ , resourcet+ , rio+ , rio-orphans+ , rio-prettyprint >=0.1.7.0+ , static-bytes >=0.2.0+ , tar-conduit >=0.4.1+ , text+ , text-metrics+ , time+ , transformers+ , unix-compat+ , unliftio+ , unordered-containers+ , vector+ , yaml+ , zip-archive+ default-language: Haskell2010+ if impl(ghc >= 9.4.5) && os(windows)+ build-depends:+ network >=3.1.2.9++executable test-pretty-exceptions+ main-is: Main.hs+ hs-source-dirs:+ app/test-pretty-exceptions+ ghc-options: -fwrite-ide-info -hiedir=.hie -Wall+ build-depends:+ Cabal >=3 && <3.19+ , aeson+ , aeson-warning-parser >=0.1.1+ , ansi-terminal+ , base >=4.13 && <5+ , bytestring+ , casa-client >=0.0.2+ , casa-types+ , companion+ , conduit+ , conduit-extra+ , containers+ , crypton+ , crypton-conduit+ , digest+ , filelock+ , generic-deriving+ , hackage-security+ , hpack >=0.35.3+ , http-client+ , http-client-tls >=0.3.6.2+ , http-conduit+ , http-download >=0.2.2.0+ , http-types+ , mtl+ , network-uri+ , optparse-applicative+ , pantry+ , path+ , path-io+ , persistent+ , persistent-sqlite >=2.9.3+ , persistent-template+ , primitive+ , ram+ , resourcet+ , rio+ , rio-orphans+ , rio-prettyprint >=0.1.7.0+ , static-bytes >=0.2.0+ , tar-conduit >=0.4.1+ , text+ , text-metrics+ , time+ , transformers+ , unix-compat+ , unliftio+ , unordered-containers+ , vector+ , yaml+ , zip-archive+ default-language: Haskell2010+ if impl(ghc >= 9.4.5) && os(windows)+ build-depends:+ network >=3.1.2.9+ if !flag(test-pretty-exceptions)+ buildable: False+ if os(windows)+ other-modules:+ PathAbsExamples+ System.Terminal+ hs-source-dirs:+ app/test-pretty-exceptions/windows/+ build-depends:+ Win32+ , process+ else+ other-modules:+ PathAbsExamples+ System.Terminal+ hs-source-dirs:+ app/test-pretty-exceptions/unix/++test-suite spec+ type: exitcode-stdio-1.0+ main-is: Spec.hs+ other-modules:+ Pantry.ArchiveSpec+ Pantry.BuildPlanSpec+ Pantry.CabalSpec+ Pantry.CasaSpec+ Pantry.FileSpec+ Pantry.GlobalHintsSpec+ Pantry.HackageSpec+ Pantry.InternalSpec+ Pantry.TreeSpec+ Pantry.TypesSpec+ hs-source-dirs:+ test+ ghc-options: -fwrite-ide-info -hiedir=.hie -Wall+ build-tool-depends:+ hspec-discover:hspec-discover+ build-depends:+ Cabal >=3 && <3.19+ , QuickCheck+ , aeson+ , aeson-warning-parser >=0.1.1+ , ansi-terminal+ , base >=4.13 && <5+ , bytestring+ , casa-client >=0.0.2+ , casa-types+ , companion+ , conduit+ , conduit-extra+ , containers+ , crypton+ , crypton-conduit+ , digest+ , exceptions+ , filelock+ , generic-deriving+ , hackage-security+ , hedgehog+ , hpack >=0.35.3+ , hspec+ , http-client+ , http-client-tls >=0.3.6.2+ , http-conduit+ , http-download >=0.2.2.0+ , http-types+ , internal+ , mtl+ , network-uri+ , pantry+ , path+ , path-io+ , persistent+ , persistent-sqlite >=2.9.3+ , persistent-template+ , primitive+ , ram+ , raw-strings-qq+ , resourcet+ , rio+ , rio-orphans+ , rio-prettyprint >=0.1.7.0+ , static-bytes >=0.2.0+ , tar-conduit >=0.4.1+ , text+ , text-metrics+ , time+ , transformers+ , unix-compat+ , unliftio+ , unordered-containers+ , vector+ , yaml+ , zip-archive+ default-language: Haskell2010+ if impl(ghc >= 9.4.5) && os(windows)+ build-depends:+ network >=3.1.2.9
src/Pantry/Tree.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ViewPatterns #-} @@ -10,6 +11,10 @@ import Distribution.PackageDescription.Parsec ( parseGenericPackageDescription, runParseResult ) import Distribution.Parsec ( PWarning (..) ) +#if MIN_VERSION_Cabal(3,18,0) +import Distribution.Parsec + ( PErrorWithSource (..), PWarningWithSource (..) ) +#endif import Pantry.Storage ( loadBlob, withStorage ) import Pantry.Types ( FileType (..), HasPantryConfig, PantryException (..) @@ -58,8 +63,22 @@ -> m ([PWarning], GenericPackageDescription) rawParseGPD loc bs = case eres of - Left (mversion, errs) -> + Left (mversion, errs') -> do + let errs = normaliseErrors errs' throwM $ InvalidCabalFile loc mversion (toList errs) warnings Right gpkg -> pure (warnings, gpkg) where - (warnings, eres) = runParseResult $ parseGenericPackageDescription bs + (warnings', eres) = runParseResult $ parseGenericPackageDescription bs + warnings = normaliseWarnings warnings' + normaliseWarnings = +#if MIN_VERSION_Cabal(3,18,0) + map pwarning +#else + id +#endif + normaliseErrors = +#if MIN_VERSION_Cabal(3,18,0) + fmap perror +#else + id +#endif