Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling pkg-config version checks #9458

Open
Merivuokko opened this issue Nov 17, 2023 · 3 comments
Open

Allow disabling pkg-config version checks #9458

Merivuokko opened this issue Nov 17, 2023 · 3 comments
Assignees

Comments

@Merivuokko
Copy link

Issue #8930 describes in detail problems associated with cabal's current behaviour of querying pkg-config for versions of every installed package.
In short, this is a significant performance issue on systems which install a lot of .pc files.
These systems include Arch Linux and all source-based Unix/Linux distributions.

Various resolution strategies have been discussed in issue #8930.
One of the suggestions is that cabal could cache the information returned by pkg-config.
This solution has a problem though: because Arch and source-based distributions are rolling-release, packages are generally updated often.
Upgrading any library or application package is likely to cause changes to pkg-config database, and thus will invalidate any caches.
Depending on the user's habits, system upgrades can happen daily or even more often.
This will effectively defeat the purpose of caching.

Regardless of which strategy is chosen by cabal to optimize its package information lookup, it would be a good idea to allow the user to disable pkg-config version checks.
This feature would be a workaround while a long-term solution is being discussed and implemented.
After the long-term solution has been found, this feature can be used in exceptional situations like when a system has been misconfigured or simply if the user wants to avoid version checks.

I am asking for an option which can be specified both on command line and in a configuration file.
It would prevent cabal from querying pkg-config for any package's existence.
The user could specify whether they want cabal to assume that every possible package is present, or that every possible package is absent.
If the user chooses to "lie" that all possible packages are installed, this might lead to build failures.

This option would not prevent cabal from calling pkg-config in order to get link flags for libraries, or other such information.
The point of this option is just to prevent cabal from doing mass queries to pkg-config, which is inefficient.

@georgefst
Copy link

Upgrading any library or application package is likely to cause changes to pkg-config database, and thus will invalidate any caches.

Yeah, this is a shortcoming of #9422, and is the reason why in #9360 I chose to cache per-package rather than invalidating everything for a single change.

@gbaz
Copy link
Collaborator

gbaz commented Nov 17, 2023

I think a flag for disabling the pkg-config database construction would be reasonable, simple, and welcome.

@andreabedini andreabedini self-assigned this Dec 19, 2023
@andreabedini
Copy link
Collaborator

I plan to do this as part of #9422.

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

No branches or pull requests

4 participants