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

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Mario González Troncoso <gonzalemario(at)gmail(dot)com>
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-10-09 20:26:08
Message-ID: CA+hUKGLEaExdC005PtEPKRMn1f2XDxWmBe=QKwC8c7OqaUjgVQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 10, 2025 at 8:09 AM Mario González Troncoso
<gonzalemario(at)gmail(dot)com> wrote:
> Can you confirm you still have this problem on current master? I tried

Thanks for looking! Yes.

> to reproduce it in debian 12 by installing `postgresql-server-dev-15`
> and adding the -Dextra_include_dirs

The problem is with libpq headers, not server headers.

Thinking about how to show this on Debian... Also it'll fail to fail
if your libpq headers are new enough to be compatible, eg 18. I guess
if you find an older libpq-dev .deb file, v16 is what my system is
clashing with, and unpack it into a temporary directory (something
like ar x XXX.deb then tar xf data.tar.XXX), and then point to the
headers in -Dextra_include_dirs, you should see it?

Or maybe just make a temporary file somewhere called libpq-fe.h that contains:

#error "wrong header included"

... and point to its parent with -Dextra_include_dirs. The goal is
for the in-tree libpq-fe.h to be found sooner in the search path (as
it is with configure), completely hiding that poisoned file.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2025-10-09 20:26:52 Re: VACUUM (PARALLEL) option processing not using DefElem the way it was intended
Previous Message Jacob Champion 2025-10-09 20:21:41 Re: Thoughts on a "global" client configuration?