Re: Meson far from ready on Windows - Mailing list pgsql-hackers

From Dave Page
Subject Re: Meson far from ready on Windows
Date
Msg-id CA+OCxozShTj4eBn5wtjQ16bL3qMq1ETO_CBCMHFfXcvQyZSZaw@mail.gmail.com
Whole thread Raw
In response to Re: Meson far from ready on Windows  (Andres Freund <andres@anarazel.de>)
Responses Re: Meson far from ready on Windows
List pgsql-hackers
Hi

On Tue, 25 Jun 2024 at 12:39, Andres Freund <andres@anarazel.de> wrote:
Hi,

On 2024-06-25 11:54:56 +0100, Dave Page wrote:
> https://github.com/dpage/winpgbuild proves that the hacks above are not
> required *if* you build the dependencies in the recommended way for use
> with MSVC++ (where documented), otherwise just native Windows.

Partially it just means that some of the hacks are now located in the "build
dependencies" script.  E.g. you're renaming libintl.dll.a, libiconv.dll.a,
libuuid.a to something that's expected by the buildmethod. And the scripts
change the directory structure for several other dependencies (e.g. zstd, krb).


> If you, for example, build a dependency using Mingw/Msys, then you may get
> different filenames than if you build the same thing using its VC++
> solution or makefile. That's where most, if not all, of these issues come
> from.

Yes, that's precisely my point. The set of correct names / flags depends on
things outside of postgres control. Hence they should be handled outside of
postgres, not as part of postgres. Particularly because several of the
dependencies can be built in multiple ways, resulting in multiple library
names. And it doesn't even just differ by compiler, there's ways to get
different library names for some of the deps even with the same compiler!

Replying to this and your previous email. 

I think we're in violent agreement here as to how things *should* be in an ideal world. The issue for me is that this isn't an ideal world and the current solution potentially makes it much harder to get a working PostgreSQL build on Windows - not only that, but everyone doing those builds potentially has to figure out how to get things to work for themselves because we're pushing the knowledge outside of our build system.

I've been building Postgres on Windows for years (and like to think I'm reasonably competent), and despite reading the docs I still ended up starting multiple threads on the hackers list to try to understand how to get v17 to build. Would we accept the current Meson setup on Linux if people had to hand-craft .pc files, or install dependencies using multiple third-party package managers to get it to work?

As I previously noted, I think we should default to pkgconfig/cmake detection, but then fall back to what we did previously (with suitably obnoxious warnings). Then at least a build environment that worked in the past should work in the future.

--

pgsql-hackers by date:

Previous
From: Shlok Kyal
Date:
Subject: Re: Logical Replication of sequences
Next
From: Peter Eisentraut
Date:
Subject: Re: improve ssl error code, 2147483650