Re: meson's in-tree libpq header search order vs -Dextra_include_dirs
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-11-01T05:21:35Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
ci: Add missing "set -e" to scripts run by su.
- c3359d1cf5e5 15.15 landed
- 4da1f66fae83 16.11 landed
- 61cd67425f1a 17.7 landed
- ae2381025a4c 18.1 landed
- cf638b46aff2 19 (unreleased) landed
-
Don't put library-supplied -L/-I switches before user-supplied ones.
- 4300d8b6a79d 19 (unreleased) cited
Attachments
- v2-0001-meson-Fix-libpq-header-inclusion-order.patch (text/x-patch) patch v2-0001
On Sat, Nov 1, 2025 at 10:13 AM Thomas Munro <thomas.munro@gmail.com> wrote: > On Sat, Nov 1, 2025 at 7:14 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote: > > However, I'm worried that we'll soon break it again. The new rule is > > apparently "include libpq first", but we have no way of enforcing it. > > Hmm, my meson-fu is weak, but there must surely be some way to declare > that you want libpq and have it automatically put things in the right > order, will look into that... If we really don't want every site that depends on both libpq and frontend_code to have to remember to respect that order when declaring dependencies, then we could instead change frontend_code to force libpq_inc to appear in its include_directories before postgres_inc (= where extra_include_dirs comes from). This one-liner fixes the build on my system: # for frontend binaries frontend_code = declare_dependency( - include_directories: [postgres_inc], + include_directories: [libpq_inc, postgres_inc], That feels a little odd, because libpq is not really a dependency of frontend_code, and not all frontend_code users also use libpq (though almost all do). Does this have any unwanted side-effects? Is there a better way to do this in a central place? There are two other places that already have those two in include_directories already, so their order should surely be flipped to match, they just didn't happen to break on my system (I guess by luck, ie not accessing APIs that changed incompatibly since the version in my system-installed libpq headers).