-
Notifications
You must be signed in to change notification settings - Fork 27
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
Use pkg-config first, then fall back to pg_config #3
Conversation
What's the solution for finding PostgreSQl libs on windows if |
If I understood https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-flag-manual correctly, removing On Windows it is common to install all development-related stuff together, without the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someone have to test this on windows (i.e. that cabal-install
solver in fact backtracks when pkgconfig-depends
aren't satisfiable).
I won't have an access to a machine for some time
Since recent releases of PostgreSQL using pg_config for non-server extensions is discouraged. This is why pg_config gets phased out of client library development packages.
e280830
to
858eb4b
Compare
I've tested if it would fallback on Linux first, and (spoiler) it didn't. I've uninstalled postgresql development headers, and
instead of failing with Looks like the absence of a |
@develop could you run There's a showFR _ (MissingPkgconfigPackage pn vr) = " (conflict: pkg-config package " ++ prettyShow pn ++ prettyShow vr ++ ", not found in the pkg-config database)" in cabal-install code, so i'd expect it could backtrack (and we'll need to figure out why it doesn't) |
E.g. my (development) version of
(and if other branch doesn't have |
oh, ok, it does fall back after all:
So it seems the issue is stack-specific. |
Yes, Ok, good. If toggling works automatically, than these change is very welcome. |
Does it mean we don't need to test it on Windows and the PR is good to merge? |
So the requested changes are in, flag probing is covered by cabal and works inherently and on all platforms; is there anything left to fix or the PR is good to merge? |
Hmm, I'm still undecided. Having flag automatic feels wrong. The setting should be based on "system has I'm thinking of making |
Not sure whether is it any different from the package maintainer standpoint — either way |
If there's |
I can easily imagine the case to not having |
Yes, that's why I'd be happiest to be able to say
yet that's not yet possible. I'll see how difficult it's to add to Cabal. |
so this gets postponed to next Cabal release while modern PostgreSQL users would go on hitting this nightstand with their pinkie toes? |
FWIW, I'm looking back at this and seems that
Is something mostly (only?) OpenSUSE implements. For example https://www.postgresql.org/docs/17/libpq-build.html says:
I fail to find anything else even slightly actively discouraging using |
Agreed, let's stick with the upstream guidelines. Thank you for looking into it. |
Since recent releases of PostgreSQL using pg_config for non-server extensions is discouraged. This is why
pg_config
gets phased out of client library development packages.Therefore it should be quite safe to try pkg-config before pg_config, since the latter may even not be present in the system.
1: https://bugzilla.opensuse.org/show_bug.cgi?id=1140408#c1