Skip to content

Commit

Permalink
Fix cabal pkg-config performance issue (input-output-hk#2178)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hamishmack authored and pranaysashank committed Jan 18, 2025
1 parent 3b6ae81 commit 4f6e361
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions overlays/cabal-pkg-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,15 @@ final: prev:
${final.pkgs.lib.concatStrings (map (name: ''
${name}
'') (__attrNames pkgconfigPkgs))
}
EOF2
}EOF2
elif [[ "\$1" == "--modversion" ]]; then
OUTPUT=\$(mktemp)
ERROR=\$(mktemp)
cat <<EOF2
${final.pkgs.lib.concatStrings (map (p: ''
${getVersion (builtins.head p)}
'') (__attrValues pkgconfigPkgs))
}
EOF2
}EOF2
else
$out/bin/${targetPrefix}${baseBinName}-wrapped "\$@"
fi
Expand Down

0 comments on commit 4f6e361

Please sign in to comment.