Re: meson's in-tree libpq header search order vs -Dextra_include_dirs

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: meson's in-tree libpq header search order vs -Dextra_include_dirs
Date: 2025-07-14 00:48:23
Message-ID: CA+hUKGJU9kJiSTwxvrDxqrDFw8VvsX9ZbZRL=qP=KXuFX_XH2A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-meson-Fix-libpq-header-include-order.patch text/x-patch 16.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou (Fujitsu) 2025-07-14 01:20:42 RE: Logical replication prefetch
Previous Message Michael Paquier 2025-07-14 00:10:41 Re: [PATCH] PGSERVICEFILE as part of a normal connection string