From patchwork Thu Jan 30 14:43:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954672 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 382C81E98E8 for ; Thu, 30 Jan 2025 14:44:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248257; cv=none; b=klT5JS4JOQKnDG4LAcaOIHST/dSQC2+2MV1FnXtgKWb22nTqKOJX8of8OYZUjRLicktu41orYUIIaSTsoSWb1q4yiY5i6Q+5EWqzD93UqTWDdDns2kvgrehTlI/SDnrYC2uKJHUXkdulbWmPk8ZsHUR8fHLyfFH3vr0W2d6xQDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248257; c=relaxed/simple; bh=6AH6sHnAtIvkxVy04w9mPlz3xCaluBA+/097TA84tso=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rjuxMkjWnivdCIilYpcmMPFfnZ85IBqgXHKNq9z2qRW6j1ph49x3A/4NQ3jn8bKGlejf4FT0bvFWUR8/q783RnEjUU9UjuRgs8uIqVU724MCzYqO3YUPiULE+o0O0GcrjkGDO6JjG5NmMt56wc9/5sU6Qq9gYpGPvpTVNlz7AWM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=fXr3G9bJ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=A5U6boVb; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="fXr3G9bJ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="A5U6boVb" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4E5DA114012F; Thu, 30 Jan 2025 09:44:13 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Thu, 30 Jan 2025 09:44:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248253; x=1738334653; bh=kE5m4FNAlhTa4P/UPBeYYoOatv54ksyEmcdqFjU10s4=; b= fXr3G9bJyufcGKVoYL99zZP3OTSXXDxu/a+yFIsICNzYn9hH8BEe801a8AFtYlwQ abEFMjOsng7ZdUGwm1K53Mo2AT/IVsE5xeSkw/+rdNVjsvdtjs69asF0BBcMz+S9 XnB3ktMDlRuaVqYdnnYPBoS+HNchJ77P8NgvKWCD/dVz9xEWLT+119tkc11j0faS DH+ugb3tMxaJkvvO91IgtKVEqhpGZ7Ho+SWxTFru/nPuOAdcM3/6l+8twSp/Cwcr sBBuiiGHeVx8hTIFUkkgevcxzhJMJqMK86F1mc2xvDaKT3Hnmgz+x6nSazzf/ssI 43nnhnmvoSdlgKtYwb7ifw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248253; x= 1738334653; bh=kE5m4FNAlhTa4P/UPBeYYoOatv54ksyEmcdqFjU10s4=; b=A 5U6boVbyvCboXyjGvLjZIyQGRYcnpPWGtLER0OxD0TPOwjjKJmDLGK1MgJeVSLAh s3AdEuxpJAalK9gKrSMypaYTYBnAtWTeiohmW7WXQhdxLZBQ0mE7Aa/uJi88tLZM cC9jS2xK93LZkctCIpNIsE1qhALk/TVLYY35M0g7H/DFizPZZt6f07hrU8OwTq3l Qc3rBo0NZ0M3zNkYh4OT+Rd45dvcoRpA8k4UuV21MZTrpFHB9Pz8cJnZG/AztLpV rzkCAkwRbovnn5lz0VdIePVi9SWUuzcrtlMmjsDGnqXy/yrMl0lcVKqlzQz69aid fKPSsVuaX0JkqFX6cwmWw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtghomhdprh gtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:12 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 237ee6c7 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:09 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:43:53 +0100 Subject: [PATCH v2 01/13] meson: fix exec path with enabled runtime prefix Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-1-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 When the runtime prefix option is enabled, Git is built such that it knows to locate its binaries relative to the directory a binary is being executed from. This requires us to figure out relative paths, which is handled in `system_prefix()` by trying to strip a couple of well-known paths. One of these paths, GIT_EXEC_PATH, is expected to be absolute when runtime prefixes are enabled, but relative otherwise. And while our Makefile gets this correctly, in Meson we always wire up the absolute path, which may result in us not being able to find binaries. Fix this by conditionally injecting the paths depending on whether or not the `runtime_prefix` option is enabled. Signed-off-by: Patrick Steinhardt --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index dbc1dab605..1f83dc58c2 100644 --- a/meson.build +++ b/meson.build @@ -691,7 +691,6 @@ libgit_c_args = [ '-DETC_GITATTRIBUTES="' + get_option('gitattributes') + '"', '-DETC_GITCONFIG="' + get_option('gitconfig') + '"', '-DFALLBACK_RUNTIME_PREFIX="' + get_option('prefix') + '"', - '-DGIT_EXEC_PATH="' + get_option('prefix') / get_option('libexecdir') / 'git-core"', '-DGIT_HOST_CPU="' + host_machine.cpu_family() + '"', '-DGIT_HTML_PATH="' + get_option('datadir') / 'doc/git-doc"', '-DGIT_INFO_PATH="' + get_option('infodir') + '"', @@ -1466,6 +1465,7 @@ endif if get_option('runtime_prefix') libgit_c_args += '-DRUNTIME_PREFIX' build_options_config.set('RUNTIME_PREFIX', 'true') + git_exec_path = get_option('libexecdir') / 'git-core' if compiler.has_header('mach-o/dyld.h') libgit_c_args += '-DHAVE_NS_GET_EXECUTABLE_PATH' @@ -1502,7 +1502,9 @@ if get_option('runtime_prefix') endif else build_options_config.set('RUNTIME_PREFIX', 'false') + git_exec_path = get_option('prefix') / get_option('libexecdir') / 'git-core' endif +libgit_c_args += '-DGIT_EXEC_PATH="' + git_exec_path + '"' git_version_file = custom_target( command: [ From patchwork Thu Jan 30 14:43:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954669 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3824D1E8840 for ; Thu, 30 Jan 2025 14:44:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248256; cv=none; b=LBV014VchDH011LmeJuakEL3hfC2AU5Oq4z//bnZ+7OnHd90TmSGj+ts2mjB+Hh6gRcxpsHLndARBL1ZyLYxHMJl4MpOz6WdBo62YFwBOMBCmwmNpj/SKdZ4H88oQwV5F/fGtV0jiy2U+coRyireUgbO9bo5Vv8Fx46LtY9Q20o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248256; c=relaxed/simple; bh=HQQzGoMjr/sZotY5PBmM+c3iAHv+fPRchGCcBk8WiU8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Tg4lMHHBQ96jv/yNOA7l5cUVTdIlyPsnNA93cFUeCt0NWaxiRdDCj5CKnZvVpfAYMZTZYWk5Hz3wE6mmD7FU4CaH+i7zHeXBLUTAe3NfwmIEz7eaEyHT/2G5jmO4ZPw8uaY7N1/n767/DWAWXcK1wZZNNL/QHJndABoXNsY9JAo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=Z//8+1qo; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ig8igVNc; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="Z//8+1qo"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ig8igVNc" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id 51DE31140163; Thu, 30 Jan 2025 09:44:13 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Thu, 30 Jan 2025 09:44:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248253; x=1738334653; bh=4zr8DI7CcX8696ntqA2QAGSIopXi4+iBiYydZEPvycU=; b= Z//8+1qo6KdtRc1dz2K0/Py0FSOnaJ/2ggge46ZTwZRrlodOmlUPj0twQnW20u6g Cl9Vf4Ezp43CHpTOomMEOLI2FsnuCMWg6SHNFeflk3wQLsCFACY2pLH5kK9ka3BX gwAHyGH+t1FJVEUMM9z7zPjcFgsx5dsfogl4nSAdwOzLYC2vI4Y+aESwTp/LwJlH g9g+PfYp8IJjl9WweOeqwEN85cAY8jt+Si+a+pvTfYthbAABUeHpzHKbKcuJhKK0 W0+ebs+oNT8YOC71c8DNxTh2sxSsuaEi/DugF0YxrPu88upR6UgUFDpGgk0Wd1mZ 2mgbg2SzDyBzcF5oFURECA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248253; x= 1738334653; bh=4zr8DI7CcX8696ntqA2QAGSIopXi4+iBiYydZEPvycU=; b=i g8igVNcoJ9w8XZbwRygq2ZYVLS896W86OH7MZ6CeAKKrpjKDdkiDv/fj4SXOs0FX ZBMU30PGUgXbRSf8dtvq4zNVduwZraw8atONmP2VXeNuPKOV2kNmgtDLhuY9IH+A SW0WYpekKnGVvCwPV6Mb6MOkEuh3zSFAIALdQqIc7dh5bUhNDxCmSBAAZbDpbiR/ wET+sND3t2ip7V43vBsIcu+ZD8pshy4RaMmg3G882lXY2atW8PExDUbi7UIDp7xH rNggMBHnMno4HWvtpuQVdZLulqrOj+YkEkuRKunmxCOLDi92ZZKGX46EPUCA3yW1 RfpK8AsQPDB9ol9HxGlmw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeeggeduhefhjeevueejfedttdejhfelffehgfeflefg gfefhedugeeiffdvffeugeenucffohhmrghinhepphhkshdrihhmnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgs pghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhhlthhosg hlvghrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgv lhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:12 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id c0569f40 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:10 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:43:54 +0100 Subject: [PATCH v2 02/13] meson: fix OpenSSL fallback when not explicitly required Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-2-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 When OpenSSL isn't provided by the system we know to fall back to the subproject wrapper. This is especially helpful on Windows systems, where you typically don't have OpenSSL available, in order to reduce the number of required dependencies. The fallback is broken though when the OpenSSL backend is set to 'auto' as we end up calling `dependency('openssl', required: false)` in that case, which implicitly disables falling back to the wrapper. Fix the issue by re-allowing the fallback in case either OpenSSL is required or in case the backend is set to 'auto'. While at it, fix reporting of the backend in case the user asked us to pick no HTTPS backend at all. Signed-off-by: Patrick Steinhardt --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1f83dc58c2..83ed55c75c 100644 --- a/meson.build +++ b/meson.build @@ -1352,7 +1352,11 @@ if https_backend == 'auto' and security_framework.found() endif openssl_required = 'openssl' in [csprng_backend, https_backend, sha1_backend, sha1_unsafe_backend, sha256_backend] -openssl = dependency('openssl', required: openssl_required, default_options: ['default_library=static']) +openssl = dependency('openssl', + required: openssl_required, + allow_fallback: openssl_required or https_backend == 'auto', + default_options: ['default_library=static'], +) if https_backend == 'auto' and openssl.found() https_backend = 'openssl' endif @@ -1366,6 +1370,7 @@ elif https_backend == 'openssl' else # We either couldn't find any dependencies with 'auto' or the user requested # 'none'. Both cases are benign. + https_backend = 'none' endif if https_backend != 'openssl' From patchwork Thu Jan 30 14:43:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954670 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 099BD1E98F3 for ; Thu, 30 Jan 2025 14:44:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248256; cv=none; b=WzVJFxEpj2Kp1aVKM8Z3fnPDEyrTLSL3KNFA27lstvH/Z79YWwshvG/2pzMe4pm4rHAWc/55ManGTunHuTl3Jrb9/4uHmNDzSMUIJN3B+MPrU047Vr2ntE2bLCqpRp7EsF7AYFVQ7DBUoHwKL/W5qjotd6McG0riPLXOg1rqzKA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248256; c=relaxed/simple; bh=twG0zOUyOkp5wPsp8MJHpzVn2jkaa9lIzauw0i75rYA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e9qK3UuOTwIoj/2XV3fWNPHi0Cnbl4BRqA5/EOjopJE3WEHRAwHCkg9hTRzEi6PKUlyZaFP3tih8iyYbiG4FKu/U4lP+5JtgHs6PdyaOtWfHLwthg36/y//ND5X6XAcsGU35geI0pOqH/6AqxMQPQ1N1UGoDW17mUEiIA3+g/ww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=QaWdUpg/; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Hh9fIbei; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="QaWdUpg/"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Hh9fIbei" Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4EF341140106; Thu, 30 Jan 2025 09:44:14 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Thu, 30 Jan 2025 09:44:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248254; x=1738334654; bh=sSBDy2jsuUZ0ak/XFY8RFIKQmDYSF1uPQENNrSCho40=; b= QaWdUpg/VYLQ2hCm/80cLOJtceSX5f0mUakGQzFQS59WCBp0Vf5H+SdMpFDh2lcy Yb8hqL6lIUplvg/QtPlFtn5jdHbla7HYfwrEnchrPN6a4niXzINEBmwNZAl55ldJ MRIjiJfizBlO4i9txj6L8CbzMjj3V54Fs1qT3HL3op0CVYYh+LZDz6ppAQ37rw6x DusMuyK9DA18ARbQw9NvXWmK9XnjPwLf9pnkRDJjQ6wBJJzmdpCxYmTd6N+D0MTT PtWCZ1f+ca5PArkpCXuIYEjzdrZWOOhXo4dQhR8apezBsd3Vsp6fGYJIeMavoAuY kiLuGhh69FVM2xUEihvVHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248254; x= 1738334654; bh=sSBDy2jsuUZ0ak/XFY8RFIKQmDYSF1uPQENNrSCho40=; b=H h9fIbeilQZUI+sSAl2xOjtOxOJf7td9gkUiW0g8CHnkRp41ZbtLX4rXcDOMyS3T/ hmZo8So7eCcVujmeAk9B5rK+l0C8bKMQgTFCM5RFxnAneUlBfKwufNaG0iWzcYuv 50YO/Uk0ebyyQxLLJ+9P9EzUdLf/urCP1o+PA/VEjHOrE+rdusLIPfbN1e14DaeJ uW3YvbLjqryDPcJOHuOF+z5l6gLmzmu5/AvlKfzGHGDi/7nxkOAQ2S+3pI2ED2IH NCVv9RtQmcwgQ6tADu/qxPEAQIkdw9JapLjJGQAJk946W2TcGQoPSf3Dagr6DvOS mMtIiYNO9AOSTQ/TYyAFg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:13 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 6d9d540a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:10 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:43:55 +0100 Subject: [PATCH v2 03/13] meson: inline the static 'git' library Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-3-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 When setting up `libgit.a` we first create the static library itself, and then declare it as part of a dependency such that compile arguments, include directories and transitive dependencies get propagated to the users of that library. As such, the static library isn't expected to be used by anything but the declared dependency. Inline the static library so that we don't even use a separate variable for it. This avoids any kind of confusion that may arise and clarifies how the library is supposed to be used. Signed-off-by: Patrick Steinhardt --- meson.build | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index 83ed55c75c..a124101a73 100644 --- a/meson.build +++ b/meson.build @@ -1555,17 +1555,15 @@ libgit_version_library = static_library('git-version', include_directories: libgit_include_directories, ) -libgit_library = static_library('git', - sources: libgit_sources, - c_args: libgit_c_args, - link_with: libgit_version_library, - dependencies: libgit_dependencies, - include_directories: libgit_include_directories, -) - libgit = declare_dependency( + link_with: static_library('git', + sources: libgit_sources, + c_args: libgit_c_args, + link_with: libgit_version_library, + dependencies: libgit_dependencies, + include_directories: libgit_include_directories, + ), compile_args: libgit_c_args, - link_with: libgit_library, dependencies: libgit_dependencies, include_directories: libgit_include_directories, ) From patchwork Thu Jan 30 14:43:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954671 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09A1B1E9906 for ; Thu, 30 Jan 2025 14:44:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248256; cv=none; b=cHpgVqTsfJLnNoVC9JE6vlSnNS6Wp7BoMWIgXWe/+zDxyMF8pLu9CZsaeYyZTSxJwl61UEtEqV3LnUL3LGj4znOjtEfUSVnH+d5nqO987yoxnInbeonB+zqXjPwZ6j40Pq2iupnHHph6afI7B7KemdUXs+1+B5IVWe6c4PcbRcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248256; c=relaxed/simple; bh=goJQnGWIoowLxOUySZAtq8fnQ8UcM0wBKXag9S27vNw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gOL2/0TUvrNzAjM0AhzFX1va4Cx7towDGFSv2RXp0qSeSrIvCKzWmEeOBQYz9awhKhy+sM/hpG7P3UAIg3KNsTwxJ0+lS+7nJccgq1lsUnRuXCPhR1Sf8SqUUj3nLcVKxj0vNC9AJ7yQO/rZtcfZ6x2xArWxiqk2gp3XaRxJ/lk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=et5I98uu; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=TbSZdX5s; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="et5I98uu"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="TbSZdX5s" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4D24D11400DA; Thu, 30 Jan 2025 09:44:14 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Thu, 30 Jan 2025 09:44:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248254; x=1738334654; bh=qgkHTeLOzJg0jc2HUFzbimHSMyBLfaNkti9ODLwgYu8=; b= et5I98uucPOhciuOUzMVQArZlkpX9zAZYqixSjopVPUEZu9qIBzjxSY5fxiJQXIi ADvPHHNVVbMTYcJG8jtClu4U4qaygGPYCh1AMLDjoSOWflaW7raXGtzsBGPfrzLH KeA6Up8hYT0XmfbSh2OOX8pWPnUUtbTcINztAMcoSpqd2lAnoJig/a1XX/5qTdUM 77NzzLaKFEcEh6dvZV7NJVJozFI8qM1tVcoQLphGFWLd2ZLoqbehPRwwtUAjpOdk xvVjCTk686UcweYDhPfB4jI2V5FC3Uv67vyRlSB0/QY+2Behy7ZwgjTseXP3MTWj p+dux6jZc6JUW+EWvsfopQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248254; x= 1738334654; bh=qgkHTeLOzJg0jc2HUFzbimHSMyBLfaNkti9ODLwgYu8=; b=T bSZdX5sMTaR6MHmAc++cn997o0xyEjFPN8SO/zQ2tl4UbGYml5Kci45q4tbJwZiV zUCA0/equHZfOj33bWpFBCEQDbTP6WGAG09WcfbxNr6iMobdToBW56TRSt0LeXi9 XHeA5mrIMWskIQu4OKld+7TROE0vVNlB1qF0Y2LJsuneReyJpHxUWGOOpAUZjw2H xgxvzzABnU5hFY1KqzuPdWzH+nXoNtRDQxK+yEN+duRmZwYHs5j2yom9ZBUiqqLf NTD3GmkGe2Iy+DDH+qxnBFmqzRCQNdNmMA0A/xZg1FQ9ugXcbCkLLZEjmGeNcQcG 385d52F6Aq1vCpllNHdCQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:13 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id acff5fc7 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:11 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:43:56 +0100 Subject: [PATCH v2 04/13] meson: simplify use of the common-main library Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-4-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 The "common-main.c" file is used by multiple executables. In order to make it easy to set it up we have created a separate library that these executables can link against. All of these executables also want to link against `libgit.a` though, which makes it necessary to specify both of these as dependencies for every executable. Simplify this a bit by declaring the library as a source dependency: instead of creating a static library, we now instead compile the common set of files into each executable separately. This change surfaces an issue when linking aliases for git-remote-http: we extract all objects from `git-remote-http` et al and then link them into the new executable. As such, these objects would already contain a `main()` function. But now that we also compile "common-main.c" into these aliased executables we see a linker error due to `main()` being defined twice. We fix this by only linking against `libgit.a`. Signed-off-by: Patrick Steinhardt --- meson.build | 34 +++++++++++++++------------------- oss-fuzz/meson.build | 2 +- t/helper/meson.build | 4 ++-- t/meson.build | 4 ++-- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/meson.build b/meson.build index a124101a73..c7d597eda8 100644 --- a/meson.build +++ b/meson.build @@ -1604,15 +1604,11 @@ if host_machine.system() == 'windows' error('Unsupported compiler ' + compiler.get_id()) endif endif -common_main_library = static_library('common-main', + +libgit_commonmain = declare_dependency( sources: common_main_sources, - c_args: libgit_c_args, - dependencies: libgit_dependencies, - include_directories: libgit_include_directories, -) -common_main = declare_dependency( - link_with: common_main_library, link_args: common_main_link_args, + dependencies: [ libgit ], ) bin_wrappers = [ ] @@ -1620,7 +1616,7 @@ test_dependencies = [ ] git = executable('git', sources: builtin_sources + 'git.c', - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1628,35 +1624,35 @@ bin_wrappers += git test_dependencies += executable('git-daemon', sources: 'daemon.c', - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) test_dependencies += executable('git-sh-i18n--envsubst', sources: 'sh-i18n--envsubst.c', - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) bin_wrappers += executable('git-shell', sources: 'shell.c', - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) test_dependencies += executable('git-http-backend', sources: 'http-backend.c', - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) bin_wrappers += executable('scalar', sources: 'scalar.c', - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1669,7 +1665,7 @@ if get_option('curl').enabled() git_remote_http = executable('git-remote-http', sources: curl_sources + 'remote-curl.c', - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1677,7 +1673,7 @@ if get_option('curl').enabled() test_dependencies += executable('git-http-fetch', sources: curl_sources + 'http-fetch.c', - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1685,7 +1681,7 @@ if get_option('curl').enabled() if expat.found() test_dependencies += executable('git-http-push', sources: curl_sources + 'http-push.c', - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1694,7 +1690,7 @@ if get_option('curl').enabled() foreach alias : [ 'git-remote-https', 'git-remote-ftp', 'git-remote-ftps' ] test_dependencies += executable(alias, objects: git_remote_http.extract_all_objects(recursive: false), - dependencies: [libgit, common_main], + dependencies: [libgit], ) install_symlink(alias + executable_suffix, @@ -1711,7 +1707,7 @@ endif test_dependencies += executable('git-imap-send', sources: imap_send_sources, - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1719,7 +1715,7 @@ test_dependencies += executable('git-imap-send', foreach alias : [ 'git-receive-pack', 'git-upload-archive', 'git-upload-pack' ] bin_wrappers += executable(alias, objects: git.extract_all_objects(recursive: false), - dependencies: [libgit, common_main], + dependencies: [libgit], ) install_symlink(alias + executable_suffix, diff --git a/oss-fuzz/meson.build b/oss-fuzz/meson.build index ed79665501..878afd8426 100644 --- a/oss-fuzz/meson.build +++ b/oss-fuzz/meson.build @@ -15,6 +15,6 @@ foreach fuzz_program : fuzz_programs 'dummy-cmd-main.c', fuzz_program, ], - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], ) endforeach diff --git a/t/helper/meson.build b/t/helper/meson.build index f502d1aaa3..ae01b3fc45 100644 --- a/t/helper/meson.build +++ b/t/helper/meson.build @@ -79,14 +79,14 @@ test_tool_sources = [ test_tool = executable('test-tool', sources: test_tool_sources, - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], ) bin_wrappers += test_tool test_dependencies += test_tool test_fake_ssh = executable('test-fake-ssh', sources: 'test-fake-ssh.c', - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], ) bin_wrappers += test_fake_ssh test_dependencies += test_fake_ssh diff --git a/t/meson.build b/t/meson.build index 35f25ca4a1..dae50601fe 100644 --- a/t/meson.build +++ b/t/meson.build @@ -39,7 +39,7 @@ clar_sources += custom_target( clar_unit_tests = executable('unit-tests', sources: clar_sources + clar_test_suites, - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], ) test('unit-tests', clar_unit_tests) @@ -72,7 +72,7 @@ foreach unit_test_program : unit_test_programs 'unit-tests/lib-reftable.c', unit_test_program, ], - dependencies: [libgit, common_main], + dependencies: [libgit_commonmain], ) test(unit_test_name, unit_test, workdir: meson.current_source_dir(), From patchwork Thu Jan 30 14:43:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954674 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADC2D1E9B0B for ; Thu, 30 Jan 2025 14:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248258; cv=none; b=Mt1j5h2RmFtIF7FrxdLIONKGV/xnipJq4lAr9xxdn64y7fECcVixeIKW8obEHKtyuJqGWVssw/ZhGMenJ01PbPTG9+QFNWP6kHYGpVLpvUnampUXE5gwmepbq3LpRxu/++3zKx5yzFDWHt+qllhB/GEm0Wa13+/7kaT/+gkwTlM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248258; c=relaxed/simple; bh=BSkPnIoFw6ehQUPpYWw95PwkT6YTfEQb2O/7/haaPvk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VWoU29WSGEVzrrrzh4ag16pUIhT7MzZAQf46Icp+IUKLKUY0wXqNacR01EWIarXf4e+a99H4UXvS0c2fxX8MwfWRGL7X7kxOXKk77EL7zTqyIkFfiHH5FQGYgZgksWbtKH9Z6DWVbvrElck0FQrJypw2zWMfCKB4uz2WvDLS+QE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=pgZWYBwe; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=b9mQGTDe; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="pgZWYBwe"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="b9mQGTDe" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id EC3EE11400D8; Thu, 30 Jan 2025 09:44:14 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Thu, 30 Jan 2025 09:44:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248254; x=1738334654; bh=ZoVpkMShCU2vSnWl+A7LejxUGyG44PTNhIvSSjLikE0=; b= pgZWYBweYPtuwC3CDN0OINM7eXRZTHz/f/9avnIfJx77yroffyn7JEiT/Ycd8Oc/ dItYPY4BW09F/NDNQYaYQcEyVJn63Bbx8wYwho0FsELbHKd3F4i2gHDmIKGSluuo ULLnef+2eF848QoIg1cvqaYIgTDVaIxA1banzkbXqTFaTgbsrYI7TeYLrUsnmmTb xy0Cfr2xBBmKzbYZV+DjgC8qdEFDaNmOuv8kuZJCspPcusnkn95lKSibzqOwIU0d I7DFByTC1UZ3+CaXsF370/zormqydX0H9nQawwTiaks1lRY8ONYFuSQhnaE0oyWe R+ayU+rmMwVLFxmWTbsbNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248254; x= 1738334654; bh=ZoVpkMShCU2vSnWl+A7LejxUGyG44PTNhIvSSjLikE0=; b=b 9mQGTDeOUL2X/T0wqfiVtPqiuV4azGhEieQB3ImlkGZLFfHMNiYrwB7/mIdLyqdr l0SpqPeT5Xs9ofawZ13ckrVszD/6zYBLqNl4DetLpB4QwohSBvpbvFmO+XR4xcUe Fe3+bd78l6SznVRXVYDeLWwsM4xKtIjbZPRiy1htw2cVnjBeh0pIGvPqSNpSm9Vx wNKxIjdBnXVTSoT3jaZla0yIELm4KINL9WKUdWEaNgNVY6TUZeJBQtg4XdA1jjo1 cUlXLZfZL7dobHWRGdFgnV9vArCmgaNXk0/m2FcAb8lsFcZOXKbovJl0sc386r8I RaapOX8eZSNqx2tT19caA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtghomhdprh gtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:14 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 41787da0 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:12 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:43:57 +0100 Subject: [PATCH v2 05/13] meson: introduce `libgit_curl` dependency Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-5-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 We've got a set of common source files that we use for those executables that link against libcurl. The setup is somewhat repetitive though. Simplify it by declaring a `libgit_curl` dependency that bundles all of it together. Note that we don't include curl itself as a dependency. This is because we already pull it in transitively via the libgit dependency, which is unfortunate because libgit itself shouldn't actually link against curl in the first place. This will get fixed in the next commit. Signed-off-by: Patrick Steinhardt --- meson.build | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/meson.build b/meson.build index c7d597eda8..820008f6de 100644 --- a/meson.build +++ b/meson.build @@ -1658,30 +1658,32 @@ bin_wrappers += executable('scalar', ) if get_option('curl').enabled() - curl_sources = [ - 'http.c', - 'http-walker.c', - ] - - git_remote_http = executable('git-remote-http', - sources: curl_sources + 'remote-curl.c', + libgit_curl = declare_dependency( + sources: [ + 'http.c', + 'http-walker.c', + ], dependencies: [libgit_commonmain], + ) + + test_dependencies += executable('git-remote-http', + sources: 'remote-curl.c', + dependencies: [libgit_curl], install: true, install_dir: get_option('libexecdir') / 'git-core', ) - test_dependencies += git_remote_http test_dependencies += executable('git-http-fetch', - sources: curl_sources + 'http-fetch.c', - dependencies: [libgit_commonmain], + sources: 'http-fetch.c', + dependencies: [libgit_curl], install: true, install_dir: get_option('libexecdir') / 'git-core', ) if expat.found() test_dependencies += executable('git-http-push', - sources: curl_sources + 'http-push.c', - dependencies: [libgit_commonmain], + sources: 'http-push.c', + dependencies: [libgit_curl], install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1689,8 +1691,8 @@ if get_option('curl').enabled() foreach alias : [ 'git-remote-https', 'git-remote-ftp', 'git-remote-ftps' ] test_dependencies += executable(alias, - objects: git_remote_http.extract_all_objects(recursive: false), - dependencies: [libgit], + sources: 'remote-curl.c', + dependencies: [libgit_curl], ) install_symlink(alias + executable_suffix, @@ -1700,14 +1702,9 @@ if get_option('curl').enabled() endforeach endif -imap_send_sources = ['imap-send.c'] -if use_curl_for_imap_send - imap_send_sources += curl_sources -endif - test_dependencies += executable('git-imap-send', - sources: imap_send_sources, - dependencies: [libgit_commonmain], + sources: 'imap-send.c', + dependencies: [ use_curl_for_imap_send ? libgit_curl : libgit_commonmain ], install: true, install_dir: get_option('libexecdir') / 'git-core', ) From patchwork Thu Jan 30 14:43:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954673 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A08B1E9916 for ; Thu, 30 Jan 2025 14:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248258; cv=none; b=FdSEVkaWSKhsIijtttWSiDpbBoOSw4LC2MLsnTVVqJry/+65IquB9UzKRF5C5QPxvP+Df/oR+clf1RJBOw69DHFnUFoRDotTG72tyTguDlPUiiZNWdTJGyYdmAdmCPjW8zQeieMshnDwkBFHs0Z+4kIae9E74AoPfgRcLwX6EUw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248258; c=relaxed/simple; bh=TXVQR4vsZsUM+AJq0Vx2V9OIVqUHX/vuH4qy/Hom3lQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=t/MLk+EgIxS8sKt3f89WPNwATJ0ttDM55U6Dvv5hrxS0Fwm5PWczxESjtQvqNlG2lzQTCJPGRy1GBjDryJxYnYXjqnNTxO1Hd9s4md85fwMZkYT8JfuFFIev5m7fzagh7NkTws2MCCoD2LjH6ewwVi64cLn1C+EvrYnGQFVx96A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=p4GHtj3d; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=mbiZ0gTw; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="p4GHtj3d"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="mbiZ0gTw" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 5BD3B1380137; Thu, 30 Jan 2025 09:44:15 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 30 Jan 2025 09:44:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248255; x=1738334655; bh=du+zEON5gfjLLSEgtgqIngK+Zfp1drXV81j/cMGPTZU=; b= p4GHtj3dAki/4Gd64trzuwr485jmxIUnb3uytFXtZJ4VZ0pWA7cVnQdJGn82mV4o WKjV451/bLeJb/Es0v9VF5bquJ8LBNSspvc+xcnJ5Mf/+S8UcVyhB7odDzt/gMC7 YZhha+ZZgsNKJPhfPV2xc9gDEMK0lH3BmksjpWtWBW/kr2BUeB522d+ldnHmosOZ uQP2Dom8Lg1g5+sk7+8RWaeJdtGnA4fykJZvVxzMlBhelTknq8OhFXfpX68U6WIb 520RVQaJFQH6ao+OYZM8iBRsON0S/GJqNoTvUsypicLvZ5NUTa5By7jiFE/dzWch fiYdj/743z9z/tbvc9Rvsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248255; x= 1738334655; bh=du+zEON5gfjLLSEgtgqIngK+Zfp1drXV81j/cMGPTZU=; b=m biZ0gTwcoos+L35oyH9qGMJ31pFFhvI9XLtKQvjmhAypIS8w08slvpE8s/XSHmxk eDZyWrKe4Q7VaTKPwBY6+E/ojNreHudOsBl9l1f2rkkwp6rMcCRc4J/cPzi9Y0Ye LK+zvX2D0zb8DyuQ4Wc6D0h+zDJo7FyCqUdHCKXLRdECH7dPWPlkgy62aKKZ5ZH/ 5s0gpWDY1Pj8PT+rrHWrRFPZDM+fn9hK2CL+0UGxMq/Dd0gXsdjZJ7ZMHa9q+oWz iB6ZxTsnS4PZW42cy2rdeOKeo387qk4ygdCpEaP1kmT3QxUdm+IY/iZWssZmX2/4 ibtENq2kri5A0LCMQPmFw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:14 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 6ce02770 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:13 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:43:58 +0100 Subject: [PATCH v2 06/13] meson: stop linking libcurl into all executables Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-6-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 We set up libcurl via the `libgit_dependencies` variable, which gets propagated into every user of the `libgit` dependency. This is not necessary though, as most of our executables aren't even supposed to link against libcurl. Fix this by only propagating include directories as a libgit dependency and propagating the full curl dependency via `libgit_curl`. Signed-off-by: Patrick Steinhardt --- meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 820008f6de..4b641095a1 100644 --- a/meson.build +++ b/meson.build @@ -927,7 +927,9 @@ if curl.found() use_curl_for_imap_send = true endif - libgit_dependencies += curl + # Most executables don't have to link against libcurl, but we still need its + # include directories so that we can resolve LIBCURL_VERSION in "help.c". + libgit_dependencies += curl.partial_dependency(includes: true) libgit_c_args += '-DCURL_DISABLE_TYPECHECK' build_options_config.set('NO_CURL', '') else @@ -1663,7 +1665,7 @@ if get_option('curl').enabled() 'http.c', 'http-walker.c', ], - dependencies: [libgit_commonmain], + dependencies: [libgit_commonmain, curl], ) test_dependencies += executable('git-remote-http', From patchwork Thu Jan 30 14:43:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954675 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C3F81EB9E3 for ; Thu, 30 Jan 2025 14:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248259; cv=none; b=gzve0ooV+tF4joguMXHTzS5yF0yG4LTHEv+kNP9uPWbMQSg+sLhGuMSmdrUROa+dXUYb5oK8juKeMXOjBc2pSCIfonsbI1CE1K7tMmHoBJnYxTfAQI6zHrTK0+D0fgHUu+fp1qC3Z0fpTsmYxq4Kxd/njqS6UOrhSihAABoqHOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248259; c=relaxed/simple; bh=150XYehbKCv1F9lkdlLJt2lPxwgw9lWjzvctOJZx9HE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aPaGqq6JARTq/yhUGJDkrj/pPXnJqtC9HWa+MbB/4G02Ea971CJFAvYgme/MnJ9XU+zUAYGP71UpPh8K67ooYCzes5y5PELhpvi+ylq/nAdNiGnJrJfKIhDM23pGRM/DZCL9FwDZx6m/CtuDnKWb7xb+IrEVN17BuXnyvHOMjko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=YMtZxUwK; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=OcQ2fU4n; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="YMtZxUwK"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OcQ2fU4n" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 011AA1140169; Thu, 30 Jan 2025 09:44:16 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Thu, 30 Jan 2025 09:44:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248255; x=1738334655; bh=ZpLfqUaoMGcokHmI0bDvi4HsCJOuRPkZ5bVLpHq0v/E=; b= YMtZxUwKWSVVHc73TRmd6mTUAofOBd8olCrofNVL91ZwpfXohHTfwaL+vhjId87k KqwQ3QiRzHumN5r+Q0uzfSu1wfGWFqW4BS4CC63Zc8Tmi8p5y2c+bO9l7b2fZHtF 4MWcjcKq1oMIyvD8OTTVGx55l1EjTpDwgJlP2VR3MXoqpl4qAyJ+SFcSVnjXQ86k ikXZGUcve5e7bzBeOzn+IkpHHuUVR8vr7KlWWV8n9BnkNZMU5cvqad+boXObF/B9 NCw5Gk9jZMHsXft7SUyMwIirL31kdBv32Hlgw7h1QvbZxkmiTdnMc2lKIL4kPMu1 QooZCYS/AS11zfU4wttZEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248255; x= 1738334655; bh=ZpLfqUaoMGcokHmI0bDvi4HsCJOuRPkZ5bVLpHq0v/E=; b=O cQ2fU4nHK9ep14Ch0LGtqB2griLbVOQNVLMyW0s4a0p+ogDU9zl/SLUbW1KopaDS 7Hnxt+Y6u87KTM64OmgUo5V8LxiWexG+EpA/Sh3lYNj2VaTKtjEw0gQfCotgpWXI NvLwbZL06iZLgTi1jlsxv5peLC/icpKriNPs6pMTPOSQaXS/8/RpeiLf/i4j0/1j 4P03+dVmpm9gQ7I6zFhKZZOO8yl76ezwIHI1FhrNSmLXxYDr62x2Ud7xZCvlvvlh QIStFSvlnUBaAdG26lv2WUFoq3Syh36nGy/jcvMD07EOwCx6UcTfnTZMGY11FA3D 0dUfyBZiEZzO2gHZiwoOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:15 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 70f18eae (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:14 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:43:59 +0100 Subject: [PATCH v2 07/13] meson: drop separate version library Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-7-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 When building `libgit.a` we link it against a `libgit_version.a` library that contains the version information that we inject at build time. The intent of this is to avoid rebuilding all of `libgit.a` whenever the version changes. But that wouldn't happen in the first place, as we know to just rebuild the files that depend on the generated "version-def.h" file. This is an artifact of an earlier version of the Meson build infra that didn't ultimately land. We didn't yet have "version-def.h", and instead injected the version via preprocessor directives. And here we would have rebuilt all of `libgit.a` indeed in case the version changes, because the preprocessor directive applied to all files. Stop building the separate library and instead add "version-def.h" to the list of source files directly. Signed-off-by: Patrick Steinhardt --- meson.build | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 4b641095a1..e9af093024 100644 --- a/meson.build +++ b/meson.build @@ -478,6 +478,7 @@ libgit_sources = [ 'userdiff.c', 'utf8.c', 'varint.c', + 'version.c', 'versioncmp.c', 'walker.c', 'wildmatch.c', @@ -1542,26 +1543,14 @@ version_def_h = custom_target( depends: [git_version_file], env: version_gen_environment, ) - -# Build a separate library for "version.c" so that we do not have to rebuild -# everything when the current Git commit changes. -libgit_version_library = static_library('git-version', - sources: [ - 'version.c', - version_def_h, - ], - c_args: libgit_c_args + [ - '-DGIT_VERSION_H="' + version_def_h.full_path() + '"', - ], - dependencies: libgit_dependencies, - include_directories: libgit_include_directories, -) +libgit_sources += version_def_h libgit = declare_dependency( link_with: static_library('git', sources: libgit_sources, - c_args: libgit_c_args, - link_with: libgit_version_library, + c_args: libgit_c_args + [ + '-DGIT_VERSION_H="' + version_def_h.full_path() + '"', + ], dependencies: libgit_dependencies, include_directories: libgit_include_directories, ), From patchwork Thu Jan 30 14:44:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954677 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C46C1EB9E7 for ; Thu, 30 Jan 2025 14:44:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248260; cv=none; b=U7u9ZSbPEeKhmQwLiUvXDa+uMwYWoXAFfDRGyJHknsiw7thkuamSpJzt8DzXSSJH8yx5CIsKfLX5jj+CSscUAPq/4UUzprhnF8UYAl6geKXXvp81vXyvzLTuuslC9cFCpaKok4gxIyMyb+m4O3UfJ+/g1ZTCYuDLzmqMG3gUpK0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248260; c=relaxed/simple; bh=P90jykugAJdvLzP5l05fFumleRRvOLiJdv/9/2bZ47g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q6Zy1UnNgGUTA5tQdGbDc9hHHTvssy38ui2nsrWtlwJO5Aro7rx2mg+KsCjWffZrxxhHz/a2HE3sgFys3+Svs7998CPX18CTh/Qcb4z4HqMqlzmxhMGq/fMW7XgowfWnlQ6NqSy5iCwacOcyJMHWIPbnX5YrQir8KivS05tiwKc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=X5kPUsMu; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=mCWIikSt; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="X5kPUsMu"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="mCWIikSt" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 066A31140106; Thu, 30 Jan 2025 09:44:17 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 30 Jan 2025 09:44:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248257; x=1738334657; bh=lhIBs9CBf0wSgg1NK9ymsYmRz7nRYL2wZ3FAGeb73Q4=; b= X5kPUsMu+ELoZbM/Dfvejxf9rYELzTTFig9B3aEu5FSYXDaSMUZiIlLxpvKPC29U BywJEGANgbFfDBb1EI9TJVTsTOK60eTeQzBTcBwBHGOd7XJbKc1ykzPymP8UMXjE /Eqp+A6neaq/SeW4AbpEQfSuNzDLxzWDYpagY6kNWaawsM+/z5/INXoPX3qdJrSR wt2Pv84b6Bc7y57iiXWpYo+jWhLg76CcO3HKTVSjOPjEMIMBgzL0r3fmYEHgJ8Vh wzuX/gLKup7D0nSenb/0gNRVqZaukEb+L1N18gdQuS6k3a1Fty6kPBFNTPeJXAVQ 1NAjrXuPKEd0aUfuMcxEqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248257; x= 1738334657; bh=lhIBs9CBf0wSgg1NK9ymsYmRz7nRYL2wZ3FAGeb73Q4=; b=m CWIikStyvO6fXLdqbMAUdfgdDgf4RHV3EzeJpnTYjgZE+tbAJHkoZV75kkJN25Tm BNNs+RjY74N+vbH0A5RDPbIJ3XyeQNkkGdloiYGCHGPt6zrsYe9ew5HIOuRxLHMz NcbSt91Gjx47DS3nFOMnlQIDklot9izDsBFo8A8aCFzvU5SV8mf7tpsd3+eFsYyT uP1TPlROfLZui3oAYCNITspl3Uo4BxvbRLPPtmLE1pzrhOQmkaAkWuVnytgo/Z4T yVaRrZm6A/V6x3uCznamuZFsRmt+gRUxaum97mJDVZITf6XD3DV20X0mdIa95bw/ MLEJSUSFbAAQd7XeLBaXg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtghomhdprh gtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:16 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 14361f12 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:15 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:44:00 +0100 Subject: [PATCH v2 08/13] meson: improve PATH handling Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-8-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 When locating programs required for the build we give some special treatment to Windows systems so that we know to also look up tools provided by a Git for Windows installation. This ensures that the build doesn't have any prerequisites other than Microsoft Visual Studio, Meson and Git for Windows. Consequently, some of the programs returned by `find_program()` may not be found via PATH, but via these extra directories. But while Meson can use these tools directly without any special treatment, any scripts that we execute may not be able to find those programs. To help them we thus prepend the directories of a subset of the found programs to PATH. This doesn't make much sense though: we don't need to prepend PATH for any program that was found via PATH, but we really only need to do so for programs located via the extraneous Windows-specific paths. So instead of prepending all programs paths, we really only need to prepend the Windows-specific paths. Adapt the code accordingly by only prepeding Windows-specific paths to PATH, which both simplifies the code and clarifies intent. Signed-off-by: Patrick Steinhardt --- meson.build | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index e9af093024..bc42cd994c 100644 --- a/meson.build +++ b/meson.build @@ -198,19 +198,19 @@ endif cygpath = find_program('cygpath', dirs: program_path, required: false) diff = find_program('diff', dirs: program_path) +git = find_program('git', dirs: program_path, required: false) shell = find_program('sh', dirs: program_path) tar = find_program('tar', dirs: program_path) -script_environment = environment() +# Sanity-check that programs required for the build exist. foreach tool : ['cat', 'cut', 'grep', 'sed', 'sort', 'tr', 'uname'] - program = find_program(tool, dirs: program_path) - script_environment.prepend('PATH', fs.parent(program.full_path())) + find_program(tool, dirs: program_path) endforeach -git = find_program('git', dirs: program_path, required: false) -if git.found() - script_environment.prepend('PATH', fs.parent(git.full_path())) -endif +script_environment = environment() +foreach path : program_path + script_environment.prepend('PATH', path) +endforeach if get_option('sane_tool_path') != '' script_environment.prepend('PATH', get_option('sane_tool_path')) From patchwork Thu Jan 30 14:44:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954676 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6C231EBA09 for ; Thu, 30 Jan 2025 14:44:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248260; cv=none; b=hA44HQPaHwX4Tr7PIVFrJzFSXzC6u0IVTVr4RDz5ij76kj2WWxkkKw7swbFQacX+4ldeuVOKosGZLZXSqUuwI0/Zo/F5z7IzPohjoij2EPfZSQN8y8v4A7y2kpp9ZZdGAp0xApsyIc7DR77uwUL3rqoojoVp+qKXo4Lgg6Ne6cs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248260; c=relaxed/simple; bh=a4LeNaicKa1WGktolbmwcIGTJRy1pViWOJqui3j9Y28=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nnw2l/Q86sNorcWdqORG8VL7zvMkskabeqTR+uNWC0peJTB6OqtwFCugPCZy6dRi4w1wzj9k/Pin4ovNIht6qTJs2XyluluFkfxY4jIU6mM/IN/YBjJKcJxAiZVDsJ8PP84GqU3+lOE1WTSIwqDMX1EpTO+U4OxY93u2aBtlfME= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=aUOxUH5S; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=gNHr7fFG; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="aUOxUH5S"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="gNHr7fFG" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 05671138019B; Thu, 30 Jan 2025 09:44:18 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Thu, 30 Jan 2025 09:44:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248258; x=1738334658; bh=L9edcznVl7/Du0ajIi2RI0tbZWrKIvNG1lZMoaV+91Y=; b= aUOxUH5SdfCdMpJOluLAx6lSquguSl5cEnN7t6OfXTSvlsMT7O7wYazPNq36Evuc 7WUN0J1wp1WUKz2RuWuEKT6G+3EJYo5W9yWAvmR4RrL8S2mPiDqZnHRr16UVU57e aiCdl54BkAIcb6c67rDJ+DJFKZbYpC6Cc+zz6216i6Dx5rUZW5wNJb378bzzw/XM 1vUcvqJgJ8TCzI/a8qU6AkgGZRpLllxxZtCfJnt8nytdJqbN7cehrzVuiuJkD94c HHqGJXrgI+5MqwhSVIQ0pbvx5vMulKBECmwgOAhHJd/ZI5b5lQIUgh5+NIxuC5IY mRUO2SH/3G98ArUWjID6TQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248258; x= 1738334658; bh=L9edcznVl7/Du0ajIi2RI0tbZWrKIvNG1lZMoaV+91Y=; b=g NHr7fFGyw+LRZCR+QKH8DuJSrUKHqubkggdvlMPfPDO8yc5milD1jQ4FAN98I0+s jm927wotHuGGgpFofV8Q6vgtI2chTE+rKLQ+cXUMqX2jgO2LBr/Jzy42PgbCZVVz sKGt0c6sp9gJYkgNHIOCk8rcSR6X7lKKWL0xDpQU97l48e4BFhtpFw/3ET3V0IOi udGc+OJvIIfS4D+1OgvdZiJi+wb0GznmxXCbRf1jGU14mcOtgyBCH24NBYAX4dti jrQouziyxxrl2h0vjlGFFmMM0AvdUQhF4cDJvkyH5WV9+GzlDKFRcfm0RAOHzXLL h7+j9WsLh5MyDPt7eebMA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtghomhdprh gtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:17 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 8dbdc795 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:16 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:44:01 +0100 Subject: [PATCH v2 09/13] meson: improve handling of `sane_tool_path` option Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-9-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 The `sane_tool_path` option can be used to override the PATH variable from which the build process, tests and ultimately Git will end up picking programs from. It is currently lacking though because we only use it to populate the PATH environment variable for executed scripts and for the `BROKEN_PATH_FIX` mechanism, but we don't use it to find programs used in the build process itself. Fix this issue by treating it similar to the Windows-specific paths, which will make us use it both to find programs and to populate the PATH environment variable. To help with this fix, change the type of the option to be an array of paths, which makes the handling a bit easier for us. It's also the correct thing to do as the input indeed is a list of paths. Furthermore, the option now overrides the default behaviour on Windows, which si to pick up tools from Git for Windows. This is done so that it becomes easier to override that default behaviour in case it's not desired. Signed-off-by: Patrick Steinhardt --- meson.build | 17 ++++++++--------- meson_options.txt | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index bc42cd994c..7180fd58fd 100644 --- a/meson.build +++ b/meson.build @@ -191,9 +191,11 @@ project('git', 'c', fs = import('fs') program_path = [] -# Git for Windows provides all the tools we need to build Git. -if host_machine.system() == 'windows' - program_path += [ 'C:/Program Files/Git/bin', 'C:/Program Files/Git/usr/bin' ] +if get_option('sane_tool_path').length() != 0 + program_path = get_option('sane_tool_path') +elif host_machine.system() == 'windows' + # Git for Windows provides all the tools we need to build Git. + program_path = [ 'C:/Program Files/Git/bin', 'C:/Program Files/Git/usr/bin' ] endif cygpath = find_program('cygpath', dirs: program_path, required: false) @@ -212,10 +214,6 @@ foreach path : program_path script_environment.prepend('PATH', path) endforeach -if get_option('sane_tool_path') != '' - script_environment.prepend('PATH', get_option('sane_tool_path')) -endif - # The environment used by GIT-VERSION-GEN. Note that we explicitly override # environment variables that might be set by the user. This is by design so # that we always use whatever Meson has configured instead of what is present @@ -671,8 +669,9 @@ build_options_config.set('GIT_TEST_UTF8_LOCALE', '') build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir'))) build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb')) -if get_option('sane_tool_path') != '' - build_options_config.set_quoted('BROKEN_PATH_FIX', 's|^\# @BROKEN_PATH_FIX@$|git_broken_path_fix "' + get_option('sane_tool_path') + '"|') +if get_option('sane_tool_path').length() != 0 + sane_tool_path = (host_machine.system() == 'windows' ? ';' : ':').join(get_option('sane_tool_path')) + build_options_config.set_quoted('BROKEN_PATH_FIX', 's|^\# @BROKEN_PATH_FIX@$|git_broken_path_fix "' + sane_tool_path + '"|') else build_options_config.set_quoted('BROKEN_PATH_FIX', '/^\# @BROKEN_PATH_FIX@$/d') endif diff --git a/meson_options.txt b/meson_options.txt index c102185ed5..e0e8089891 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -13,8 +13,8 @@ option('perl_cpan_fallback', type: 'boolean', value: true, description: 'Install bundled copies of CPAN modules that serve as a fallback in case the modules are not available on the system.') option('runtime_prefix', type: 'boolean', value: false, description: 'Resolve ancillary tooling and support files relative to the location of the runtime binary instead of hard-coding them into the binary.') -option('sane_tool_path', type: 'string', value: '', - description: 'A colon-separated list of paths to prepend to PATH if your tools in /usr/bin are broken.') +option('sane_tool_path', type: 'array', value: [], + description: 'An array of paths to pick up tools from in case the normal tools are broken or lacking.') # Build information compiled into Git and other parts like documentation. option('build_date', type: 'string', value: '', From patchwork Thu Jan 30 14:44:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954678 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A82811EBFE6 for ; Thu, 30 Jan 2025 14:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248261; cv=none; b=MD4r2YlO58IrbZxZwfxgeIpmdLX4vChvxCB/seXLAEZwMvQPwg6qChYSpl8GlFWziKDpexQfV/ZXe274JCH/55e7RuKEUpH2ITbHItwbQAZnCeQRA9OlZC5FXrqPhimnLrSONfv4QMEev7hrI+N4m+5XjGPy9Reg6Zw7jwNZ+hk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248261; c=relaxed/simple; bh=YVBQaxHA4TMLpJqu4HGQc+QBjeb4zXwHzie1EjaQr+g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QtejxVsACSaTHsXiOjNW78jgWMEpK23vvZt0KY4ibRhLHJp13XSOOm+iQtrP8rLW7fg72hesgn+BtnIpltZiyo3qNjhqq8O/yJCA4Ffs7iS6qGzbMxZ4qbGESd5tYpSmbkApLxB9kNHdsMYASxlGC4qJOy/2WfYyak8eCmtpens= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=iugTVsjk; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=R9vuChUm; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="iugTVsjk"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="R9vuChUm" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 03C7611400D8; Thu, 30 Jan 2025 09:44:19 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Thu, 30 Jan 2025 09:44:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248259; x=1738334659; bh=ebid+RuAPCLE6gF4yLXZxns8LPzVBwigFd19d2sNtns=; b= iugTVsjk6tb5RenqEAvn4pWYicBWYHBYGeKWH3l1TssBnKmsKBFSYO9l/VG26nCS KFcsGJvZwZicD46LWaX8WJ6jibHVmj7WBgesfX+gvBQMlzJE/O88dGq8AIPdkBp2 wPBOVUGCiFOuyH1HViofO4y+Tc+ZCaY61+Ox4HhSvToAdM73CNobF3Y1GdAT5+QG B5dFbiZBXRyd6UpjSRgKJhQ2Xb2HOjbolRYQVHVvMrc4H4xjCCZo0qt8XLFBAtBv +o32pJ0EbzdoA+OX20rzlERELvbmH08qHX/8wCxeiN4d4elVv8ck+ux00F2sOGxR P9PSsDtV4EJ39s9LkYOklA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248259; x= 1738334659; bh=ebid+RuAPCLE6gF4yLXZxns8LPzVBwigFd19d2sNtns=; b=R 9vuChUm4En8/5z9JlR0rcDgKxqKByOHYtE4wAEiLVZIVOSN6pHQK5GRLuthyAnm1 5pl7vK6jVQ23Ru2K4EkRIBDsk7I1lfVUWh1YaKi7AT3QSXwSzcL6N7SsF78D0s38 LshrEFXMeyVB8HWuKOKeT6wOjt3nsPkg9T+gFH7q/XTdI0opVHTdxceJnjnDKNiH wVXxoMjNJUM+M6XmHGRS1ItPxqbm+d9tQMRN8Jo4XCbHYJJEJQsTcrq2H5HxZTI5 POlKsHdm+mWQvKI7IGzuQ1Q+lhc9wq1V0iBY7uIFjmns3b7ktleaDQKv7Cv5W0cb JktnOJl/P+gpJa3iI//iA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:18 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id dfb5d749 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:17 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:44:02 +0100 Subject: [PATCH v2 10/13] meson: prevent finding sed(1) in a loop Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-10-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 We're searching for the sed(1) executable in a loop, which will make us try to find it multiple times. Starting with the preceding commit we already declare a variable for that program in the top-level build file. Use it so that we only need to search for the program once. Signed-off-by: Patrick Steinhardt --- Documentation/howto/meson.build | 2 +- meson.build | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/howto/meson.build b/Documentation/howto/meson.build index c023c10416..92a08b13ee 100644 --- a/Documentation/howto/meson.build +++ b/Documentation/howto/meson.build @@ -41,7 +41,7 @@ custom_target( foreach howto : howto_sources howto_stripped = custom_target( command: [ - find_program('sed'), + sed, '-e', '1,/^$/d', '@INPUT@', diff --git a/meson.build b/meson.build index 7180fd58fd..b5e8aca288 100644 --- a/meson.build +++ b/meson.build @@ -201,11 +201,12 @@ endif cygpath = find_program('cygpath', dirs: program_path, required: false) diff = find_program('diff', dirs: program_path) git = find_program('git', dirs: program_path, required: false) +sed = find_program('sed', dirs: program_path) shell = find_program('sh', dirs: program_path) tar = find_program('tar', dirs: program_path) # Sanity-check that programs required for the build exist. -foreach tool : ['cat', 'cut', 'grep', 'sed', 'sort', 'tr', 'uname'] +foreach tool : ['cat', 'cut', 'grep', 'sort', 'tr', 'uname'] find_program(tool, dirs: program_path) endforeach From patchwork Thu Jan 30 14:44:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954679 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9B261EC017 for ; Thu, 30 Jan 2025 14:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248262; cv=none; b=J0+msk2MXhyoYOffcMiOO+Ls0pq9wZiOeAZVOqEZLYpDUEynfqgy1+RchCUR/QIO19ukeF2S91B1UXuTeGnyESRWRU5GWHKmFeuM+60MirzF1THCf+jbpKY0XXEFuk+eVqMbhuhMc8KZy7uaYT9QI14B+osMu6J2sWoBqbsF3dg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248262; c=relaxed/simple; bh=h3v9Ybb1s9qqSd+wwu0XTDTls7whNjHDwCKxmgF/XUc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fbzOuSkkO9mKriV8r/FcRFGzLSguwLLW+r32leYiZPzuBuVCildnwNHVA3BKq54gYjsduPtIMYeIPgsPy27eisC1rI2KdLPVRoIbau6dBNJRe/dN78Mp4k27ZiyOh7kiVkvFKkpQTn21+nHPgABEfw9ARL9N8fGjHsC2eLok6/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=mmkvp3xk; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=po0KG5rz; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="mmkvp3xk"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="po0KG5rz" Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 16DAD1140108; Thu, 30 Jan 2025 09:44:20 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Thu, 30 Jan 2025 09:44:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248260; x=1738334660; bh=UsfhuRZbMzYB+Tu2+b7MOT+3T6OtqOH6ptlD5cLlBG8=; b= mmkvp3xkmCiXcQC9hAJO9p6l0+otpnafbB7WKt7H40W/R+Jv0DInqplk+Jmo+lU1 HLA8kzQQHSVCRvTGXq5n3OxCdH1GHJjrGEy+d89a+kj8oGZLxYuHJxu4dBuQ2Aww am499flBXaydFmBFz4RAZ8izAA6o/mZcHs3gNbyaDIjQ3Zh17JhmmeC7y674935+ +x+Vau9+B0IaQ0ZUiKrD8EEMfOhS+G4N0LTnIN432Eto8jZG9J8MmGZXH5G5m3k5 8rbmMtJyZ1OuPdcAmM09alJZR6aALHOyYucwDkrFoAocQU1YY8GRYU9/VCIrIxSc ptdUHRQBD/7M4pAXDrDEwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248260; x= 1738334660; bh=UsfhuRZbMzYB+Tu2+b7MOT+3T6OtqOH6ptlD5cLlBG8=; b=p o0KG5rzaZ9ql97ERQ0PIftVkKMhW6qLs01WY8sW/3w1/n7MqweuE4PtLzc5zdChK +vM3+Ef+txJhI35k/ldFwhKNxI6vyITmxd8SaUnFtt5AnzIAWibN7wTCTe5wPEM9 BjKL03tZBmeGzaz6k7Su6FvM3wuYJsO2jfIHKiDD/I7I5P//CnxGpdWvfNn1xqub YhL2VQeGWMH8Gy0R2+sWZL1R8Cgp9Uw2xwg0vI/x9DXTGK28SGzQuBbd0rWm59ri qJA6ykkGqnwOqNBoH4khMH0ppZsRDkOujuTyyUWrbsrQhBvIFk5+Bo7ebW2Vt+9t X4xJeNbGJgnbIBY/gKc1w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtghomhdprh gtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:19 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 302e2a91 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:18 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:44:03 +0100 Subject: [PATCH v2 11/13] meson: fix overwritten `git` variable Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-11-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 We're assigning the `git` variable in three places: - In "meson.build" to store the external Git executable. - In "meson.build" to store the compiled Git executable. - In "Documentation/meson.build" to store the external Git executable, a second time. The last case is only needed because we overwrite the original variable with the built version. Rename the variable used for the built Git executable so that we don't have to resolve the external Git executable multiple times. Signed-off-by: Patrick Steinhardt --- Documentation/meson.build | 1 - meson.build | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Documentation/meson.build b/Documentation/meson.build index 2a26fa8a5f..6438fa6792 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -283,7 +283,6 @@ elif docs_backend == 'asciidoctor' ] endif -git = find_program('git', required: false) xmlto = find_program('xmlto') cmd_lists = [ diff --git a/meson.build b/meson.build index b5e8aca288..cf3f0d59d5 100644 --- a/meson.build +++ b/meson.build @@ -1605,13 +1605,13 @@ libgit_commonmain = declare_dependency( bin_wrappers = [ ] test_dependencies = [ ] -git = executable('git', +git_builtin = executable('git', sources: builtin_sources + 'git.c', dependencies: [libgit_commonmain], install: true, install_dir: get_option('libexecdir') / 'git-core', ) -bin_wrappers += git +bin_wrappers += git_builtin test_dependencies += executable('git-daemon', sources: 'daemon.c', @@ -1702,7 +1702,7 @@ test_dependencies += executable('git-imap-send', foreach alias : [ 'git-receive-pack', 'git-upload-archive', 'git-upload-pack' ] bin_wrappers += executable(alias, - objects: git.extract_all_objects(recursive: false), + objects: git_builtin.extract_all_objects(recursive: false), dependencies: [libgit], ) From patchwork Thu Jan 30 14:44:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954680 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3C691EE017 for ; Thu, 30 Jan 2025 14:44:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248263; cv=none; b=oGklmbFsiP+pzs7W7Oa8BGj1A95nX5cAx10/8qYKLXRXD3eQu9/8Ltbfx3Nh75dTnOIqEzvJCb/OG8+/YSyWHh2y2QhrzLIldKbE3hRNn56W/lN3BYn5mQtK0h6oGKsyY1F7fhi5u3QyCf5PbLR37Osfpa7i1TM4JUe0DWxlLh8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248263; c=relaxed/simple; bh=vbL2dEi9vlBVe6jJ1DPUFh7hbF8qjYobTxrDVrLmk/4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=i7uAI1bDsUfsIGhj1uNlDnv1gP1tQNHHaEB/LzVeProR+DXQopVsa80Zcz3xF5acpoZr345A8gG2BWr+hrYCw2qfeyAEzfzFv1nc7wdr/+Mzo/ntdNr5JQvgP0jWQxZZzPcPFCMk1+nLNtkU/tpH5EG12s8Ul1ey9yxKJzW/Xp8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=cnpIzgY7; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ZrJRDEn+; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="cnpIzgY7"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZrJRDEn+" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 1CCF11380137; Thu, 30 Jan 2025 09:44:21 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 30 Jan 2025 09:44:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248261; x=1738334661; bh=mgrMs1Uaa+C9N+mTCMn4h+oL04i6sUPJMFx5j2e29rE=; b= cnpIzgY7TUUNQ90uregKBVootdLYWstg9uaDe21isf+BLwVyHVTt4uIFxq5lfGey CzDHH+R85BD73ZpuTPPhzFCdnLWVRpzsvMTbbz/wp5xE6KSlqjTajdB2LOoKbj8P wmreJPad1m2ttZJN4wqhhW8nJ0AWLDAH1W8V8f2EpUMKm0BM3YzWV8nnF4EgjYTw qE6+9UL+GtSALxKMdY1GLMzf6NqccURMvOOHLF1dCM3Z17nZhDq7GNGBgy0d1SHI x83iAV7/QcZy15F6fEWVD8pQ2OZxH+J2cFaHEN43NaK6CJxhCkNUeSkibRXLPLHj nxHouESa//5yxnTbD+O65Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248261; x= 1738334661; bh=mgrMs1Uaa+C9N+mTCMn4h+oL04i6sUPJMFx5j2e29rE=; b=Z rJRDEn+xc8b9Ltf6G0OCRMpHZvUVJBp7fkDJEwL9ekykmZLB6AE+1jAtKgkZ1XkX YvjSRzTQvzi1PvEmg8xLbPu0izKRF1r4FKpKcqOV1HxO8wAlp6qDM+XBDVBRW4sh LCHCQEpj6nNOi/oDUhdQneSYr2vrqki1t95as3JyAUdVvGpG8PDAqQYxc4jVSUxL ts6azifi2z+M/A7MJGmMfMZwng/ox/w1ZoAEH2r6/S3UMfb4VWki/YybHwSi9ip8 OOT40pOV4QVyqzzUCOp6h0E2ZJAxeGAJnZZT2yoArPzQUKIGJ0g+eX+1i0ueeaT/ gjVNTamlPcYOaaDC3nR6w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtghomhdprh gtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:20 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 5c0c10e0 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:19 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:44:04 +0100 Subject: [PATCH v2 12/13] meson: consistently use custom program paths to resolve programs Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-12-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 The calls to `find_program()` in our documentation don't use our custom program path. This variable gets populated on Windows with the location of Git for Windows so that we can use it to provide our build tools. Consequently, we may not be able to find all necessary binaries on Windows. Adapt the calls to use the program path to fix this. While at it, drop `required: true` arguments, which are the default anyway. Signed-off-by: Patrick Steinhardt --- Documentation/meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/meson.build b/Documentation/meson.build index 6438fa6792..c6117366ff 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -206,9 +206,9 @@ manpages = { docs_backend = get_option('docs_backend') if docs_backend == 'auto' - if find_program('asciidoc', required: false).found() + if find_program('asciidoc', dirs: program_path, required: false).found() docs_backend = 'asciidoc' - elif find_program('asciidoctor', required: false).found() + elif find_program('asciidoctor', dirs: program_path, required: false).found() docs_backend = 'asciidoctor' else error('Neither asciidoc nor asciidoctor were found.') @@ -216,7 +216,7 @@ if docs_backend == 'auto' endif if docs_backend == 'asciidoc' - asciidoc = find_program('asciidoc', required: true) + asciidoc = find_program('asciidoc', dirs: program_path) asciidoc_html = 'xhtml11' asciidoc_docbook = 'docbook' xmlto_extra = [ ] @@ -245,7 +245,7 @@ if docs_backend == 'asciidoc' asciidoc_conf, ] elif docs_backend == 'asciidoctor' - asciidoctor = find_program('asciidoctor', required: true) + asciidoctor = find_program('asciidoctor', dirs: program_path) asciidoc_html = 'xhtml5' asciidoc_docbook = 'docbook5' xmlto_extra = [ @@ -283,7 +283,7 @@ elif docs_backend == 'asciidoctor' ] endif -xmlto = find_program('xmlto') +xmlto = find_program('xmlto', dirs: program_path) cmd_lists = [ 'cmds-ancillaryinterrogators.txt', @@ -404,7 +404,7 @@ if get_option('docs').contains('html') pointing_to: 'git.html', ) - xsltproc = find_program('xsltproc') + xsltproc = find_program('xsltproc', dirs: program_path) user_manual_xml = custom_target( command: asciidoc_common_options + [ From patchwork Thu Jan 30 14:44:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13954681 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07BED1EBFE6 for ; Thu, 30 Jan 2025 14:44:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248264; cv=none; b=meiXPtFO9GDsnLuOw+hl4bGBUyP9cKjtvx4YIJq6XDCMKv1RiOnJjvZSNV2sph9Dvu5jz4st3Bnfp1eYj6CG7uYFV65yTDh72KOR7qqBaX/9ymD36McYUjYDYfRNIfCKcay8c90y5yKqyQ+LaMiwQ5+9xHCoHABBLNb5hA8Jxbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738248264; c=relaxed/simple; bh=2OwugQwWEOo0sABALL1aqT5jCo8XPdhzwmyVvP/XlNk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZhMBzqhUBSZIn/dxRByiKn5MO+e5XqMlj8SDanOW8tve0ffizIdC+SZXA1HP2iLdo2r5jW2HOrnpAjX0HxFxDjuf8Q1JqaM4lQzOKmoC4I6NgWiMkUbwubHhCfojyaDzt8acvHBMJXMXca/khJ5LtrzdjHkPF8Q/pHZJ8oX586A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=erxHGN97; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=lXRFWwbY; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="erxHGN97"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="lXRFWwbY" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 1934311400E1; Thu, 30 Jan 2025 09:44:22 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Thu, 30 Jan 2025 09:44:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738248262; x=1738334662; bh=XdM7u/BgsxMzFUb72ZQhr4zRNztnViQv6tuZvmDM6D4=; b= erxHGN973YMCb7YNvUMBnKb+Ipn7RgG3w5P7PzJPq6fJ5mOO0mxtO/s16ZWkbnMB YsFMdxjPkNCStO20goRjJyVeC3CNimi5tq6sDG3uX3xTmS5OxEx5lf0xMqQOLAfv smeqSPhOriw2AR9CGiaIEIznC1kYoHSP0MgwYXHUmz5HgTlSk0dMY5KiIoDp+3ar aqmG/Oi9McOe3rkQF4pl3/EtkP2RiyI9L44cTrWmztgE09w5pCr6i12Qf7/UBDIT Rt6Wnrh/c4VOrr8ETXOIHPXol5m1Or2xfnrj2rV3rwxHV7T9k/Bbqi/zuv3OROtg ZepydabkXqe6kyG2HuEOLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738248262; x= 1738334662; bh=XdM7u/BgsxMzFUb72ZQhr4zRNztnViQv6tuZvmDM6D4=; b=l XRFWwbYcaXYxEOhkDd/nDVnZPOEEmjE1cX9vIdsRqOa6EHrCNeLiCrBjuvDWbzNP nZjpZYr/iPMTGRq//b2hFzthwxWyQNB7dHJ0tvUeEs57M7jElYv2FFc+Q+68IxD6 uqs2hw7+X9zHmOqUdpmIYH4D504nfC9VUieMaveCZZLtqdYwJMkIpgNelEpt5m4D 5De7NF4IHbazbYazldZr+KY5lU65W6wjTVJrKXiXsJPXa0ung5zkdLQOoZ8VOHZ0 3Vki4Sm6VPJu4W5YAvWs4ivkvz6Ydh6Lf4GYEHHpV8czcyMz3bl1FBefsfy/VDtE govWxLOzLTRsK3Ne02lLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Jan 2025 09:44:21 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 6c34759b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jan 2025 14:44:20 +0000 (UTC) From: Patrick Steinhardt Date: Thu, 30 Jan 2025 15:44:05 +0100 Subject: [PATCH v2 13/13] gitlab-ci: restrict maximum number of link jobs on Windows Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250130-b4-pks-meson-improvements-v2-13-2f05581ffb44@pks.im> References: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> In-Reply-To: <20250130-b4-pks-meson-improvements-v2-0-2f05581ffb44@pks.im> To: git@vger.kernel.org Cc: Justin Tobler X-Mailer: b4 0.14.2 The hosted Windows runners on GitLab.com only have 7.5GB of RAM. Given that "link.exe" provided by Microsoft Visual Studio is multi-threaded by itself already and thus quite memory hungry this can quickly lead to memory starvation, out-of-memory situations and thus failed CI jobs. Fix the issue by limiting the number of concurrent linker jobs. The same issue hasn't been observed on GitHub Actions yet, probably because it got more than twice the amount of RAM with 16GB. Signed-off-by: Patrick Steinhardt --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4976e18a05..7e1cecc6a7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -169,7 +169,7 @@ build:msvc-meson: extends: .msvc-meson stage: build script: - - meson setup build -Dperl=disabled + - meson setup build -Dperl=disabled -Dbackend_max_links=1 - meson compile -C build artifacts: paths: