Skip to content

Commit

Permalink
cabal-install-solver: fix pkgconf 1.9 --modversion regression
Browse files Browse the repository at this point in the history
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

(this should cover the case too of checking that equal pkgList lines are output also)
  • Loading branch information
juhp committed Nov 6, 2023
1 parent 15b5b05 commit 586f5cf
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ readPkgConfigDb verbosity progdb = handle ioErrorHandler $ do
-- The output of @pkg-config --list-all@ also includes a description
-- for each package, which we do not need.
let pkgNames = map (takeWhile (not . isSpace)) pkgList
(pkgVersions, _errs, exitCode) <-
(outs, _errs, exitCode) <-
getProgramInvocationOutputAndErrors verbosity
(programInvocation pkgConfig ("--modversion" : pkgNames))
if exitCode == ExitSuccess && length pkgNames == length pkgList
then (return . pkgConfigDbFromList . zip pkgNames) (lines pkgVersions)
let pkgVersions = lines outs
if exitCode == ExitSuccess && length pkgVersions == length pkgNames
then (return . pkgConfigDbFromList . zip pkgNames) pkgVersions
else
-- if there's a single broken pc file the above fails, so we fall back
-- into calling it individually
Expand Down

0 comments on commit 586f5cf

Please sign in to comment.