Skip to content

Commit

Permalink
Bump base in cabal-dev-scripts.cabal (backport #9303) (#9311)
Browse files Browse the repository at this point in the history
* Bump base in cabal-dev-scripts.cabal

Bump base in cabal-dev-scripts.cabal. We are now using GHC 9.4.7 in CI, which ships with base 4.17.2.0. I am bumping all the way to <4.19 after testing everything compiles with GHC 9.6.3 (base-4.18.1.0).

(cherry picked from commit 033e8e0)

* Avoid OverloadedStrings when it causes troubles

(cherry picked from commit dc08acb)

# Conflicts:
#	Cabal-syntax/src/Distribution/Fields/Parser.hs

* doctest: provide a separate project file without -Werror (fix #9307)

This became necessary after an upgrade to GHC 9.4, which, apparently,
has a subtle change in how -W/-w-related things get interpreted.

(cherry picked from commit ccce7c3)

* fixup! resolve a conflict

---------

Co-authored-by: Andrea Bedini <andrea.bedini@tweag.io>
Co-authored-by: Artem Pelenitsyn <a.pelenitsyn@gmail.com>
  • Loading branch information
3 people authored Oct 5, 2023
1 parent e2cc066 commit 0f2350c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Cabal-syntax/src/Distribution/Fields/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ import qualified Data.Text.Encoding as T
import qualified Data.Text.Encoding.Error as T
#endif

-- $setup
-- >>> import Data.Either (isLeft)

-- | The 'LexState'' (with a prime) is an instance of parsec's 'Stream'
-- wrapped around lexer's 'LexState' (without a prime)
data LexState' = LexState' !LexState (LToken, LexState')
Expand Down
5 changes: 1 addition & 4 deletions Cabal-syntax/src/Distribution/InstalledPackageInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ import qualified Text.PrettyPrint as Disp
import Distribution.Types.InstalledPackageInfo
import Distribution.Types.InstalledPackageInfo.FieldGrammar

-- $setup
-- >>> :set -XOverloadedStrings

installedComponentId :: InstalledPackageInfo -> ComponentId
installedComponentId ipi =
case unComponentId (installedComponentId_ ipi) of
Expand Down Expand Up @@ -127,7 +124,7 @@ showFullInstalledPackageInfo = P.showFields (const NoComment) . prettyFieldGramm

-- |
--
-- >>> let ipi = emptyInstalledPackageInfo { maintainer = "Tester" }
-- >>> let ipi = emptyInstalledPackageInfo { maintainer = fromString "Tester" }
-- >>> fmap ($ ipi) $ showInstalledPackageInfoField "maintainer"
-- Just "maintainer: Tester"
showInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String)
Expand Down
8 changes: 4 additions & 4 deletions Cabal-syntax/src/Distribution/Types/Dependency.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ instance NFData Dependency where rnf = genericRnf

-- |
--
-- >>> prettyShow $ Dependency "pkg" anyVersion mainLibSet
-- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion mainLibSet
-- "pkg"
--
-- >>> prettyShow $ Dependency "pkg" anyVersion $ NES.insert (LSubLibName "sublib") mainLibSet
-- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.insert (LSubLibName $ mkUnqualComponentName "sublib") mainLibSet
-- "pkg:{pkg, sublib}"
--
-- >>> prettyShow $ Dependency "pkg" anyVersion $ NES.singleton (LSubLibName "sublib")
-- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.singleton (LSubLibName $ mkUnqualComponentName "sublib")
-- "pkg:sublib"
--
-- >>> prettyShow $ Dependency "pkg" anyVersion $ NES.insert (LSubLibName "sublib-b") $ NES.singleton (LSubLibName "sublib-a")
-- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.insert (LSubLibName $ mkUnqualComponentName "sublib-b") $ NES.singleton (LSubLibName $ mkUnqualComponentName "sublib-a")
-- "pkg:{sublib-a, sublib-b}"
--
instance Pretty Dependency where
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ ghcid-cli :
# https://github.com/haskell/cabal/issues/8734
# Just as well, cabal-install(-solver) doctests (the target below) bitrotted and need some care.
doctest :
cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.validate" Cabal-syntax
cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.validate" Cabal
cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.doctest" Cabal-syntax
cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.doctest" Cabal


# This is not run as part of validate.sh (we need hackage-security, which is tricky to get).
Expand Down
4 changes: 2 additions & 2 deletions cabal-dev-scripts/cabal-dev-scripts.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ executable gen-spdx
ghc-options: -Wall
build-depends:
, aeson ^>=1.4.1.0 || ^>=1.5.2.0 || ^>=2.1.1.0
, base >=4.10 && <4.17
, base >=4.10 && <4.19
, bytestring
, containers
, Diff ^>=0.4
Expand All @@ -35,7 +35,7 @@ executable gen-spdx-exc
ghc-options: -Wall
build-depends:
, aeson ^>=1.4.1.0 || ^>=1.5.2.0 || ^>=2.1.1.0
, base >=4.10 && <4.17
, base >=4.10 && <4.19
, bytestring
, containers
, Diff ^>=0.4
Expand Down
24 changes: 24 additions & 0 deletions cabal.project.doctest
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
packages: Cabal-syntax/
packages: Cabal/
packages: cabal-testsuite/
packages: cabal-install/
packages: solver-benchmarks/

packages: cabal-install-solver/
packages: Cabal-QuickCheck/
packages: Cabal-tree-diff
packages: Cabal-described
packages: Cabal-tests
packages: cabal-benchmarks

tests: True

-- avoiding extra dependencies
constraints: rere -rere-cfg
constraints: these -assoc

write-ghc-environment-files: never

program-options
ghc-options: -fno-ignore-asserts

0 comments on commit 0f2350c

Please sign in to comment.