Subject: Re: Trying to build x86 version on windows using meson

From: Andres Freund <[email-masked]>
Date: Wed, 20 Mar 2024 15:00:08 -0700

Hi,

On 2024-03-20 17:49:14 -0400, Dave Cramer wrote:
> On Wed, 20 Mar 2024 at 17:11, Andres Freund <[email-masked]> wrote:
> > On 2024-03-20 16:14:23 -0400, Dave Cramer wrote:
> > > I am getting the following error
> > >
> > > meson.build:1479:17: ERROR: Can not run test applications in this cross
> > > environment.
> > >
> > > Have configured for amd64_x86
> > >
> > > Running `meson setup --wipe build --prefix=c:\postgres86`
> >
> > This is not enough information to debug anything. At the very least we need
> > the exact steps performed to set up the build and meson-logs/meson-log.txt
> >
> First off this is on an ARM64 machine

Uh, that's a fairly crucial bit - you're actually trying to cross compile
then.  I don't know much about cross compiling on windows, so it's certainly
possible there's still some gaps there.

> 
> The last error from meson-log.txt is
> 
> ...
> Checking if "c99" compiles: YES
> 
> meson.build:1479:17: ERROR: Can not run test applications in this cross
> environment.
> ...

That's not the meson-log.txt that you attached though?

Greetings,

Andres Freund

---

From: David Rowley <[email-masked]>
Date: Thu, 21 Mar 2024 11:02:27 +1300

> possible there's still some gaps there.

How would initdb.exe / pg_regress.exe even run on the x86 build
machine if it's compiled for ARM?

David

---

From: Andres Freund <[email-masked]>
Date: Wed, 20 Mar 2024 15:20:57 -0700

Hi,

> machine if it's compiled for ARM?

I think this is building on an ARM64 host, targeting 32bit x86.

Obviously tests can't run in that environment, but building should be
possible. I can e.g. build postgres for x86-64 windows on my linux machine,
but can't run the tests (in theory they could be run with wine, but wine isn't
complete enough to run postgres).

Greetings,

Andres Freund

---

From: Thomas Munro <[email-masked]>
Date: Mon, 22 Jul 2024 00:20:58 +1200

> complete enough to run postgres).

For anyone interested in that, the most apparent reason why WINE
currently can't run a cross-build of psql.exe or postgres.exe on a
Linux/FreeBSD/macOS host is now on their bug list[1] and just needs
someone to write an easy patch.  I dimly recall there were more subtle
things that broke here and there before the relevant change of ours
went in, and it would be pretty cool if we could make a list and
report 'em...

[1] https://bugs.winehq.org/show_bug.cgi?id=56951

---

From: Thomas Munro <[email-masked]>
Date: Mon, 10 Feb 2025 16:42:14 +1300

> [1] https://bugs.winehq.org/show_bug.cgi?id=56951

Just for the record, apparently they fixed that one.