Skip to content

Commit bf8e6ff

Browse files
committed
cabal-install-solver: fix pkgconf 1.9 --modversion regression
Check that the numbers of *versions* output is equal to the number of pkgconf's fixes #8923 The pkgconf behavior was reverted upstream in 2.0 (checking that equal pkgnames are output also doesn't hurt, this should cover that case too anyway)
1 parent 1157461 commit bf8e6ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cabal-install-solver/src/Distribution/Solver/Types/PkgConfigDb.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ readPkgConfigDb verbosity progdb = handle ioErrorHandler $ do
6767
-- The output of @pkg-config --list-all@ also includes a description
6868
-- for each package, which we do not need.
6969
let pkgNames = map (takeWhile (not . isSpace)) pkgList
70-
(pkgVersions, _errs, exitCode) <-
70+
(pkgVersions_, _errs, exitCode) <-
7171
getProgramInvocationOutputAndErrors verbosity
7272
(programInvocation pkgConfig ("--modversion" : pkgNames))
73-
if exitCode == ExitSuccess && length pkgNames == length pkgList
74-
then (return . pkgConfigDbFromList . zip pkgNames) (lines pkgVersions)
73+
let pkgVersions = lines pkgVersions_
74+
if exitCode == ExitSuccess && length pkgVersions == length pkgList
75+
then (return . pkgConfigDbFromList . zip pkgNames) pkgVersions
7576
else
7677
-- if there's a single broken pc file the above fails, so we fall back
7778
-- into calling it individually

0 commit comments

Comments
 (0)