Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
0589a9e4
Commit
0589a9e4
authored
Jun 06, 2017
by
Zhen Zhang
Committed by
Andrey Mokhov
Jun 06, 2017
Browse files
Compute cabalDeps in GhcCabal build (
#320
)
parent
8299d146
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Oracles/Dependencies.hs
View file @
0589a9e4
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module
Oracles.Dependencies
(
fileDependencies
,
contextDependencies
,
needContext
,
dependenciesOracles
fileDependencies
,
contextDependencies
,
needContext
,
dependenciesOracles
,
pkgDependencies
)
where
import
qualified
Data.HashMap.Strict
as
Map
...
...
@@ -47,6 +48,12 @@ contextDependencies context@Context {..} = do
pkgs
<-
sort
<$>
interpretInContext
(
pkgContext
package
)
getPackages
return
.
map
pkgContext
$
intersectOrd
(
compare
.
pkgNameString
)
pkgs
deps
-- | Given a `Package`, this `Action` looks up its package dependencies
-- 'Settings.Paths.packageDependencies' using 'packageDependenciesOracle'
-- The context will be the vanilla context with stage equal to 1
pkgDependencies
::
Package
->
Action
[
Package
]
pkgDependencies
=
fmap
(
map
Context
.
package
)
.
contextDependencies
.
vanillaContext
Stage1
-- | Coarse-grain 'need': make sure given contexts are fully built.
needContext
::
[
Context
]
->
Action
()
needContext
cs
=
do
...
...
src/Settings/Packages/GhcCabal.hs
View file @
0589a9e4
...
...
@@ -5,6 +5,7 @@ import Distribution.PackageDescription.Parse
import
Base
import
GHC
import
Oracles.Config.Setting
import
Oracles.Dependencies
(
pkgDependencies
)
import
Predicate
import
Package
(
pkgCabalFile
)
import
Distribution.Verbosity
(
silent
)
...
...
@@ -15,12 +16,8 @@ import qualified Distribution.PackageDescription as DP
ghcCabalPackageArgs
::
Args
ghcCabalPackageArgs
=
stage0
?
package
ghcCabal
?
builder
Ghc
?
do
-- Note: We could compute 'cabalDeps' instead of hard-coding it but this
-- seems unnecessary since we plan to drop @ghc-cabal@ altogether, #18.
win
<-
lift
windowsHost
let
cabalDeps
=
[
array
,
base
,
bytestring
,
containers
,
deepseq
,
directory
,
pretty
,
process
,
time
,
if
win
then
win32
else
unix
]
cabalDeps
<-
lift
$
pkgDependencies
cabal
lift
$
need
[
pkgCabalFile
cabal
]
pd
<-
liftIO
.
readGenericPackageDescription
silent
$
pkgCabalFile
cabal
let
identifier
=
DP
.
package
.
packageDescription
$
pd
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment