Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
f63273da
Commit
f63273da
authored
Aug 18, 2016
by
Edward Z. Yang
Browse files
Introduce InstallPlan.depends = nodeNeighbors and use it.
Signed-off-by:
Edward Z. Yang
<
ezyang@cs.stanford.edu
>
parent
c41ead76
Changes
3
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/InstallPlan.hs
View file @
f63273da
...
...
@@ -28,6 +28,7 @@ module Distribution.Client.InstallPlan (
new
,
toList
,
planIndepGoals
,
depends
,
fromSolverInstallPlan
,
configureInstallPlan
,
...
...
@@ -161,6 +162,9 @@ data GenericPlanPackage ipkg srcpkg
type
IsUnit
a
=
(
IsNode
a
,
Key
a
~
UnitId
)
depends
::
IsUnit
a
=>
a
->
[
UnitId
]
depends
=
nodeNeighbors
-- NB: Expanded constraint synonym here to avoid undecidable
-- instance errors in GHC 7.8 and earlier.
instance
(
IsNode
ipkg
,
IsNode
srcpkg
,
Key
ipkg
~
UnitId
,
Key
srcpkg
~
UnitId
)
...
...
cabal-install/Distribution/Client/ProjectBuilding.hs
View file @
f63273da
...
...
@@ -351,7 +351,7 @@ foldMInstallPlanDepOrder plan0 visit =
depresults
=
map
(
\
ipkgid
->
let
Just
result
=
Map
.
lookup
ipkgid
results
in
result
)
(
nodeNeighbor
s
pkg
)
(
InstallPlan
.
depend
s
pkg
)
result
<-
visit
pkg
depresults
let
results'
=
Map
.
insert
(
nodeKey
pkg
)
result
results
go
results'
pkgs
...
...
cabal-install/Distribution/Client/ProjectPlanning.hs
View file @
f63273da
...
...
@@ -1744,9 +1744,10 @@ pruneInstallPlanPass1 perPkgTargetsMap pkgs =
-- stanzas in the next pass.
--
pruneOptionalDependencies
::
ElaboratedConfiguredPackage
->
[
UnitId
]
pruneOptionalDependencies
elab
@
ElaboratedConfiguredPackage
{
elabPkgOrComp
=
ElabComponent
_
}
=
nodeNeighbors
elab
-- no pruning
pruneOptionalDependencies
ElaboratedConfiguredPackage
{
elabPkgOrComp
=
ElabPackage
pkg
}
=
(
CD
.
flatDeps
.
CD
.
filterDeps
keepNeeded
)
(
pkgOrderDependencies
pkg
)
pruneOptionalDependencies
elab
@
ElaboratedConfiguredPackage
{
elabPkgOrComp
=
ElabComponent
_
}
=
InstallPlan
.
depends
elab
-- no pruning
pruneOptionalDependencies
ElaboratedConfiguredPackage
{
elabPkgOrComp
=
ElabPackage
pkg
}
=
(
CD
.
flatDeps
.
CD
.
filterDeps
keepNeeded
)
(
pkgOrderDependencies
pkg
)
where
keepNeeded
(
CD
.
ComponentTest
_
)
_
=
TestStanzas
`
Set
.
member
`
stanzas
keepNeeded
(
CD
.
ComponentBench
_
)
_
=
BenchStanzas
`
Set
.
member
`
stanzas
...
...
@@ -1865,7 +1866,7 @@ pruneInstallPlanPass2 pkgs =
hasReverseLibDeps
::
Set
UnitId
hasReverseLibDeps
=
Set
.
fromList
[
depid
|
pkg
<-
pkgs
,
depid
<-
nodeNeighbor
s
pkg
]
,
depid
<-
InstallPlan
.
depend
s
pkg
]
mapConfiguredPackage
::
(
srcpkg
->
srcpkg'
)
->
InstallPlan
.
GenericPlanPackage
ipkg
srcpkg
...
...
@@ -2211,7 +2212,7 @@ setupHsConfigureFlags (ReadyPackage elab@ElaboratedConfiguredPackage{..})
-- we only use configDependencies, unless we're talking to an old Cabal
-- in which case we use configConstraints
-- NB: This does NOT use
nodeNeighbor
s, which includes executable
-- NB: This does NOT use
InstallPlan.depend
s, which includes executable
-- dependencies which should NOT be fed in here (also you don't have
-- enough info anyway)
configDependencies
=
[
(
packageName
srcid
,
cid
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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