From 6a1eabe1accb983db6e59a9c89d38c38b968c213 Mon Sep 17 00:00:00 2001 From: jgotoh <18658140+jgotoh@users.noreply.github.com> Date: Fri, 13 Sep 2024 16:53:48 +0200 Subject: [PATCH] Update PackageDBNT to use PackageDBCWD --- .../src/Distribution/Client/ProjectConfig/Lens.hs | 4 ++-- cabal-install/src/Distribution/Client/Utils/Newtypes.hs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cabal-install/src/Distribution/Client/ProjectConfig/Lens.hs b/cabal-install/src/Distribution/Client/ProjectConfig/Lens.hs index cb6c2c60fa9..03e05835cd6 100644 --- a/cabal-install/src/Distribution/Client/ProjectConfig/Lens.hs +++ b/cabal-install/src/Distribution/Client/ProjectConfig/Lens.hs @@ -26,7 +26,7 @@ import Distribution.PackageDescription import Distribution.Simple.Compiler ( DebugInfoLevel (..) , OptimisationLevel (..) - , PackageDB + , PackageDBCWD , ProfDetailLevel ) import Distribution.Simple.InstallDirs @@ -212,7 +212,7 @@ projectConfigInstallDirs :: Lens' ProjectConfigShared (InstallDirs (Flag PathTem projectConfigInstallDirs f s = fmap (\x -> s{T.projectConfigInstallDirs = x}) (f (T.projectConfigInstallDirs s)) {-# INLINEABLE projectConfigInstallDirs #-} -projectConfigPackageDBs :: Lens' ProjectConfigShared [Maybe PackageDB] +projectConfigPackageDBs :: Lens' ProjectConfigShared [Maybe PackageDBCWD] projectConfigPackageDBs f s = fmap (\x -> s{T.projectConfigPackageDBs = x}) (f (T.projectConfigPackageDBs s)) {-# INLINEABLE projectConfigPackageDBs #-} diff --git a/cabal-install/src/Distribution/Client/Utils/Newtypes.hs b/cabal-install/src/Distribution/Client/Utils/Newtypes.hs index 976c08c1d1b..aa60eea697c 100644 --- a/cabal-install/src/Distribution/Client/Utils/Newtypes.hs +++ b/cabal-install/src/Distribution/Client/Utils/Newtypes.hs @@ -21,19 +21,19 @@ import Distribution.Client.Types.AllowNewer (AllowNewer (..), AllowOlder (..)) import Distribution.Compat.CharParsing import Distribution.Compat.Newtype import Distribution.Parsec -import Distribution.Simple.Compiler (PackageDB (..), readPackageDb) +import Distribution.Simple.Compiler (PackageDBCWD, interpretPackageDB, readPackageDb) import Distribution.Solver.Types.ConstraintSource (ConstraintSource (..)) import Network.URI (URI, parseURI) -newtype PackageDBNT = PackageDBNT {getPackageDBNT :: Maybe PackageDB} +newtype PackageDBNT = PackageDBNT {getPackageDBNT :: Maybe PackageDBCWD} -instance Newtype (Maybe PackageDB) PackageDBNT +instance Newtype (Maybe PackageDBCWD) PackageDBNT instance Parsec PackageDBNT where parsec = parsecPackageDB parsecPackageDB :: CabalParsing m => m PackageDBNT -parsecPackageDB = PackageDBNT . readPackageDb <$> parsecToken +parsecPackageDB = PackageDBNT . fmap (interpretPackageDB Nothing) . readPackageDb <$> parsecToken newtype NumJobs = NumJobs {getNumJobs :: Maybe Int}