From patchwork Wed Feb 26 08:22:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991739 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 D76AD610D for ; Wed, 26 Feb 2025 08:22:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558146; cv=none; b=BUNOvFXZBNgJEpUKxSSNl5hDyztV/N4x4AeFtxxh1/qaxBckzXNiFuA4Qs2oP3Cf3AoX26SoD7L0OlTdgYEuUa1eLTQ+g0DJcsq2JqgV7uvzsYokfHMMXjbRA+afkD1GzML4ahiB9uOEonmkBLdfOzAfVHSCiouWLD+MDiSLozk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558146; c=relaxed/simple; bh=YlpBnpmeIR6Z8JCoG+exK96Cj6R1kyIMJoq2TPWJ5fQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NTB8UPpjbHaOWnDSEkkGzTYjMweRwgDK3fRsjMKkVSGtuBd2T7GrKkgQ/+7HfIe+wNkwAiXyESj7GWPWeB4eKbjZORpLUW/njeqL1BSNUGvzu3Dm3wwr24ND3uBL1eZup3ia6yKtdhMtaM/JKBX2XWh5SQIm0Jcx+PQCp+GYvXw= 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=fbPNWRsg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=TyxvWGRP; arc=none smtp.client-ip=103.168.172.149 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="fbPNWRsg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="TyxvWGRP" Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id D63DA1380EC0; Wed, 26 Feb 2025 03:22:23 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Wed, 26 Feb 2025 03:22:23 -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=fm1; t=1740558143; x=1740644543; bh=KfLn9AroK6CohnB+V/MFpm0q9r74UaYocgHQW5zpenA=; b= fbPNWRsgJGlGrQAATJ488VOZGGO4fva+ThWPonbG/5R15FZtWSs53J7xL01TRecC 24WvkjCThPYHjrnd0+JO653DJS2wXKFwQ4Tfor/plPknuX0QC4B/O1pgswa1wHym NcLeI8Q8K9JGLXrDTzrtAomEB1YhlIs+mei60VEcwK1Bw6h59nfdVK0nMZy5/Bww oc0d/Ima1l/t2OhVu/RPw49icaJ7XI4WC5+bv4ml1P7bTdyjH/aytLvxkmU6T+ng pDrFVgYbhb5fmX4EIdTVtBHsKgojja0eybdvdGwyBD0thJcduoTVbv3Nb8Ee23kp lMiE2yrVSQGGctTpIt+jcg== 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=fm1; t=1740558143; x= 1740644543; bh=KfLn9AroK6CohnB+V/MFpm0q9r74UaYocgHQW5zpenA=; b=T yxvWGRPOJvR+UZnAcCBbuYY243iBm54rkEn/8L8ojXKFpVuvFTQV2BEtliCZqDd3 GtRftGLP2AsZhIQaOAtKnO2Ao6nKR6paCjZdItc33a4mP/Xxwcy90L8eEEemUPJV 88qyjMBXvJ16hLBhQbvmmC8wsFTaGj3s0FCvnSuWRdUO78lZQQTatIx68aXwW5Ts 5uLq5pjW5JTFaEyi474jiDf/wIERxw1287BueJSVexAILEPBHbMO5UqfBPKiYYIV 1t9OaSkRyUCzY8JbiTdTN1V4H29o9+opSVbTu7alo1ksRZokT+6+EEyDDkhAft8J TL0rJwaDLy2n064vQYQxw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrgh dprhgtphhtthhopehtohhonhesihhothgtlhdrtghomhdprhgtphhtthhopehgihhtshht vghrsehpohgsohigrdgtohhmpdhrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:22 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 5bbed647 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:20 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:11 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-1-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 dbc1dab605e..1f83dc58c24 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 Wed Feb 26 08:22:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991744 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (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 17118189B94 for ; Wed, 26 Feb 2025 08:22:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558149; cv=none; b=tIhpN1+lAUI0Vzc/nl0CsyWjoJmzPJ2udR/Rq9dJiSaGYcbEHqGtXwHmnDgpXdRoLH+UuI8MwzvKT9YGMCUaIGnZ0CVnFtK/gUMMX/k1wYywdKGePYnn5VEoorKwfRT5hM/S/IpAK0tHZ61buANUm4SQwwXlyJd6x3Ge0/VN9NA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558149; c=relaxed/simple; bh=QwHX4kzniNWQHSS0nscvYUH0MGPn5K8/wKtmXPChiFM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ki/gX0LmWtRYXK84JbSMVYV6HgnS4WiCyD+RbSLkSJ4tZiWJtNPM07SwWEIkwZAt/fpYqMonpVkZ2IZc2qtAX5xDRG/RWJ+8og7+B4ZD7hG//LTcqwUoLQey3Ih3lS37tzwwTSGhvBpypv/sPGUOzqXoa5aIZum3Nw2sC7M2N6g= 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=DW+P8d79; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=yDKLWpEe; arc=none smtp.client-ip=103.168.172.152 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="DW+P8d79"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="yDKLWpEe" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 24AA611400A0; Wed, 26 Feb 2025 03:22:25 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 26 Feb 2025 03:22:25 -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=fm1; t=1740558145; x=1740644545; bh=LTHF9Z0vbSMnEjrJXlCTNsdjP2O81MfdlYn7sXKZfJ0=; b= DW+P8d79kg1nT2+fqtTcX9SFyybHTFZfvmGdT2rfn+GHOjzdvn3/jMcyH1lqEcsc 5LCsSWT4ZujSq7MRI2T380lLD+z2xryWXjcV7xipOSrQ8kg83n7uAhYL40tH8ib9 rHZq28Ni899I9EOFK1xppz4YjGvmoG8j+u2GFsY8CoFHX7YpUmuoqpJE6HPBBj8g Wdnn7YOGaJNhlBQ5o0x+S/doa9mC47mAsgpJevsUhlTGW0D/BN4tq3lrxjQBlgRR eW7UXU1NrAC/3dpP36XBqvdHsE7Q+49veTbiHqWp7X8PlsSIJ/yjA+cHU9qxbekU I3X/KNBjf0VpJHyL5c6nJA== 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=fm1; t=1740558145; x= 1740644545; bh=LTHF9Z0vbSMnEjrJXlCTNsdjP2O81MfdlYn7sXKZfJ0=; b=y DKLWpEeFyq7pBB2kpT8eNxG7WMGC2IYqRl068iDqObfg0kj+0/hdSN33/RpFKWDE B9YfZhLfAAq/F6Up04JB+Eg0ohPktMviiTso9k1pKfM64ikapn6H8weFCntk28MA GTFrxrdUnbwVosW/bean7B6QcXnUN9IdtbZHSxWGCs7EmiC4PvkW/zt0Vwc13UnQ SzgdxXBudEdtiR7pm+w+SwgAbCOVaCNWyyBzXAElBzL04rruecVzctNdUI53ztoc CozPXoS/SwIJjc1LSTBIQShXn8uXmpAs+RANDfEoBU1tHGnPk5RGgq2A7hO+W9b3 zlkL2T5wlRbRYQZwgpNWQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepgeegudehhfejveeujeeftddtjefhleffhefgfeel gffgfeehudegieffvdffueegnecuffhomhgrihhnpehpkhhsrdhimhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhn sggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehtohhonh esihhothgtlhdrtghomhdprhgtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtgho mhdprhgtphhtthhopehgihhtshhtvghrsehpohgsohigrdgtohhmpdhrtghpthhtohepgh hithesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:23 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id c5d2b67b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:21 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:12 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-2-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 1f83dc58c24..83ed55c75c6 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 Wed Feb 26 08:22:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991741 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (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 170C9664C6 for ; Wed, 26 Feb 2025 08:22:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558147; cv=none; b=C+bbvlz4L6a8S2GMFUzPMlhOr04j/3ybzx4ZyaFm7FQzFoPOCrTvGdTn+78VETnhmZeeVju04wn28/yLouFdbNQRI+lDkzy3QL8rO5cTIjUDFr6eYBGxcz7Zhq+kXieAMfGHyfbRz6TpfsdWUO4dalipLLRVJRLi9DtKVAST4Zg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558147; c=relaxed/simple; bh=dmcJUeWJAgDzjmjEXlwfN1ELTMRyinqvplrwOzKCflA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BrFbttq/VgxdTu0I/lbcvWtcQre1mPzurFWH7EiWnoPXPci1mtZnGdkb9fKQZ/+xy5OHLnkBhXcmnnBBcNcSbGhMZM+eCsXVdTVrYwfH/JLWYL34LjHviv5pzonuaK5nu7YdFoyYGxq7MsbYZVcb82NVpxH/YjXXldRGoWscNsU= 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=jWiRRTDm; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=OwAitCh4; arc=none smtp.client-ip=103.168.172.152 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="jWiRRTDm"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OwAitCh4" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 429971140177; Wed, 26 Feb 2025 03:22:25 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Wed, 26 Feb 2025 03:22:25 -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=fm1; t=1740558145; x=1740644545; bh=3Q398hCCOL88eRUISzwy8Wd0OsAoQHJTp+xdpnbPkXY=; b= jWiRRTDmW4gIQKZjWuSY1Q+Koi+2q0hdz1IgWDKovnpyzJg1y1CIfXPsPDcNhS7Z g3oEClCG2eYaku/W2VRwPErfDmh8NRUY4OyYDdYWaoUQMc5ZXJoh2eZbkTN5JrsJ rpz2XW0nyn2it5nZWwM7Lf5zPWR7gpBzAndZJfSE+sKuQrRY3POVdCUgaDXehCF1 PjOmbLSzGszlTpwmV/Gxr87yylYW4PcnsmC1jwVSWQA2Vk5KXCyWq3mfsJE0rcdq FnEciZ89UcRXmytsUBSr01LDxiJsuGrmJ/i8JYKzFfL7bfJpuB3Un0PPUZ5ttCXB G1X6nVq9jwJ4nq1SM+mUIw== 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=fm1; t=1740558145; x= 1740644545; bh=3Q398hCCOL88eRUISzwy8Wd0OsAoQHJTp+xdpnbPkXY=; b=O wAitCh46M56SH/MSCEfvVb6zDmbnkpaPNUoBMV+4HY/r/5s0WdcGBTQ3HCTOC5tr fP+evmGz5el//+rX2WINUFD/M7v63GKfB6XTUzpThhZEZZHT22qLveKrfx8XTjej orgEBHvRfxty+JKN2xB5TCiaztz1DKH6uZrpj5LOcHRdYJQszxUMWVj/v6iMY92p tfIKteRzQ+znmIZnvcO5BiVVBlEOKfnIcHYiegz7VJevXNaTXWsVPlK3uE0gjhkb 7ZZrEweYnSRFvhnATQ+LPnfAcJz/u6X2d2r0/q0ev8wOqvigAOEej+YcNkDtGoq9 MELZJmnUv3TESUtkLdALA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomhdprh gtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhl thhosghlvghrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhoohhnsehiohhttghlrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:24 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 968ab422 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:22 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:13 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-3-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 83ed55c75c6..a124101a73a 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 Wed Feb 26 08:22:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991742 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (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 4C8BB1E1DE6 for ; Wed, 26 Feb 2025 08:22:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558149; cv=none; b=V3G+Tdh14NJZZwO90wpMdwy9DCjWh8LssjDIx+Kqio5KuR7c4H0lGX3pMMU7+LKBhU4tkYErYhYbTIqEl40ISaVonqhVk3rr3TyYuzggJbrf9slHmlAVrftyVcZlwKaktRQi1bRplBjW2Rg0mpzJqXAZNJG04NA9zzkMyycmE1A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558149; c=relaxed/simple; bh=AbFJUDrQ/dMPnNA4WLEF3GVDqYvGgG6SYyorl0MywlQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EAJNEk/k0jGmRPgNQuimOpRsKW+Ro1JzGk4gzalxwHbpWRBWV4kc+GqjO3yrXAv32NJLrQfJwzDRAGn2GCqNGuVgDNEDKyfZ5uZ814BL/P6OSUYXGk3d6Q6bckuUhbi2JoI1mlwudNfJD9BJu1fwclZEacdc+FelpvZrkpzPhQ4= 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=cz06C+C2; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=djobQ99+; arc=none smtp.client-ip=103.168.172.152 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="cz06C+C2"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="djobQ99+" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 65241114016D; Wed, 26 Feb 2025 03:22:26 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 26 Feb 2025 03:22:26 -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=fm1; t=1740558146; x=1740644546; bh=/jRos6dh9ZOHDsDYhHA+L9CyFlhqcIZPddzM0tu+xsM=; b= cz06C+C2KdigIoIC6Pray9LTPqXr/Tcn7tR6wrOZ85F/Z/lYg/t29zhxDnLal1t0 Et6SKWn2BUM6vQ5/jV81i7RADPMu3dlqGDX+l6SvjIgeZmjLN9wuSzgsCZqDlMqH nW9xLExFM0PzH/75grgVr/eG39pb2//AC/D09cYAuQLxJFBtB01so0AwlI+xgR3H Gcgn+zNsansnfvHbU8YL+RtlndKcR7NJRLlJpYO77M8gEvfVTD222WR3J7LRrerc dk9vpc8oJqEMoDUSKl8eglkZNgSIK8zSkG9ObrC1+IX5mpcguvakM4ohumvIfLH3 oH3YyTnIRZatr8emIuye7w== 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=fm1; t=1740558146; x= 1740644546; bh=/jRos6dh9ZOHDsDYhHA+L9CyFlhqcIZPddzM0tu+xsM=; b=d jobQ99+iMvQZ4ZvsU1VEIhn7+I1f6Gs4W8h2+MVM2b2T6YtNtoJIutzAUMNjs5VQ 30mcZBQtQy9dVPEywUyED9jrGaxVNyTrqcKKT+pdOJkGQ9wf1WmxzDJF6x4fxhQN RvIvhxT8YYq8uAoaZvXRlM63YVMM76IKYIQJsogj5iDn5ztHi3mDwx7MtQnRpGxW MyGynvqCqKCm3yEupVxDwn+I3CmcqTO9rzhju2rCMBkL55a+10LC+sYeADJhdg3Z OUBlyrN+iSkqpQ27bxOtdaDo70z27nJMde97bVabK6YihCUugJy1j8zTtOZyg0CW tACSYOjqNw3UPsyTIqqnQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrgh dprhgtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtghomhdprhgtphhtthhopehg ihhtshhtvghrsehpohgsohigrdgtohhmpdhrtghpthhtohepthhoohhnsehiohhttghlrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:25 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id ef8766c3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:23 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:14 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-4-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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. Signed-off-by: Patrick Steinhardt --- meson.build | 39 +++++++++++++++++++-------------------- oss-fuzz/meson.build | 2 +- t/helper/meson.build | 4 ++-- t/meson.build | 4 ++-- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/meson.build b/meson.build index a124101a73a..7236c163374 100644 --- a/meson.build +++ b/meson.build @@ -1604,15 +1604,14 @@ if host_machine.system() == 'windows' error('Unsupported compiler ' + compiler.get_id()) endif endif -common_main_library = static_library('common-main', - 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, + +libgit_commonmain = declare_dependency( + link_with: static_library('common-main', + sources: common_main_sources, + dependencies: [ libgit ], + ), link_args: common_main_link_args, + dependencies: [ libgit ], ) bin_wrappers = [ ] @@ -1620,7 +1619,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 +1627,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 +1668,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 +1676,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 +1684,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 +1693,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_commonmain], ) install_symlink(alias + executable_suffix, @@ -1711,7 +1710,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 +1718,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_commonmain], ) install_symlink(alias + executable_suffix, diff --git a/oss-fuzz/meson.build b/oss-fuzz/meson.build index ed796655016..878afd8426f 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 f502d1aaa36..ae01b3fc45d 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 35f25ca4a1d..dae50601fec 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 Wed Feb 26 08:22:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991743 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 8839F1E1DEB for ; Wed, 26 Feb 2025 08:22:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558149; cv=none; b=B2IDJOgHqRHwLm8Rw5h8u3Za16brMz48xcO8qiIrLzzTUJk+3GOitSSm+X4Y67df+YyAPQc/H4YNP7MgW842Ci9WtgHs6Po6AhsBf6FtZj+fYa5ubSthZDVxE7bWmnbNJCmH5yMf+YYIqqAwqWu55pLHauz+XfLb+roH72NKoTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558149; c=relaxed/simple; bh=xnuJjfCa3utU9sSlx/YK/MSJY/e8f7ElPndf9ILuGJo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UaCZ259sABvrM4A12LFDkqHYpDnrXAVvfgXI7e939a/djHryJBrglYLD7kVciIyf/HzRVtysIOUDfdamAipjytchuUIZ3DMFoGQ5xlzcBlunNPvXpmURcCNYQh4rmm3sHVW1UoxVBUgwaVoP5sGIg8YFOAhG+Y0z4IfFAy109eA= 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=S7SxARlR; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=M7a2wAsw; arc=none smtp.client-ip=103.168.172.149 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="S7SxARlR"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="M7a2wAsw" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 86E9A13809BD; Wed, 26 Feb 2025 03:22:26 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 26 Feb 2025 03:22:26 -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=fm1; t=1740558146; x=1740644546; bh=3z4IgqTtBqy2OCeClMtfezlyNdAQMq/TvAj26yGE4tM=; b= S7SxARlRTgN+CNJx17C0Rat81P2xhl/LSDzkM1QQ/1jtncamKOH7AIk8w8LmdKi5 woqQtQ1ohfByHAKhUKacMVEO8Pg37OK1RuGyP9EdkTbblg7XzvozKqNMP4F4lwlC ch/ZaXt5LU/ccf8Fo+JnwkyXjk/En3DrmgJRqZGJSjGCsS30ffDLPfl8Mlgmo4NT nQoYtH/Nc1nqlOg71s9iXAKhheqIKfP7xPxdrTseuKgHh2D/56PeJJnl8aZzqFMl ZAJqlaXLCXd+sY9YlFNh9YmkVBFdg6nHUFQIhdlm1ITt7xcWUqjx5qIFkmkk8sO8 N/BL2Llk7TYjjbU/uwO0/g== 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=fm1; t=1740558146; x= 1740644546; bh=3z4IgqTtBqy2OCeClMtfezlyNdAQMq/TvAj26yGE4tM=; b=M 7a2wAswqI4c6fI6L86pbSkANEvcef2Y7xQyrpRabyZcoHQcB5Pa0ZO/8vqZOII1P rnCmKTiZjXbnIaSMiUq/Y6O28x5072X1H4orLOyjvortOwJ7PaqUsQVwdS7IG4t8 fmkW8rhZY1mZyN7iESxqCq5Do4hw07VrvqZrpAiGQlAGI/TI0OMgBf21clKPj/NT zcTmV2+rbRXNN/V9bjPeypAB+eDtME7GjmXOD3r5FlUdb1Ts+dSKNp9OCuBu6TDe MroG27TUoayPtd/Lu/p/JuHtnuwaZ4aHYsHMohSv1RJ72ntrWdIV+aFoFsFoC9ZF Jwoc2CUkEI4ukGSNudlhQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepthhoohhnsehiohhttghlrdgtohhmpdhrtghpth htohepghhithhsthgvrhesphhosghogidrtghomhdprhgtphhtthhopehgihhtsehvghgv rhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:25 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 6d188ae9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:24 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:15 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-5-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 7236c163374..e58462ac4fe 100644 --- a/meson.build +++ b/meson.build @@ -1661,30 +1661,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', ) @@ -1692,8 +1694,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_commonmain], + sources: 'remote-curl.c', + dependencies: [libgit_curl], ) install_symlink(alias + executable_suffix, @@ -1703,14 +1705,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 Wed Feb 26 08:22:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991745 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (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 E5C391E1E0E for ; Wed, 26 Feb 2025 08:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558150; cv=none; b=r/bDVfP1+O2x7J95TbyJtF07jNYrSVhib8Pb+jQ7s5PB2oXGDdZgT1g5ioNevS8P4NHsUXuTGeu/KP/GIEIV1WMY2MdDj7ea2/t6dr5d26LwBLEXSDGG0eIRlh7yP/Ab7o4IYzxPPeG+ZBfWftBtMvjXsBntXk0mrSeBgo0hWV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558150; c=relaxed/simple; bh=huwwfqucuDnpzoXtVi8KkWJf4xoiGHpgcBgc8pwmIO4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Keq2hB4LA9y69GYVLQy4oUPjI9ZzAg3ccmie7kOLdvx72Oe1AKd0tcn+C9oRAfJPeGncNs/Gx5ee/Z2YeZko4usaEbCpCXekGxejn2cHV2ZiiFd9KrN75rd7y134YQDsYlEgUD1idGdq94kAWQRwmuMaM2gPDrHk5XsuQLHuDYY= 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=LDJKvwxd; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=FwnjU6Bk; arc=none smtp.client-ip=103.168.172.152 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="LDJKvwxd"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="FwnjU6Bk" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id EB138114017B; Wed, 26 Feb 2025 03:22:27 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 26 Feb 2025 03:22:27 -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=fm1; t=1740558147; x=1740644547; bh=2B1EASh6pkS9IZz/bekjuHF0fxYyL77yTk9T/jkMSeM=; b= LDJKvwxdlJqr7h057LdTWfhVUDfFm+U7m8GelrgQqeMOIbijVqOBN3v3suh9b7oA uJNVcybE9ML5tl1jfBmsvRb6MFFfq9C806J39ZzFg/czH1bwe1XLO8arxU6H5OpG hCQLoiLn5Op6gEF7bU2oP4aA0FfMafscyzGidhrUGSU4Jub63KIXTQNkOMZQBqhI f3zgPz5hkVt1knP5fYuy574uiCnhOVDkd0ZgeLfdbfTkPf09Rr/y0QYtyV1KpPMB QmOyRhKK0oDFHLc+2q8O9KIEt2lfr8avNpSratWiDTxA30EHCXibI7NUL8XRETZY V6M9JZiphniIV3B5g/pxwA== 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=fm1; t=1740558147; x= 1740644547; bh=2B1EASh6pkS9IZz/bekjuHF0fxYyL77yTk9T/jkMSeM=; b=F wnjU6BkVCqUtjojiC/I9J/ZyZTT4EwgndqkEgy1vni8Tf46ckxjxXifDpdJr3FzX iTs46X4+eqiIXOoP36WYfI2MrJbb41CFIiIVdd6GBPBHw36uMcKM+TO14iXzMfis fgq8CwvooOdhFEWsO8De3oaXXth/txkqlmd/zENw+Ko0NJAvFLMNEhUsAbAnqcKY TxAnxPUaNaPlpLIyY28owkb2AKlFJf2nP7t9ybNc0DGZ1BmhoFIZwGEpwhjMQgIv yMSm55NkB4J67Ank7hVu4R/gJaX6dcWtK7lapEMWGgOWA2nVuZO9IlqZ7Fq8WcRA dp1zD3mxbVq7PNwzKFtNw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepthhoohhnsehiohhttghlrdgtohhmpdhrtghpth htohepghhithhsthgvrhesphhosghogidrtghomhdprhgtphhtthhopehgihhtsehvghgv rhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:26 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 366d3a09 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:24 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:16 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-6-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 e58462ac4fe..39d15ee6cb8 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 @@ -1666,7 +1668,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 Wed Feb 26 08:22:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991747 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (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 C36FE258CC0 for ; Wed, 26 Feb 2025 08:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558151; cv=none; b=J6sFhU0axTfujIYJE00/l58yZEttj3fQoArnYCxNYD5h5+cmXHrKT6O5btWgxBWW+jlVxMg3K+v8mPyC4yM8PQT4rMKXorC58sW4RokHgXE7NacYKvC4DFSHF4rpLGhhkSMMvVhXIb90JYMdEsOZDoN1uMdtiTeCX9+WG316a88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558151; c=relaxed/simple; bh=U+zj3IS0h8kcyi3yyqg4nU8QUgo1dgK+2uh1XcD1LTY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DoOc2ihJ8IVa65yo5szwCzLmHirLs1X3JHtODTFNKdD3rxfg7Mgq16f44CDDI6UGBX3pRCgSky0JSb95doMSlcutgyU9Vy52OP8j8d8Ew5JlPEFWoB3iM2b7Ydh0JvfDeaJQTAgYoVVocBk0820ptV8JmhuGdfauhCNkIdT5lIc= 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=oXMv+hps; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=mS+tD+yA; arc=none smtp.client-ip=103.168.172.152 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="oXMv+hps"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="mS+tD+yA" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id E3C3A1140172; Wed, 26 Feb 2025 03:22:27 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Wed, 26 Feb 2025 03:22:27 -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=fm1; t=1740558147; x=1740644547; bh=aoypmvh3stjWKVbFyYJJqj7s1rc0fNfY1j1/BpgrUkY=; b= oXMv+hpsGE9PRMJNRHOvp1t//puQXv7T3nbGw7cGbWUDgzIZp+19qXOeRSgjJPGW OMSNg6+pe6BKXY1KZKJ0NMA8VdajaM+dZjOI+GySdVBpu3QfMnhXczvJ80PTEHva 3fsfyUHdlvb2y+IywxzrWo0NgWsxHarG3PQeD/jnDMx3+QeAQMF95tbg/7E4Iyht SmzaE8US89qTjvmVFoNyTn2JQlfGQSxyrz5Q9wSQqwKRWBUfpRpVj6wwyKDl8o2o jcU+YKCZiNQYSPO13WNOxhEwRIyrn/W+DcqHCyKatsPqWgThnb+nDAA1sp/9tAcn wkhHtbQESRn1gG9MjJq35Q== 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=fm1; t=1740558147; x= 1740644547; bh=aoypmvh3stjWKVbFyYJJqj7s1rc0fNfY1j1/BpgrUkY=; b=m S+tD+yANTIjINs7oFZHbNFSkIHSxL8J2RkzPT1uKOhrNIHTm5F9M8HRPM/Ccrld5 SwtBWWEkquXqmUnxfMwU+OsPajV79VIklVnvjOxkVzQlWi5Ljigr8Y28jAaFAovZ TUBpYv/s4nhEaYOfYCZ7o3/bqffka9DTIj1mnutWpz+i0X3iO1ORMJLKJlFOJMQV Gs5FSmAGy9yX5n5dsP+UhW1vVyRGXPsnw1C6sOSQVRZ9z3O2L6/TQ8EsodIFuCTp IE0LxIof+mlXLfEMpiNVGOL96PCn4qyo+en0Y0TqB5SA8Zjq1lV5Sm85CsU/srvv 23fOTR/1NEcgutVmOaOjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrgh dprhgtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtghomhdprhgtphhtthhopeht ohhonhesihhothgtlhdrtghomhdprhgtphhtthhopehgihhtshhtvghrsehpohgsohigrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:26 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id dae1bc92 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:25 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:17 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-7-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 39d15ee6cb8..c8df19804ae 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 Wed Feb 26 08:22:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991746 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (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 130BB20E001 for ; Wed, 26 Feb 2025 08:22:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558151; cv=none; b=gX1D2Edq+Tpg25fthvHgcmTAT6n00a9ZDyZWkxsZkf0RYAmLtVSem8XXG0HmArwWkk5mPMIeVsWe0MWZZwWRLr8w0SQX7ts1V3tis23Xlz+2ovgqdKtD6UhvBbrhcaf/91xWmUUtyRDFNCNmUan7oHwpgMJgtnZHcqn90GtJRuw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558151; c=relaxed/simple; bh=H1EESVZGGaDAVlCnwr+0PcRcTi0B48t3mB6W0XGLVBc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D9f+HSDB33TtuXNSra0m0jk6YIXduhWxOnMbzaJN0sMFmC2XAtqvMvWkLO43xq+JDs7Rstpabr8N/K32kh8SIu0a4DjsHpELWKGnoy3R89ENOXPmV31N+CpM7AOFskwmHWXKf4JbpCFDZQrDjh+D+2z36M2Rhq4fh/HHUpDGhZg= 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=Bz8iJBTE; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=l2BXurjB; arc=none smtp.client-ip=103.168.172.152 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="Bz8iJBTE"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="l2BXurjB" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3C7521140156; Wed, 26 Feb 2025 03:22:29 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Wed, 26 Feb 2025 03:22:29 -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=fm1; t=1740558149; x=1740644549; bh=C7ee2vt8dLNfn4mjvnsdU0S5MGv29otsIlql2n2iGmU=; b= Bz8iJBTE9GVy6+dRm8VwOUR04dYQjFnB4KjSWvkb2dX0q8q8PqSaeDpmrTlf7Jpr Fx6iVTzSt+zu7o4w96j2cMd6FFw/ETq3T3XywgkPJvysU6hvrX+oyjI6GgVsGvbo F8Q/flv6auGWCB0RQstLkUMIa4yzyuy6R7wn3R+ivk/uyX0Barpi/8xcF0w5nbzP y7lIyZwqL/ifciqrpPHukjCKp8HzejIzhaHMsSTapXaY9GR35ZSQn7QiicbaT125 x80wV7MWuhgLWaPnv6wwlgWSKLR9McLorLsG05eSp/18RPuQ9TzuhLgJz5UcwUAC 2QHDtRqpQk/EnNPxyfajEw== 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=fm1; t=1740558149; x= 1740644549; bh=C7ee2vt8dLNfn4mjvnsdU0S5MGv29otsIlql2n2iGmU=; b=l 2BXurjBN/HvlSCzaHJgufvCnplTm71Kv8Xd9cXo56+kfJeB0S+66Hn1aeqKKQ9EM 6HqOxYUxpxOjzHm8cy1OG1cMapffB2E6GUAJtQmjpPuuK0MizIzGL8sQUuArnebw PuOKBf4nisLRCgaQaRHF+JZeDzxE4UH6RsIrM08iVwMvaMcXI4W4Forh8a+G7lKG GOB8yS6jeqlD7ek0++I+j8Ef66ODn69xDD6hZgjPoLdiqPGgRPQe4+KpMLEpoBB2 LFHG4hwi8z+VEMtRT+mp2vuw5+trUvI3zk205ITEHXuZvkyTv/I4qjm47MGjRbvV RXhANGJebNrLyU9Z8cCAw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomhdprh gtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtghomhdprhgtphhtthhopehgihht sehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepthhoohhnsehiohhttghlrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:28 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 59d4d086 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:26 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:18 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-8-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 c8df19804ae..acd6074b32d 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 Wed Feb 26 08:22:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991748 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 1945F20E018 for ; Wed, 26 Feb 2025 08:22:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558151; cv=none; b=tW9OUw0VlgElCTr1YOFhKvaWGLS6Bygacha6Tcz5pgyOAR9xYojalGQHReKtZ5vNotV/1oxi0pM7ynFNKLsWdKaq/kjKYBzIEXNsEYYloYXImsQM4Y4ZWZM1112GjNG8haGFyEJptxcqh4wvGttFvt+C18+sW1/dfizHEBhkRVQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558151; c=relaxed/simple; bh=Z0bjl1PS90wyXyglAwvnekAEeY2gG9i9EwrGHn8xbe4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=glAPeuQVdAUSlEklvHFdOZdveU2e/7P1uZC4DcDW073W6/03cmH3hg44cwT2YjdpPvy1/kIns6L+xN0PhFXc39OUgn+26a445tQq9j2jajIf6iBJDZzhBZNRwmUKs9pox5PoaStkI32UFl/2vJmcpD9Gv9+x/FgN7WUJRoabc4A= 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=m8Yaj3M7; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=sLW3aLgf; arc=none smtp.client-ip=103.168.172.149 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="m8Yaj3M7"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="sLW3aLgf" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id 2E4BE1380EC2; Wed, 26 Feb 2025 03:22:29 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Wed, 26 Feb 2025 03:22:29 -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=fm1; t=1740558149; x=1740644549; bh=0LUELWD1/WiuXWiZCidqwzufpDVLvFHd/UkEG5oca0w=; b= m8Yaj3M7/lw6/qdqX6jvYqU+YYeUDsYJcp4lEUt6Gx1VipF6T1TcCifJJHxXaBkZ L0Wd+vOUDqJZ7l7N517g5QzU76QWGRWm5eXSZDHpJ6g+26qfsEo6boQ/d30gkc/F D+9K2QGu4xsZw7R2et3t1QLHJkBL10RpBxaQ3+EbLqJj69ZEWVAs7aTQlAnzYPtL 1PlM51WVrnvrsAIIFylUuvuVqlEl1UilIsxe5RXGQd9gPCMo2ML2SfPR4fi/r2X1 dezmsYg1iQ1ESsIXziUh6ruyTIqQGNWB59OtIxvpjz6oielP2z/YN6uy4YacB2aZ RVu3UZvboL48ira4rcPZ5A== 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=fm1; t=1740558149; x= 1740644549; bh=0LUELWD1/WiuXWiZCidqwzufpDVLvFHd/UkEG5oca0w=; b=s LW3aLgfZWIhw2Ai7+fihuqA3yTy1ChSDsctu74qgl6p1bN7RaCNJ4jtQMOzel0Ie p1Lsbmxqw90jSxvxPZ03D5eia5w1BRhYwxktaN4pZOD/z4tSlhmxJjQvRWAq0c9z 2Ea/BmOFMDbpWuRIv7jbXjZijjBZyYAQmoR2G38EvbANdPEibURq4QXXV/2opPyK favo0DXA1FKFRRUzGCwpBHG0e6nlZ5YPztsxxje6uqzi4OMeU3n1otOitav0Zqgt Aooj68ASJ+WzhLNWsX/IiyImp9fUDo11QVlQVC/ZPGj0OVvBOqWREvMk1cHpQA4m tVbBfBM2bksN9bUL5ZRkg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrdgtohhmpd hrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeht ohhonhesihhothgtlhdrtghomhdprhgtphhtthhopehgihhtshhtvghrsehpohgsohigrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:28 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id a1135524 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:27 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:19 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-9-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 acd6074b32d..ed857aaa4ab 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 c102185ed5e..e0e8089891b 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 Wed Feb 26 08:22:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991749 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 816CC22422D for ; Wed, 26 Feb 2025 08:22:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558152; cv=none; b=bfhNhEo4nPP13mReUPHm4VlsntOjgvlbwzugZ/GeFfJ3OX0g292NgoFtIDdioZKr+YmKSA7n6p313Wris26O8dJ4+hweLYzLSunivGnm3RhWZaMOYncDOYL6I4qXbpzCLR6d7R8gHOafhyXNjSP8RIsJmsD4D3StwweYG4O2fEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558152; c=relaxed/simple; bh=l0JfGCgysPnwb9WEjz8ksarcYX6MoxZEHd2Md1lXCxw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VnLPaGtNiuJsXHpopJ9ZP5jNRDLqx8M5e4Ktt2QkjEV9XFhN6Od3CUcwHlYJgxceAmV6DGoYMsDGLjXxUVnhnYPsmLHtOaCLx398nO3DM/xMRUqJU0zRq6oK1DkReZi4hw+E0KMuZWt1VqThiWJtEcB5BSs095G79fXg/PHgj4U= 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=SAeF/fG2; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=LOdIwaT2; arc=none smtp.client-ip=103.168.172.149 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="SAeF/fG2"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="LOdIwaT2" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 7601A13809BE; Wed, 26 Feb 2025 03:22:30 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 26 Feb 2025 03:22:30 -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=fm1; t=1740558150; x=1740644550; bh=OMROB30hlwCPumhd8bLa08e7HVBlOAAz9vhS5XTJI5o=; b= SAeF/fG2QfldK5s9capp84s7pnAFa7qQVUEbmJtrNCPg4LpDElaIiyTidTm4pDkg lPjNL6j4/yJLmedojILro7PU5Z5yOEgYibYpH06TOFG4+zzwC53loxUXW0VLBzKo ONyvuMTBnQkTEfUGGmEWw70pBAtoHj8pjV4CDJcLkKA5mif47fHY35lJf/uKlg4F JwVa3pk6d/Ne1XPSq2DjvB7Jqt9f7s/NzRtUmvrLMNkGqoDuoW6g18SI1/LZRxqS 37YVVKvRs5LBQ2oHDP6InygluEbO1CDQCZV49szIX9NhzML9+whHpQ4kTGUWhzLi PuNB53LZ0BDpLLzP7OZsUg== 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=fm1; t=1740558150; x= 1740644550; bh=OMROB30hlwCPumhd8bLa08e7HVBlOAAz9vhS5XTJI5o=; b=L OdIwaT2MRXWe4SMXWehwpLojSfhVcLHIPmWPvK/MoXoeXQ9Z1hU6tClnBe4YU37N c8W/1DWtspF+f/ayN+Paih9na/VdVeZPAxcxyDEkSDhsifmYJ1toDkJNthK0kco0 xL0tARGxssDYgRfApB/r6X2K6xEVrLsgGmbKxK7wkdkIXWiErSa0EKAzabFZsKRx vKazQTu2tkyZEmfys2ggAni3Ac8D8Q9NLxdFWBigtJp4lvbzinbjYHQH58rSfx1a JGSypvDaPCtkdmwjfdDawoEJO5zFhBRVA2xagmHpQXfIqhq1+FV/uM4JIGJurHK/ Io6H5RGINjSjAMlGag1ag== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrgh dprhgtphhtthhopehjlhhtohgslhgvrhesghhmrghilhdrtghomhdprhgtphhtthhopehg ihhtshhtvghrsehpohgsohigrdgtohhmpdhrtghpthhtohepthhoohhnsehiohhttghlrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:29 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id e8ef56f3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:28 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:20 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-10-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 c023c104161..92a08b13eed 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 ed857aaa4ab..5bf6a914ead 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 Wed Feb 26 08:22:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991751 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (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 C1A771E1DE4 for ; Wed, 26 Feb 2025 08:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558156; cv=none; b=IVt2JTY2DVCn3Ge4gI4ogjMgvs+jmW0er/Fjb8ZlhcByjy5gBBMu5t9e0Md+9NNKeGF3VaXsqNQiIwu6OLT/As7lKnxotUInQpw0K5Appr8ptPPZKm/Z7+8chp3h8y859tiZAzgHgKkkDZIrBZy0M249HXOz+F0YaZrgyfmjlt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558156; c=relaxed/simple; bh=MJQLhUSeF2i+8Vum3qreFYWAvSEOoRKi5SxCMayUlmk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Eo1ZYIb27pKoxxgbWY9xOAEPdv3QCqRMGxWqDTIeuWiNAgcNkRFFkDedqJUSoPUE0qN2R5KOP3Tq5HUMvgQl6HEPyoL3Umlbk8GiAMtjDAI9LHWAhewp+IX8yy7p1pm0k44Iehk+KFvTK5ESpypXeDrtSdHu7u6P0zUxdMz5Xqg= 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=XzmS9XCw; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=lBx4OrHy; arc=none smtp.client-ip=103.168.172.152 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="XzmS9XCw"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="lBx4OrHy" Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id C41B6114017C; Wed, 26 Feb 2025 03:22:31 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Wed, 26 Feb 2025 03:22:31 -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=fm1; t=1740558151; x=1740644551; bh=JQq0daYORmQAkuzYSPgAFzgo3PoNmiTkYIaUzIDbPJU=; b= XzmS9XCwr0l4oQm9+Bert5PWcQmAuI8yux+3n2lO5852yjoHqORkDoDTeIwk54Jl gnr6AJwxkDDwuwbTnoOnewRm/AycyRdtxpJSVpiZgD9avxSkbJ3wFbs4ETnceyYg hHN0IEL07e76Ovvjo+JMoSJlE3ufqgoVk26Em7j7F+fGj0AL/OBNvlkq2HhJC3SE H8bTv+PyjK/XV+3aNe56G0HAb0o9L/mFl27k01cIjSQQcxRllmEkt600TTmNorsb 2wBCsRSKWkcUmV2IELs1fkXynSvzx+23xCvJ2OVaXHQG+GN+aWi7l2fOhPufoEFn Ut64v5NxwPZbt/w1BALaOA== 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=fm1; t=1740558151; x= 1740644551; bh=JQq0daYORmQAkuzYSPgAFzgo3PoNmiTkYIaUzIDbPJU=; b=l Bx4OrHy0UrQDpHiYI0VRzU65Ujv6hPfd5l3eD8vFkA8ShsY6Sb5p03/nh2uAj/aP hSdsURMRGnpSCUdBSErfEhCEWBZLmHClDe7TucQaqHvofwUv02OiO+ZnJrwyENuH 0ciuMuvj/zJjEJA3MyaY2EAosWkjf1diEQK2QQREF5U67OMexL84nh5KKnUc6JHf S9GD2Vpl6UXYpvgf5cmsNNlp52VogO5dfGzDU/D+aYGRjmJHqiiSRyrAmgjJx2nw ZJs5zupgQDApZWcR+hVnRbm/iq56tDMrULC8pKeXLko4tW7ulzi9BYfyc0r0R5M+ UV2b49H7bN1ECJCKKyg9A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrdgtohhmpd hrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehg ihhtshhtvghrsehpohgsohigrdgtohhmpdhrtghpthhtohepthhoohhnsehiohhttghlrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:30 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id ec018cb3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:29 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:21 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-11-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 2a26fa8a5fe..6438fa67920 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 5bf6a914ead..930b85a6dfe 100644 --- a/meson.build +++ b/meson.build @@ -1608,13 +1608,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', @@ -1705,7 +1705,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_commonmain], ) From patchwork Wed Feb 26 08:22:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991750 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 EBCBD226CEE for ; Wed, 26 Feb 2025 08:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558155; cv=none; b=ukWV9OEDXZfT/Muy0oAdl3vBzPhdqcRWQ8rzVzxKhtFdS+64JuQHSiJP/h2tMtYRKGKGljoZGnOSYIoHC8DMfq9+qfEeBIELfSZbFlkklDKBRV+rMWNd8is8GtLQxtV46e1JBbFUKuDi24t+5WbpYQH0l+STDrbe65mQ616sk5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558155; c=relaxed/simple; bh=W397jRG81+5Hnu4MsgfKPDZyF2XWTbUbHKL/zvoQOlg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=o1CCkRZ332lU5HKb9ojzwDW27gm0ATKhz4y0G31HNWOzDWAruRdBZddp9FqTGufUAg6VqNAT25Rp5De6v+G+rF28ruJOJBIIkCbv3uGcyeyyPKF6KLmNTni15VoPTxzWjw3yrbi4VUbRusCLJDO7JVr+zPgZfXix3fo8lPlHnSU= 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=fB89lQdC; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=PNEAiE+q; arc=none smtp.client-ip=103.168.172.149 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="fB89lQdC"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="PNEAiE+q" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 175881380EC0; Wed, 26 Feb 2025 03:22:33 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 26 Feb 2025 03:22:33 -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=fm1; t=1740558153; x=1740644553; bh=rEjsEJEJO582CILXeGbnqXapzG82agrBmm+d00gvtvI=; b= fB89lQdChpJT4AoFxZSYP4JPMYeFyYDptoC7iBoHFXBPUocj3O1QZTkoCG+10/DW oF2cpf23ctLd1z2KQso388phrl9LzfWKwwgf0D6929SRU9RPZbLIsV1jhUENvW5T i2fIxzrJZsuTa1SOdys7srATD2THxwqIDsbKLSrPTztswVRUXrVNYUYnuT9f4fUz tUr87k/o07kAwanG8mpf7TctUovWFTeyE4IdrcH5l5zIQnD1iWfBwq8o+3TZd4E8 M05qhNoO8+xwsSp4ODFM+rbHCCviFmC3bNHZL4KeazPPCobsUCUi19MekxDQnaQa gCxYnZyZ82kmyurF6VwIZg== 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=fm1; t=1740558153; x= 1740644553; bh=rEjsEJEJO582CILXeGbnqXapzG82agrBmm+d00gvtvI=; b=P NEAiE+qqXqN1jVsCDaQzOI5JD67lYU9ze1DLwbAyMcju2UABUoaO2xfvaUhLE2Ut rHLvkTQkFMi6//+mcdcXTVabcRFyqqZdcn6cV9hvO7gM8KLEO7bkqYh6NejcpI3A Jt4dNKp+SYKByT/MXdeIaMVex0MeoHCFMXKUF06Sow3VB49MEj0F1WB8OAJTd4N5 DnSBfwS3GieCQtc26lLGyXYMJGhDQ+wSjrZ+W0dHXCKnlUpoL9ZzrYch5n1Ijen9 XY/sTtdRcJOcxDaXH3FHbD/zx/6y1PLf/QOY2fycdZWum89pYCd3ShB/nSvfUheM LCWYvomUb/pWAY289Nr4A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomhdprh gtphhtthhopehtohhonhesihhothgtlhdrtghomhdprhgtphhtthhopehgihhtsehvghgv rhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrd gtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:31 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 3a19cb57 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:30 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:22 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-12-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 6438fa67920..c6117366ff9 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 Wed Feb 26 08:22:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13991752 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 4F7D4226D05 for ; Wed, 26 Feb 2025 08:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558156; cv=none; b=KYk4aaxD3KROlPzuThukoEBC2c5kIvXkEeAzO1glPQdh28UAKk8hhhY1DiH1uQLOP1wPpaeiQkJ6kq5hdvcStVqfd5k4mnsYaDvBjK1xbBIt9jCov1OvCW5CR1t484ETDRtnPYW6hHJJgcxInyJPi8MilILVWRQQxjcL95UfaVQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740558156; c=relaxed/simple; bh=Rl2na3Pqv7EXZard22xaHsugrA5cdjKwnWOAFq+Kmw4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EpeZo8QWiJ3GDUXZE/jzR/7dfmpAa+ScnzEgN/NDlQ0NyaTjrxh+Fx0/WkpxSdzW0/rKvoIsrUNEbYBrmBIUbO5pvqAV/xo8xQkCUKkUv4aqcn0QgutJHZERxOMImMKxG/6EMs4PcDkvAu1vZn9Aulbbt+KaAB5XMst+IsOa19M= 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=mrr7jXxa; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Di0Ccwca; arc=none smtp.client-ip=103.168.172.149 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="mrr7jXxa"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Di0Ccwca" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 57CA11380EFB; Wed, 26 Feb 2025 03:22:34 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 26 Feb 2025 03:22:34 -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=fm1; t=1740558154; x=1740644554; bh=C5xRuNfP18o+s0ktLiSCSqGklNYrugPf0hb97EzPRb0=; b= mrr7jXxaCnIfb+KsJEXtYeX7+ziTPva/HLdR6dw0Uqv36eSjqmplfjCASUXRVYMI VPHiEIk6aAFWztb0MIy6vIE9dCKpKTKn7Bm3k1YsWcMqZf794TR9ZS+S1yE139Nx y3lf2yKPAic3vXJsNfQwz2aEVXoOanJ5IkdVm4HRoOkNsKJIpijzxernF7z60SD7 vnI6OMTFrPJuUUdkMzsHYuKgtj1XUYFRcz9drWe+JMXKyQCkuTikyHxHokQHATrM +TQaYaT6u1C/oOpdokile0MQOsD36qqGcg6t1jYL6tc2jHItO3K2YNm8xxQLDSOp MMwIfwHI56O15p5eNuiG+w== 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=fm1; t=1740558154; x= 1740644554; bh=C5xRuNfP18o+s0ktLiSCSqGklNYrugPf0hb97EzPRb0=; b=D i0CcwcalIWP6RZcaTWhAK7CNck2Dw/9VCET+ifvh4TJKTfEE53cG9S+6d5UqU1GD tWhT95mQxlJlrp7SlV/2uDZolePU1AnCUW6DLc5g8fvRHNexTvcBcIO/tbrOtVK4 cMzQXG/4xdDKSM/8zWP+xhm8vOD1ofHKhgNGwG0UScyePp6AgsAcsaQ53HV2WIIM GOEXugkT5UK9wyIgkPwI+r64x7+6OQVPrLX910jWClxdzcp9zyEoLoUHeL2Si/lB Ovc6euOWGTbrJRijooZoKorjzP5sEsnRhr0dHf9qHnvheeKAoIE4020w5PCfAqq+ RlzG29YHdxR93akB018dQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekgedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepthhoohhnsehiohhttghlrdgtohhmpdhrtghpth htohepghhithhsthgvrhesphhosghogidrtghomhdprhgtphhtthhopehjlhhtohgslhgv rhesghhmrghilhdrtghomhdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrd horhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 03:22:33 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id ba663d6b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Feb 2025 08:22:31 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 26 Feb 2025 09:22:23 +0100 Subject: [PATCH v3 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: <20250226-b4-pks-meson-improvements-v3-13-60c77cf673ae@pks.im> References: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> In-Reply-To: <20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im> To: git@vger.kernel.org Cc: Justin Tobler , Toon Claes , Junio C Hamano 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 4976e18a050..7e1cecc6a70 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: