Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
25123866
Commit
25123866
authored
Dec 12, 2016
by
Edward Z. Yang
Committed by
Edward Z. Yang
Dec 13, 2016
Browse files
Don't report dependency inconsistencies for multiply instantiated packages.
Signed-off-by:
Edward Z. Yang
<
ezyang@cs.stanford.edu
>
parent
14b50f3c
Changes
1
Show whitespace changes
Inline
Side-by-side
Cabal/Distribution/Simple/PackageIndex.hs
View file @
25123866
...
...
@@ -639,24 +639,30 @@ dependencyGraph index = (graph, vertex_to_pkg, id_to_vertex)
-- depend on it and the versions they require. These are guaranteed to be
-- distinct.
--
dependencyInconsistencies
::
Package
Installed
a
=>
PackageIndex
a
dependencyInconsistencies
::
InstalledPackageIndex
->
[(
PackageName
,
[(
PackageId
,
Version
)])]
dependencyInconsistencies
index
=
[
(
name
,
[
(
pid
,
packageVersion
dep
)
|
(
dep
,
pids
)
<-
uses
,
pid
<-
pids
])
|
(
name
,
ip
id_map
)
<-
Map
.
toList
inverseIndex
,
let
uses
=
Map
.
elems
ip
id_map
|
(
name
,
c
id_map
)
<-
Map
.
toList
inverseIndex
,
let
uses
=
Map
.
elems
c
id_map
,
reallyIsInconsistent
(
map
fst
uses
)
]
where
-- for each PackageName,
-- for each package with that name,
-- the InstalledPackageInfo and the package Ids of packages
-- that depend on it.
--
-- NB: we use ComponentId here, not UnitId, because there might
-- be multiple occurrences of a package name with different
-- instantiations. However, the component IDs will always be
-- consistent!
inverseIndex
=
Map
.
fromListWith
(
Map
.
unionWith
(
\
(
a
,
b
)
(
_
,
b'
)
->
(
a
,
b
++
b'
)))
[
(
packageName
dep
,
Map
.
fromList
[(
ip
id
,(
dep
,[
packageId
pkg
]))])
Map
.
fromList
[(
c
id
,(
dep
,[
packageId
pkg
]))])
|
pkg
<-
allPackages
index
,
ipid
<-
installedDepends
pkg
,
Just
dep
<-
[
lookupUnitId
index
ipid
]
,
let
cid
=
IPI
.
installedComponentId
dep
]
-- Added in 991e52a474e2b8280432257c1771dc474a320a30,
...
...
Write
Preview
Supports
Markdown
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