Hi,
On 2024-12-17 14:25:01 -0500, Andres Freund wrote:
> On 2024-12-17 13:09:49 -0500, Tom Lane wrote:
> > I wrote:
> > > Andres Freund <andres@anarazel.de> writes:
> > >> Was about to apply that, but then started to wonder if we don't need the same
> > >> for configure? And it sure looks like that has the same problem?
> > >> Which also confuses me some, at some point this presumably worked?
> >
> > > The configure path does work on NetBSD 10, and has for some time.
> >
> > Ah, sorry, I'd forgotten that bsd_auth.h only exists on OpenBSD.
> > We correctly detect that the header is not there on NetBSD.
> >
> > I tried it on OpenBSD 7.0, which is the only OpenBSD image I have
> > laying about at the moment, and configure correctly finds that the
> > "AC_CHECK_HEADER(bsd_auth.h, [], ...)" test succeeds. So it looks
> > to me like we should not need the sys/types.h include --- unless
> > they broke it in some more-recent release?
>
> It does look like it was recently broken:
> https://www.postgresql.org/message-id/CAN55FZ0czTmfnfF%3DWOHJUZ0iZRiMz6Yf3FSMbPh4%3DZ5a_TDjKw%40mail.gmail.com
> /usr/include/bsd_auth.h:93:1: error: unknown type name 'quad_t'
>
>
> I'm pretty sure that it *did* work not too long ago with meson, because I had
> tested the meson stuff on openbsd when I wrote it.
>
>
> And as Peter noted:
>
> > The synopsis in https://man.openbsd.org/authenticate.3 is:
> >
> > #include <sys/types.h>
> > #include <login_cap.h>
> > #include <bsd_auth.h>
>
> Which does look a bit like they expect sys/types.h to be included first.
Gah, configure does pass - because AC_CHECK_HEADER(), if includes is not passed
in, first includes what's defined in AC_INCLUDES_DEFAULT.
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Default-Includes.html#Default-Includes
Expand to include-directives if defined, otherwise to:
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
...
So maybe my memory is just faulty and the bsd_auth.h path never worked with
openbsd + meson. Anyway, it looks like Bilal's patch to just add this to meson
seems to suffice.
Greetings,
Andres Freund