Skip to content

Commit 433a6c9

Browse files
authored
Fix cabal pkg-config performance issue (input-output-hk#2178)
The dummy version of `pkg-config` we provide to cabal-install-solver so that it can make an appropriate plan includes an extra blank line at the end of it's output. In more recent versions of cabal-install-solver the following change has been made: haskell/cabal@0b34b4e This change now filters the `null` value from the list of package names. Then when the versions are looked up the output is not the expected length (because there is also a blank line at the end of the version list). This change updates the dummy pkg-config script so that it does not include the extra blank lines at the end of the output.
1 parent 215a6b1 commit 433a6c9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

overlays/cabal-pkg-config.nix

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,15 @@ final: prev:
5656
${final.pkgs.lib.concatStrings (map (name: ''
5757
${name}
5858
'') (__attrNames pkgconfigPkgs))
59-
}
60-
EOF2
59+
}EOF2
6160
elif [[ "\$1" == "--modversion" ]]; then
6261
OUTPUT=\$(mktemp)
6362
ERROR=\$(mktemp)
6463
cat <<EOF2
6564
${final.pkgs.lib.concatStrings (map (p: ''
6665
${getVersion (builtins.head p)}
6766
'') (__attrValues pkgconfigPkgs))
68-
}
69-
EOF2
67+
}EOF2
7068
else
7169
$out/bin/${targetPrefix}${baseBinName}-wrapped "\$@"
7270
fi

0 commit comments

Comments
 (0)