Re: [RFC] building postgres with meson - v13

From: Andres Freund <andres(at)anarazel(dot)de>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, "wangw(dot)fnst(at)fujitsu(dot)com" <wangw(dot)fnst(at)fujitsu(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, samay sharma <smilingsamay(at)gmail(dot)com>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [RFC] building postgres with meson - v13
Date: 2022-09-27 04:48:21
Message-ID: 20220927044821.wf3zhu6fuoxfpjxw@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-09-27 17:29:27 +1300, Thomas Munro wrote:
> On Tue, Sep 27, 2022 at 2:19 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > Subject: [PATCH v17 15/23] windows: Set UMDF_USING_NTSTATUS globally, include ntstatus.h
>
> No Windows expertise here, but this looks reasonable. I originally
> tried to contain UMDF_USING_NTSTATUS to small translation units for
> fear of unintended consequences, but PCH requires you not to mess with
> macros that affect the compilation of a header as seen by different
> translation units, which is an incompatible goal. If this is passing
> on MSVC and MingGW then +1 from me.

Yes, passes both.

> You mentioned WIN32_NO_STATUS in the commit message -- a mistake?

Argh. An earlier iteration. Works on mingw, but making it work with msvc
required a lot more modifications IIRC.

> Digging out my old emails/notes... that's another way to be allowed to
> include both ntstatus.h and windows.h/etc in the same translation
> unit, but not the one we're using. I assume it's worse because you
> have to define it and then undefine it, which sounds more antithetical
> to the PCH dream. Admittedly UMDF_USING_NTSTATUS -- from the
> "User-Mode Driver Framework" -- is a weird thing to be getting tangled
> up with because we aren't writing a driver here, but it seems to be a
> well known and widely used alternative, and is nicer because you only
> have to define it.

It's definitely weird. But it appears to be widely used...

> > Subject: [PATCH v17 16/23] windows: adjust FD_SETSIZE via commandline define
>
> Right, we have to fix that across translation units for the same
> reason. But why as -D and not in win32_port.h? I followed the
> discussion from 9acda73118 to try to find the answer to that and saw
> that Michael wanted to put it there, but wanted to minimise the blast
> radius at the time:
>
> https://www.postgresql.org/message-id/20190826054000.GE7005%40paquier.xyz

I guess a similar consideration. I was a bit worried about the references to
FD_SETSIZE in src/backend/port/win32/socket.c. Multi kB on-stack arrays in
postmaster seem like they could cause issues.

ISTM we really ought to move away from stuff using FD_SETSIZE on windows...

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2022-09-27 05:42:59 Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?
Previous Message Andres Freund 2022-09-27 04:31:43 Re: Apple's ranlib warns about protocol_openssl.c