Skip to content

Commit b7ff4a7

Browse files
committed
priv deps: Fix long bad closure message
We would previously include terminal nodes if these were not private.
1 parent 894c6c3 commit b7ff4a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cabal-install-solver/src/Distribution/Solver/Modular/PrivateScopeClosure.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ findBadPrivClosures pkg rdm = do
191191
| stopAtPkg && x == pkg
192192
= (M.insert x (dontLook x) s, path)
193193
| otherwise
194-
= foldl go (M.insert x (dontLook x) s, x:path) $ neighbors x
194+
= let nbs = neighbors x
195+
in foldl go (M.insert x (dontLook x) s, if null nbs then path else x:path) nbs
196+
-- \^ We don't add x to the path if this is a terminal node.
195197

196198
dontLook x = error $ "We should only lookup privately-qualified pkgs, but instead " ++ show x ++ " was looked up -- it is only inserted in the map for de-duplication purposes."
197199

0 commit comments

Comments
 (0)