Commit 58021348 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Adjust the default set of Setup.hs deps for legacy scripts

Add transformers and old-time, and for ghc-compatible compilers also add
ghc-prim and template-haskell.

Have to double check if the old-time dep needs to be conditional, e.g.
on ghc version.
parent bdfa62a4
......@@ -871,7 +871,7 @@ planPackages comp platform solver SolverSettings{..}
. removeUpperBounds solverSettingAllowNewer
. addDefaultSetupDependencies (defaultSetupDeps platform
. addDefaultSetupDependencies (defaultSetupDeps comp platform
. PD.packageDescription
. packageDescription)
......@@ -1727,8 +1727,10 @@ packageSetupScriptStylePreSolver pkg
-- we still need to distinguish the case of explicit and implict setup deps.
-- See 'rememberImplicitSetupDeps'.
--
defaultSetupDeps :: Platform -> PD.PackageDescription -> Maybe [Dependency]
defaultSetupDeps platform pkg =
defaultSetupDeps :: Compiler -> Platform
-> PD.PackageDescription
-> Maybe [Dependency]
defaultSetupDeps compiler platform pkg =
case packageSetupScriptStylePreSolver pkg of
-- For packages with build type custom that do not specify explicit
......@@ -1737,7 +1739,7 @@ defaultSetupDeps platform pkg =
SetupCustomImplicitDeps ->
Just $
[ Dependency depPkgname anyVersion
| depPkgname <- legacyCustomSetupPkgs platform ] ++
| depPkgname <- legacyCustomSetupPkgs compiler platform ] ++
-- The Cabal dep is slightly special:
-- * we omit the dep for the Cabal lib itself (since it bootstraps),
-- * we constrain it to be less than 1.23 since all packages
......@@ -1868,14 +1870,18 @@ cabalPkgname = PackageName "Cabal"
basePkgname = PackageName "base"
legacyCustomSetupPkgs :: Platform -> [PackageName]
legacyCustomSetupPkgs (Platform _ os) =
legacyCustomSetupPkgs :: Compiler -> Platform -> [PackageName]
legacyCustomSetupPkgs compiler (Platform _ os) =
map PackageName $
[ "array", "base", "binary", "bytestring", "containers"
, "deepseq", "directory", "filepath", "pretty"
, "process", "time" ]
, "deepseq", "directory", "filepath", "old-time", "pretty"
, "process", "time", "transformers" ]
++ [ "Win32" | os == Windows ]
++ [ "unix" | os /= Windows ]
++ [ "ghc-prim" | isGHC ]
++ [ "template-haskell" | isGHC ]
where
isGHC = compilerCompatFlavor GHC compiler
-- The other aspects of our Setup.hs policy lives here where we decide on
-- the 'SetupScriptOptions'.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment