| From: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
|---|---|
| To: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
| Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: meson's in-tree libpq header search order vs -Dextra_include_dirs |
| Date: | 2025-11-03 02:09:43 |
| Message-ID: | CA+hUKG+=MPY7MDh3fv8DjbGNBTO9zUO7v_RZDs29M5fLRJD-uw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Sat, Nov 1, 2025 at 7:14 AM Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
> The patch seems harmless enough to me, no objections to committing it.
> 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.
Here's a new version of the original approach with fixes for some
copy-and-pastes I'd missed, and a new patch to check the search order
in CI. It adds a "poisoned" libpq-fe.h header into the search path to
break the build step if you get it wrong in meson or configure (cf
commit 4300d8b6 which fixed a case of this there). It fails like
this:
[01:45:21.825] In file included from ../src/include/fe_utils/connect_utils.h:15,
[01:45:21.825] from ../src/bin/scripts/common.h:13,
[01:45:21.825] from ../src/bin/scripts/vacuumdb.c:17:
[01:45:21.825] /tmp/poisoned_headers/libpq-fe.h:1:2: error: #error
"external header hides in-tree header"
[01:45:21.825] 1 | #error "external header hides in-tree header"
[01:45:21.825] | ^~~~~
There must surely be a more mesonic way to do this with declarations
rather than the order in a flimsy list that is copied all over the
place (I guess that is probably supposed to be thought of as an
unordered set...?), but I'm not sure I was on the right path with my
v2 as mentioned and it didn't survive this test. This approach is OK
for now, I think... if someone ever shows up with a patch to tackle it
more fundamentally, the order will presumably become more flexible, so
the new order will still be valid but unimportant.
Will wait another day for a better idea or objection to show up, and
otherwise commit these to 16+.
| Attachment | Content-Type | Size |
|---|---|---|
| v3-0001-meson-Fix-libpq-header-include-order.patch | text/x-patch | 21.2 KB |
| v3-0002-ci-Test-include-path-order-with-decoy-libpq-fe.h.patch | text/x-patch | 3.9 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | 邱宇航 | 2025-11-03 02:15:09 | Add CHECK_FOR_INTERRUPTS in Evict{Rel,All}UnpinnedBuffers |
| Previous Message | Josef Šimánek | 2025-11-03 01:31:52 | Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement |