Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tQOcq-002HIR-Mw for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Dec 2024 10:28:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tQOcp-00Coth-30 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Dec 2024 10:28:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tQOco-00CotX-Jw for pgsql-hackers@lists.postgresql.org; Wed, 25 Dec 2024 10:28:22 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tQOcl-001XGA-99 for pgsql-hackers@lists.postgresql.org; Wed, 25 Dec 2024 10:28:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1735122498; bh=RlH1qHzM+NiexX74mcmKmrsUQmyGRHPDBiuAFMZ6370=; h=Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID:From; b=7Jhhiggu56ShPttzVfmDA/KOYgIqexKOXKad3n0yfmpN0kiTwiF7HmLnSHQ3Pubp+ zg4nuqE551XzqZQXuqXn8SJYSVkzyaLryiXl8sEnhlGHsOwiAvqAeywlPKO+bv3CCO 6HnavPrkjV12Zmz8GEj2ASIgB2P3Px3X5gwfzHfXVqyQCQQkehk7XGsJd7bWdkyjuv NUxutdtLwHJAq+csEnWNHKROb2TswwrigmYKP95INK2siktXWsoyxCwQr7ORescDIk YKfijNkEweE1dxVUCAmDyXh7rdxnbBgTWbsEycHoF5Tdd6RBR62T7yUW0xmi9Cky9C TlaecOzzyh1bg== Received: from mail.postgrespro.ru (webmail-slave-mstn.l.postgrespro.ru [192.168.2.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: v.popolitov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 801A260990; Wed, 25 Dec 2024 13:28:18 +0300 (MSK) MIME-Version: 1.0 Date: Wed, 25 Dec 2024 13:28:18 +0300 From: Vladlen Popolitov To: "Kohei Harikae (Fujitsu)" Cc: 'Andres Freund' , "'pgsql-hackers@lists.postgresql.org'" Subject: Re: Windows meson build In-Reply-To: References: Message-ID: <3fadfb663c69bae7448797acfa47c2ba@postgrespro.ru> X-Sender: v.popolitov@postgrespro.ru Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-KSMG-AntiPhishing: NotDetected, bases: 2024/12/25 08:56:00 X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2024/12/25 07:56:00 #26914998 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Kohei Harikae (Fujitsu) писал(а) 2024-12-18 05:05: Hi! > Hi, > > I apologize for this late reply. > > As you advised, I was able to create the ".pc" file manually and set > the dependencies using pkgconf. > Thank you. > > However, I have read the PostgreSQL Documentation and did not realize > that pkgconf is required. > > 17.4.3.2. PostgreSQL Features > -Dgssapi > On many systems, the GSSAPI system (a part of the MIT Kerberos > installation) is not installed in a location that is searched by > default (e.g., /usr/include, /usr/lib). > In those cases, PostgreSQL will query pkg-config to detect the > required compiler and linker options. > -Dlibxml > To use a libxml2 installation that is in an unusual location, you can > set pkg-config-related environment variables (see its documentation). > > Only a few options have a pkg-config description. > It would be easier to understand pkg-config in the "17.4.3. meson setup > Options" section. > Below is my proposal for the document description. > How do you think about this? > > 17.4.3. meson setup Options > PostgreSQL will query pkg-config to detect the required compiler and > linker options. > To use module installed in an unusual location for each feature (e.g. > -Dgssapi, -Dlibxml), set pkg-config-related environment variables (see > its documentation). Meson has more straighforward solution. It uses environment variable PKG_CONFIG_PATH, that can store the list of directories with all .pc files. Meson uses this list and in this specific order to build project. As wrote in meson documentation (in the source of open source project): # Instead of relying on pkg-config or pkgconf to provide -L flags in a # specific order, we reorder library paths ourselves, according to th # order specified in PKG_CONFIG_PATH. See: # https://github.com/mesonbuild/meson/issues/4271 # It would be more clear information in PostgreSQL documentation, that all directories with pc files are listed in one variable. By the way, if you need to add , f.e. libxml library to postgreSQL build, you can 1) build and install it using , f.e. vcpkg: vcpkg install libxml2:windows-x64 --x-install-root=c:\pbuild\libxml2 2) add path to pc directory to PKG_CONFIG_PATH SET PKG_CONFIG_PATH=c:\pbuild\libxml2\winsows-x64\lib\pkgconfig;%PKG_CONFIG_PATH% 3) make steps with build meson setup c:\builddir\... --prefix=c:\postgresdir\... It is just one install and one manipulation with environment variable. No indeterminate behaviour with other variables used by specific packages and a libraries order. > > Regards, > Kohei Harikae > > -----Original Message----- > From: Andres Freund > Sent: Thursday, November 7, 2024 4:05 AM > To: Harikae, Kohei/張替 浩平 > Cc: 'pgsql-hackers@lists.postgresql.org' > > Subject: Re: Windows meson build > > Hi, > > On 2024-11-05 06:32:51 +0000, Kohei Harikae (Fujitsu) wrote: >> I do not use pkgconf in my Windows environment. >> In my Windows environment, I could not build the following OSS with >> meson. >> - 0001 icu >> - 0002 libxml >> - 0003 libxslt >> - 0004 lz4 >> - 0005 tcl >> - 0006 zlib >> - 0007 zstd >> >> [1]thread, I created a patch like the one in the attached file, and >> now I can build. >> Would you like to be able to build OSS with Windows meson without >> using pkgconf? > > You can use pkgconf or cmake for the dependencies. I don't want to add > "raw" > dependency handling for every dependency, they each build in too many > variants for that to be a sensible investment of time. > > > Greetings, > > Andres Freund -- Best regards, Vladlen Popolitov.