Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEvYf-0005lR-RX for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 17:35:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qEvYc-0003m6-Po for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 17:35:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEvYa-0003ki-TD for pgsql-hackers@lists.postgresql.org; Thu, 29 Jun 2023 17:35:50 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qEvYR-001D2o-0C for pgsql-hackers@postgresql.org; Thu, 29 Jun 2023 17:35:47 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id F033C3200960; Thu, 29 Jun 2023 13:35:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 29 Jun 2023 13:35:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1688060134; x=1688146534; bh=NH eDOvx3qVtCKbOjCBwxHCjhZDbZ7/c+Lskyt/4C9ok=; b=LNcjsUwNUrErPZCWMW d8xWoP8dggJ/EImk5WQN4XIM8hc4CmBWYm9rpoM1WWV97QRLfM6HASrWwn8pUoYn bu/+biO4kv28gb2OeMh86WOnoqkR7HvqT4pjARIef30RHyUu7dc1drA/2DtQIW/E B5QBsmYosc/eewBCQpeHemOABe9X0FlaVgY9wH2kTJ4BON0lXsR3Kni0hCphw4Q4 Ca9ajIe5PFyxaZkEqqkGFjo8Aa4fKUXC0cRqOjGSCpxbokU0ST2hK6LKMnCIadeB xYjSEL3fCToRO7l3hVgcQJNT/lhUmsCciT5DZVZCbwEaG/m9kSLqn6fIiPUPbKg6 DyaQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1688060134; x=1688146534; bh=NHeDOvx3qVtCK bOjCBwxHCjhZDbZ7/c+Lskyt/4C9ok=; b=lHCgm3/TlyBzvxura+C/CdN0kRgFh oWLclh1DGiO4DRwAdsi6MDFHHzJsPzBze3ZexvAxQXtojYTY6NNIhYFfvn2OuUw8 YaXGGvXLajpmCMhpJxZgUP/nw54Y2R103KTGkgtBR7ElKnsKbDf+NsJKMBCj5vfJ 8k4Vg5dA4XbbP6SwmuZgNwHGuBJrCGHd5z326E0ufFDqG/xH6JzkuLrvm0+t6OD1 sIDfw3euFRtjK+6VVLJHZ1JYtt3WxE2d/qAn8p/GbmFB8NY4qgo/CVdSm99v6jI/ lYFcROc2bRCxUSYlD+Iy7RkxnWcH1CTDQWgFLSNtp743ZPUvtURIJjttg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrtdeggdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesmhdtreertddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepkeeiueegvedugeeutdeifeffiedvgfeugeekhfeftdevfeekffelgfeg vefhudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 29 Jun 2023 13:35:34 -0400 (EDT) Date: Thu, 29 Jun 2023 10:35:32 -0700 From: Andres Freund To: Peter Eisentraut Cc: Tristan Partin , pgsql-hackers@postgresql.org Subject: Re: Meson build updates Message-ID: <20230629173532.cdcydvqf3x5j7524@awork3.anarazel.de> References: <20230609183603.o56z3ngtak6qhb3s@awork3.anarazel.de> <20230612172038.f2xf2cwlnhjldqng@awork3.anarazel.de> <277c356e-7ef7-4c87-f4b2-97a13914dd02@eisentraut.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="owu2kol6rl73t573" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --owu2kol6rl73t573 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On 2023-06-29 13:18:21 +0200, Peter Eisentraut wrote: > On 13.06.23 22:47, Tristan Partin wrote: > > Forgot that I had gotten a review from a Meson maintainer. The last two > > patches in this set are new. One is just a simple spelling correction. > > I have committed patches 0001-0006, 0008, 0010, 0013, 0014, 0016, which are > all pretty much cosmetic. Thanks Peter, Tristan! I largely couldn't muster an opinion on most of these... > The following patches are now still pending further review: > > v5-0007-Tie-adding-C-support-to-the-llvm-Meson-option.patch Hm. One minor disadvantage of this is that if no c++ compiler was found, you can't really see anything about llvm in the the output, nor in meson-log.txt, making it somewhat hard to figure out why llvm was disabled. I think something like elif llvmopt.auto() message('llvm requires a C++ compiler') endif Should do the trick? > v5-0009-Remove-return-code-check.patch Pushed. > v5-0011-Pass-feature-option-through-to-required-kwarg.patch I'm a bit confused how it ended how it's looking like it is right now, but ... :) I'm thinking of merging 0011 and relevant parts of 0012 and 0015 into one. > v5-0012-Make-finding-pkg-config-python3-more-robust.patch The commit message here is clearly outdated (still talking about Python.h check not being required). Does the remainder actually add any robustness? I'm on board with removing unnecessary .enabled(), but from what I understand we don't gain anything from adding the if python3_inst.found() branch? > v5-0015-Clean-up-some-usage-of-Meson-features.patch For me that's not really an improvement in legibility, the indentation for the bulk of each test helps parse things visually. In some cases the removed "if feature.disabled()" actually leads to tests being executed when a feature is disabled, e.g. perl -MConfig ... would now be run even perl is disabled. Attached my version of 0007 and 0011 (with some changes from 0012 and 0015). I'm running a test of those with the extended CI I have in a branch... Greetings, Andres Freund --owu2kol6rl73t573 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v16a-0001-meson-Pass-more-feature-option-through-to-requi.patch" From 8995f525d8036ad0aad9486a9b26864d87ebbe9f Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Thu, 29 Jun 2023 09:32:40 -0700 Subject: [PATCH v16a 1/2] meson: Pass more feature option through to required kwargs That was already done in a lot of places, but not all. Author: Tristan Partin Discussion: https://postgr.es/m/CSPIJVUDZFKX.3KHMOAVGF94RV@c3po --- meson.build | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index fbec9979475..6661c1fefa2 100644 --- a/meson.build +++ b/meson.build @@ -769,8 +769,8 @@ endif icuopt = get_option('icu') if not icuopt.disabled() - icu = dependency('icu-uc', required: icuopt.enabled()) - icu_i18n = dependency('icu-i18n', required: icuopt.enabled()) + icu = dependency('icu-uc', required: icuopt) + icu_i18n = dependency('icu-i18n', required: icuopt) if icu.found() cdata.set('USE_ICU', 1) @@ -1054,9 +1054,9 @@ endif pyopt = get_option('plpython') if not pyopt.disabled() pm = import('python') - python3_inst = pm.find_installation(required: pyopt.enabled()) - python3_dep = python3_inst.dependency(embed: true, required: pyopt.enabled()) - if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt.enabled()) + python3_inst = pm.find_installation(required: pyopt) + python3_dep = python3_inst.dependency(embed: true, required: pyopt) + if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt) python3_dep = not_found_dep endif else @@ -1079,7 +1079,7 @@ if not get_option('readline').disabled() readline = dependency(readline_dep, required: false) if not readline.found() readline = cc.find_library(readline_dep, - required: get_option('readline').enabled(), + required: get_option('readline'), dirs: test_lib_d) endif if readline.found() @@ -1379,7 +1379,7 @@ if not zlibopt.disabled() warning('did not find zlib') elif not cc.has_header('zlib.h', args: test_c_args, include_directories: postgres_inc, - dependencies: [zlib_t], required: zlibopt.enabled()) + dependencies: [zlib_t], required: zlibopt) warning('zlib header not found') elif not cc.has_type('z_streamp', dependencies: [zlib_t], prefix: '#include ', @@ -2538,7 +2538,7 @@ if not nlsopt.disabled() # otherwise there'd be lots of # "Gettext not found, all translation (po) targets will be ignored." # warnings if not found. - msgfmt = find_program('msgfmt', required: nlsopt.enabled(), native: true) + msgfmt = find_program('msgfmt', required: nlsopt, native: true) # meson 0.59 has this wrapped in dependency('intl') if (msgfmt.found() and -- 2.38.0 --owu2kol6rl73t573 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v16a-0002-meson-Tie-adding-C-support-to-the-llvm-Meson-op.patch" From 2f681029390675ae1902bd209657bd4f063d646a Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Thu, 29 Jun 2023 09:42:09 -0700 Subject: [PATCH v16a 2/2] meson: Tie adding C++ support to the llvm Meson option In the event the llvm option is defined to be 'auto', it is possible that the host machine might not have a C++ compiler. If that is the case, then we shouldn't continue reaching for the llvm dependency. To make it easier to understand the case where LLVM support is disabled due to lacking a C++ compiler, add a message noting that fact. Author: Tristan Partin Reviewed-by: Andres Freund Discussion: https://postgr.es/m/CSPIJVUDZFKX.3KHMOAVGF94RV@c3po --- meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 6661c1fefa2..3ac5acb1732 100644 --- a/meson.build +++ b/meson.build @@ -742,8 +742,8 @@ endif ############################################################### llvmopt = get_option('llvm') -if not llvmopt.disabled() - add_languages('cpp', required: true, native: false) +llvm = not_found_dep +if add_languages('cpp', required: llvmopt, native: false) llvm = dependency('llvm', version: '>=3.9', method: 'config-tool', required: llvmopt) if llvm.found() @@ -757,8 +757,8 @@ if not llvmopt.disabled() ccache = find_program('ccache', native: true, required: false) clang = find_program(llvm_binpath / 'clang', required: true) endif -else - llvm = not_found_dep +elif llvmopt.auto() + message('llvm requires a C++ compiler') endif -- 2.38.0 --owu2kol6rl73t573--