Re: zlib detection in Meson on Windows broken?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Dave Page <dpage(at)pgadmin(dot)org>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: zlib detection in Meson on Windows broken?
Date: 2024-05-20 15:52:24
Message-ID: 2097f4ae-5b61-4906-8b2c-a0e088be1d12@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2024-05-20 Mo 06:58, Dave Page wrote:
> Hi
>
> I'm working on updating the build of PostgreSQL that pgAdmin uses in
> its Windows installers to use Meson ready for the v17 release. I'm
> using Visual Studio 2022, on Windows Server 2022.
>
> I've been unable to persuade Meson to detect zlib, whilst OpenSSL
> seems to be fine.
>
> The dependencies have been built and installed as follows:
>
>  mkdir c:\build64
>
>  wget https://zlib.net/zlib-1.3.2.tar.gz
>  tar -zxvf zlib-1.3.2.tar.gz
>  cd zlib-1.3.2
>  cmake -DCMAKE_INSTALL_PREFIX=C:/build64/zlib -G "Visual Studio 17 2022" .
>  msbuild ALL_BUILD.vcxproj /p:Configuration=Release
>  msbuild RUN_TESTS.vcxproj /p:Configuration=Release
>  msbuild INSTALL.vcxproj /p:Configuration=Release
>  cd ..
>
>  wget https://www.openssl.org/source/openssl-3.0.13.tar.gz
>  tar -zxvf openssl-3.0.13.tar.gz
>  cd openssl-3.0.013
>  perl Configure VC-WIN64A no-asm --prefix=C:\build64\openssl no-ssl3
> no-comp
>  nmake
>  nmake test
>  nmake install
>  cd ..
>
> This results in the following headers and libraries being installed
> for zlib:
>
> C:\Users\dpage\git\postgresql>dir C:\build64\zlib\include
>  Volume in drive C has no label.
>  Volume Serial Number is 3AAD-5864
>
>  Directory of C:\build64\zlib\include
>
> 17/05/2024  15:56    <DIR>          .
> 17/05/2024  15:56    <DIR>          ..
> 17/05/2024  15:54            17,096 zconf.h
> 22/01/2024  19:32            96,829 zlib.h
>                2 File(s)        113,925 bytes
>                2 Dir(s)  98,842,726,400 bytes free
>
> C:\Users\dpage\git\postgresql>dir C:\build64\zlib\lib
>  Volume in drive C has no label.
>  Volume Serial Number is 3AAD-5864
>
>  Directory of C:\build64\zlib\lib
>
> 17/05/2024  17:01    <DIR>          .
> 17/05/2024  15:56    <DIR>          ..
> 17/05/2024  15:55            16,638 zlib.lib
> 17/05/2024  15:55           184,458 zlibstatic.lib
>                2 File(s)        201,096 bytes
>                2 Dir(s)  98,842,726,400 bytes free
>
> I then attempt to build PostgreSQL:
>
>  meson setup build
> -Dextra_include_dirs=C:/build64/openssl/include,C:/build64/zlib/include
> -Dextra_lib_dirs=C:/build64/openssl/lib,C:/build64/zlib/lib
> -Dssl=openssl -Dzlib=enabled --prefix=c:/build64/pgsql
>
> Which results in the output in output.txt, indicating that OpenSSL was
> correctly found, but zlib was not. I've also attached the meson log.
>
> I have very little experience with Meson, and even less interpreting
> it's logs, but it seems to me that it's not including the extra lib
> and include directories when it runs the test compile, given the
> command line it's reporting:
>
> cl
> C:\Users\dpage\git\postgresql\build\meson-private\tmpg_h4xcue\testfile.c
> /nologo /showIncludes /utf-8 /EP /nologo /showIncludes /utf-8 /EP /Od /Oi-
>
> Bug, or am I doing something silly?
>
>
>

Hi Dave!

Not sure ;-) But this works for the buildfarm animal drongo, so we
should be able to make it work for you. I'll contact you offlist and see
if I can help.

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2024-05-20 15:55:41 Re: commitfest.postgresql.org is no longer fit for purpose
Previous Message Robert Haas 2024-05-20 15:52:21 Re: Speed up clean meson builds by ~25%