Skip to content

cabal invokes pkg-config on every installed package, so cabal run or cabal install takes 20 minutes on my system #8930

Open
@lschneiderbauer

Description

Describe the bug
Some cabal commands, e.g. cabal v2-run take around 20 minutes on my system (on a vanilla unaltered cabal init project).

I am using gentoo linux w/ cabal-install 3.6.2.0, ghc 9.2.7.

The reason for the huge runtime seems to be that cabal calls something like pkg-config --list-all | cut -f 1 -d ' ' | xargs pkg-config --modversion (see related discussion in pull request #8496). Executing this command explicitly takes around the same time.

The reason for pkg-config to take so long is another matter: In this case there is a library installed with a .pc file that seems to introduce some circular dependencies (see grpc/grpc#29137) which results in much longer waiting times for each library that depends on that "malfunctioning" library, adding up to take around 20 minutes on my system.

It seems to me one should rethink the approach of using pkg-config --list-all to retrieve ALL system library versions beforehand. Just one misconfigured system library will hinder cabal to do its job properly, resulting in this absurd situation that cabal requires a fix in an unrelated project (grpc) to work properly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions