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: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-14T00:48:23Z
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
- 0001-meson-Fix-libpq-header-include-order.patch (text/x-patch) patch 0001
I took another look and got it working, after something else I'm using
insisted on installing libpq. It's mostly no-brainer hunks like this:
- dependencies: [frontend_code, libpq],
+ dependencies: [libpq, frontend_code],
For the new src/test/modules/test_oat_hooks/meson.build, I copied what
I'd seen in contrib modules that use libpq:
- kwargs: pg_test_mod_args,
+ kwargs: pg_test_mod_args + {
+ 'dependencies': [libpq] + pg_test_mod_args['dependencies'],
+ }
(I'm still green enough with Meson that I had to look that syntax up:
it's how you replace the values of common keys with the values from
the right hand dict[1], which ain't Pythonesque AFAIK.)
For ecpg and pg_regress, where I got stuck last time, I am still a bit
confused about whether it should go here:
-ecpg_inc = include_directories('.')
+ecpg_inc = [libpq_inc, include_directories('.')]
... or perhaps in intermediate ecpgXXX_inc variables or the final
include_directories directives. In this version I just did that easy
thing and it works for me. But is it the right place?
Likewise for pg_regress_inc, also used by ECPG and isolation tests:
-pg_regress_inc = include_directories('.')
+pg_regress_inc = [libpq_inc, include_directories('.')]
[1] https://mesonbuild.com/Reference-manual_elementary_dict.html