From patchwork Wed Jan 29 07:11:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953472 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 D75F11990CE for ; Wed, 29 Jan 2025 07:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134731; cv=none; b=PleNMGUpZZFNYZlYHz8p+TPM+ItHkK0BQfn5UYYIt/ebEBjlIlTKVUco0e1jWX15mpwxGMU3syINSDewDP5iUG0mdCRiX1RHIHBMM+CNk34aw/9GaTJsfQCxh2r0Y/+nKFNhypm36uPxirjgYuInWnXrEOuiinB3a4bWnAado4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134731; c=relaxed/simple; bh=5OwcILQajgaOpwzb6toT/ceCdY4OJ6NvVg9WQ6D/JWU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WC2ZWykLStmSWhMIiOsOdJn9gA8HXTYkGHaPxPqmQMcv3O8ZtnGFkR2DL4rOaoNECv+vthfxh58UQ8IXpHJLQFybWp2THT3g8K3elhJ1E9aFDZgs6hiCkQ+VhDf7yhRPdFnr1hwW6xjF2BGpzdk7XWdlk1Xwal1mOClRP6ElCqc= 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=pNvgU/Ve; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=TWXL23iZ; arc=none smtp.client-ip=103.168.172.151 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="pNvgU/Ve"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="TWXL23iZ" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id AEA7C1380B1F for ; Wed, 29 Jan 2025 02:12:07 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 29 Jan 2025 02:12:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134727; x=1738221127; bh=/5vfSTw8LlkNdI8geFCEu1qgMkMQoK+df0lm+MsYvUA=; b= pNvgU/Ve2/v1noW2Ok/ueufXNcYrynobP4RCBQkMktZ6fHZhpO5008PPzW9u0mQt 7k/ePJCfqJkth6WgSrtJApIMNkgKa3rjPMcSH1urz8pUT7wPHN+VwSLP8qacbbup h8lb2Fxg0ZpPBaOQVa4HUz0HKaCL99A+67HxUZuLkVXUY4Esyrh/f/gPQW1++hTp 4f5+vR2GipIb6NUqcjS/wDXrD5qWZnXRK4R/Fq7vbXaZiGGcy3L4DU33jDx6DezF crwmUuPCAnUi1l4xjFVo/DPHhO2zNKccLPqrmsFJ4T173lo3X/3nvCUIsU4FNywV IxgneMhkuuCtByqPtC12Ug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134727; x= 1738221127; bh=/5vfSTw8LlkNdI8geFCEu1qgMkMQoK+df0lm+MsYvUA=; b=T WXL23iZUvKY4/KStgplRlEXlHmkqlHUXe80FbqpKmeFdcRrQmj8Y6477rJ/cPrj7 6BtjFobJ9gqXHVDbz/2mPL5KCSmJ71a4mZ7fVcFsXMEPURdSy08dcbHuxp+UNX0M h9z+rKyYwkS00g8ujVXvAiz7McI0WpPtFAgYvMPipHfQwW30ZtXg0HHuEzdDRiqF 92iIqSU/ZSOJbDsKmvLvz3uiRvzxZRaV2/IZbVczcpnqpOgRZf5oYjWsuxKFP2ON xeI5eYXUE4ZedhdRgzCON8GEDrLyP+Wy7PkyUzg/uLqK7Xk0wey24hMco1oFutoH pUYvPp/LQxmN1YyW8hgOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:06 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id bf26bc33 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:03 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:11:54 +0100 Subject: [PATCH 01/11] 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: <20250129-b4-pks-meson-improvements-v1-1-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: 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 correcty, 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 c54ccd2162..fd83df8c42 100644 --- a/meson.build +++ b/meson.build @@ -675,7 +675,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') + '"', @@ -1437,6 +1436,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' @@ -1473,7 +1473,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 Jan 29 07:11:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953473 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 4784518C31 for ; Wed, 29 Jan 2025 07:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134731; cv=none; b=sF8l6YhT2LBy43AfT25Bh6aDRggwiW68hLWQ/rjOPK8Bl3OdHSXPMRTL0tfrXfYyXGHuurCsnsk1rrid7650rU1v9d5dN9rfbjwrZnDkMB9pA7DJ+qQ0ag9p1are0VPeOXH3lUUsHEWSTpvsRRb5nsVHPs/wDr0B9SnTbNL3IwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134731; c=relaxed/simple; bh=2Knu3S+O53htEaO4TMh02RiHENOxqoHagCT//mQBOFU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AyqJE6MxSDeuoWA9Uwk5TXdRvMlboWxnh3lnYqPvoWjsHzPaSj6xgdG1yBJHdDeXFohOtcj1JEqGLg5NbMOgKGD+4v8cCBjMlsc6hhXU/S9/M3O0GVRBFSeZkX36pWUMq4JX7nTP5Vf3Ql5bZw9j3qAe0Fzj3/wMLUQYdprb3Ls= 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=W8mD4S5P; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=OEA0hHqI; arc=none smtp.client-ip=103.168.172.151 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="W8mD4S5P"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OEA0hHqI" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 389531380B20 for ; Wed, 29 Jan 2025 02:12:08 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 29 Jan 2025 02:12:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134728; x=1738221128; bh=D1ZHHE1wbuSCh1xpVDG5TngVv7olViukOwV1BjUYwaI=; b= W8mD4S5Pmx7kSFSUKAYEmbCLwimx2PNit00GmH7QERat8Rh8v3KsmMejTMP64JhB EQPF50kBHNO6QjmTPIh7asZfU52+8AigIlz00JU/K2QgnMH35GhJmh/5xzf8FxPu LaG+AKMgVbLvhjt8SNM8sWyZOQuPDdxlNj4sGZYg5XsJ97u1Y3H1F5jqzLIbDka1 9J03D6n88sTmJBIy6wAUtVw6GQNhBcwc7VoS4I2fzLRxQ4611PuOA7y4JpY3EDV7 CLtp8sJxBLknZKOzmsKjG01vGLjEtACzGn9LNf7FdQEuZCtaAovMpyj5vEA79Auh GEywNcOW/v5/vbebkJ1sPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134728; x= 1738221128; bh=D1ZHHE1wbuSCh1xpVDG5TngVv7olViukOwV1BjUYwaI=; b=O EA0hHqIzpQgCPLGCLeebrZCLVjqkBD8DsUzLD1aFmRCAz44zuMmwG7PDr1uyaRwW iFNgwWBWKKFFc/kUPv8G2xijQ8OTZd0uEdqqovs6fc5VSdGtWORdCJ8HwPFInjwA 18iQ99qFlr8Jz7TCdZNdNiLhYMNGfRsWmfsfCpVeO84vUxmgCKKOpy4iTLbJqlIB 6FNGPhMH5qAPNTDTAHn9Vt5hPN5WkAeqPfY7Qn7FVuZIHa2VXZ8iqjCv5lpMhPxi MfTCRQARKTzXCN/1nJfrDG4LiCU9WLrXemsIHLpVtqs43a4Nk5C/v/fnAPS9pq5x U0fubD8pxI/DBHqldWkDg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:07 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 9b17f72b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:04 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:11:55 +0100 Subject: [PATCH 02/11] 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: <20250129-b4-pks-meson-improvements-v1-2-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: 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 fd83df8c42..84d100fd25 100644 --- a/meson.build +++ b/meson.build @@ -1521,17 +1521,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 Jan 29 07:11:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953475 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 28271194A7C for ; Wed, 29 Jan 2025 07:12:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134731; cv=none; b=MSN035rQHFWlrSrb9nH59GxHhIJwgmXWzQ5qwNshb2A5lBh+KoOCHqUJEcWb4zkccM7Qs8BD9GNUFYIrdp+/HvlBPfhV7Gbj75EPGLCyU7XdnbjQ8yAuaOFzrpzzLnm1Ena55LDj01+6Rc7ypALSCQ3hoRElXQH9UG0UPJvgWes= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134731; c=relaxed/simple; bh=Kzsn/iwa0mVIppahmX8XtQVyVeLx4DiI/bgsmE5Dnb8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fIzN3hfi/c3JmaJmkYSJaEoKpqqOJyVz8Ret4Gs0pZBsqGt9+QoavwzZ2QGdmAXOxlHME3cCMtR/3VlNGo0zXyWXdRi+qqg4pNxnQqJmPB8RuNYJoOKclcDDAnWv48gITGKse3S7k6ztoF0RinPeQYsqhWmh/ySLSCiMt6SJZ94= 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=qCoh9dad; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=YOiq+hid; arc=none smtp.client-ip=103.168.172.151 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="qCoh9dad"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="YOiq+hid" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 8A7721380B22 for ; Wed, 29 Jan 2025 02:12:08 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Wed, 29 Jan 2025 02:12:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134728; x=1738221128; bh=7YGh8f9c/mN/tNICB4ZxxtHxUlncfBMdNBYQKeZbt3Y=; b= qCoh9dadWh5B+8g65ICGjUrh2uznPBTmh72tZa6C0uuVXTv9gPBtQWg2QPveD6cf vUpYs2rvzdKm/bHxm656qgrCfCWCMW/OkbHgYMfwSNKSpNmrgRMhQT71PxVfpFgS Xz746uBpFAYNgNyUSeL/7s+mCjDKqupOBjbmNylC55LOvXCWwZRxyASCQpWVe7qG J2KvEAeEWnT10kfAlLvAn2mO3mpZdT9hXVRVe5Q6eN0L3ftS1dytKZqOl20yNY7X 3fb8B5IGBp0ZAvTk2qmmgdZd28Y6I791bVU/XOH++OYvoMH4qJxkA5SoKBq+Tzhm TAQFKwyht8lkkq+Jnft2Zg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134728; x= 1738221128; bh=7YGh8f9c/mN/tNICB4ZxxtHxUlncfBMdNBYQKeZbt3Y=; b=Y Oiq+hidYzir2dCLskPVfx9nPRsfjwleojBLmJDia6S+tkdcExtPgvyrPiqtHlixm UtLZYKDKMv5hXag3NsEu45zca6E0cQBoKwOv6HRDUlgTNdZFvXmADUpCngzqt4Gj jR/Eh6Bd+z8WWVL8GL0X1Iefv4Se8jnimFMSasc4CyQ9SqdcjzjwRKCQQeW02cPg mz8BwsSe6XglXLBW6pkCbrdxLN1agJbOo2YnXrl/gmUmUy4QjYEMCBJSYm3aDUkj ML73H2NzxzNujplVc2/C9xum6arccM5VO/0GulwcjmwCANqjBM/aZITVokVb0Rs/ G8KQN4x1MOgzDS97oOemA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:07 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 6c1c30f0 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:05 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:11:56 +0100 Subject: [PATCH 03/11] 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: <20250129-b4-pks-meson-improvements-v1-3-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: X-Mailer: b4 0.14.2 The "common-main.c" file is used by multiple executables. In order to make it easy to set it up we have created a separate library that these executables can link against. All of these executables also want to link against `libgit.a` though, which makes it necessary to specify both of these as dependencies for every executable. Simplify this a bit by declaring the library as a source dependency: instead of creating a static library, we now instead compile the common set of files into each executable separately. This change surfaces an issue when linking aliases for git-remote-http: we extract all objects from `git-remote-http` et al and then link them into the new executable. As such, these objects would already contain a `main()` function. But now that we also compile "common-main.c" into these aliased executables we see a linker error due to `main()` being defined twice. We fix this by only linking against `libgit.a`. Signed-off-by: Patrick Steinhardt --- meson.build | 34 +++++++++++++++------------------- t/helper/meson.build | 4 ++-- t/meson.build | 4 ++-- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/meson.build b/meson.build index 84d100fd25..82b6e62029 100644 --- a/meson.build +++ b/meson.build @@ -1570,15 +1570,11 @@ if host_machine.system() == 'windows' error('Unsupported compiler ' + compiler.get_id()) endif endif -common_main_library = static_library('common-main', + +libgit_commonmain = declare_dependency( sources: common_main_sources, - c_args: libgit_c_args, - dependencies: libgit_dependencies, - include_directories: libgit_include_directories, -) -common_main = declare_dependency( - link_with: common_main_library, link_args: common_main_link_args, + dependencies: [ libgit ], ) bin_wrappers = [ ] @@ -1586,7 +1582,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', ) @@ -1594,35 +1590,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', ) @@ -1635,7 +1631,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', ) @@ -1643,7 +1639,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', ) @@ -1651,7 +1647,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', ) @@ -1660,7 +1656,7 @@ if get_option('curl').enabled() foreach alias : [ 'git-remote-https', 'git-remote-ftp', 'git-remote-ftps' ] test_dependencies += executable(alias, objects: git_remote_http.extract_all_objects(recursive: false), - dependencies: [libgit, common_main], + dependencies: [libgit], ) install_symlink(alias + executable_suffix, @@ -1677,7 +1673,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', ) @@ -1685,7 +1681,7 @@ test_dependencies += executable('git-imap-send', foreach alias : [ 'git-receive-pack', 'git-upload-archive', 'git-upload-pack' ] bin_wrappers += executable(alias, objects: git.extract_all_objects(recursive: false), - dependencies: [libgit, common_main], + dependencies: [libgit], ) install_symlink(alias + executable_suffix, diff --git a/t/helper/meson.build b/t/helper/meson.build index 5e83884246..05bf35bd26 100644 --- a/t/helper/meson.build +++ b/t/helper/meson.build @@ -78,14 +78,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 14fea8dddf..8896314b88 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 Jan 29 07:11:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953474 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 2821A1946A2 for ; Wed, 29 Jan 2025 07:12:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134731; cv=none; b=orLjvll+ZCZwaqtv6fIKYkNtzeR3ZRVP5WvxuDChS10k9GlMBA5cK0RwdMTsITrxQZP/j46eKvMIwvKFezAb5IJJeDsnmZjCER1th+IlwFDROo0svX/cDQzFI/1Bi0gLGAp7LnCzAu//Dxkr9kdOhnH3E4P9oE9MddF9vSThVqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134731; c=relaxed/simple; bh=mzxnLWcu0jyL6XKxghNDi90pMpmT82FbVmhwsBlcWbs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TdzaC/6WuPtjkF0sRi5lYhtwolAvx5QZTehE9Urt6onXzNmWyJjrITeDcA4AU04Z3zDoo1n9KWKsu+2nNIv/lzIAEO4ZHg1pln842J0yFFU3idlZfZ0oNR0EV1eyLWRvuxvmfZr+jqdxhsGhtG8ktcKIsmcwAquy73lexWqa+as= 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=qeJaSh/m; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=KwvvHu9X; arc=none smtp.client-ip=103.168.172.151 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="qeJaSh/m"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="KwvvHu9X" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 2138E1380B21 for ; Wed, 29 Jan 2025 02:12:09 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 29 Jan 2025 02:12:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134729; x=1738221129; bh=o/lcstWhiGCauDf1ODB6rRGvcEyzdW3p7VarEvia6mw=; b= qeJaSh/mpdZHvY38eEsPq8OF53+Vv/JHIDQHZqj2o0AsdpBub9iyKe7UlVxMTh4n rvzzS0IsWFTCso40o1lxjhxoWbUKJsrG69zAgH5CZwVsukyLAoE8/0OAve+23w3h 0OEFuDvfREqKM/LZI35ptRVLkwF6tKR8Rf6ki4uQpZaQq4eF0FTq0/YqpVWdT6D6 6CBbW+ZyOjFQmmPpBWVtZVDgFzPBxxyFzK384dloF7vuGV7TYGbvqBzRHARf/k5x 3d+R2jBCUCbeo6vXqXZ8PiaM4IowIQ1cdWvvo+fBuoaTmb/lg179HjeCz04xNGQR H+ai2T1W4lKgx+h5sIpBxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134729; x= 1738221129; bh=o/lcstWhiGCauDf1ODB6rRGvcEyzdW3p7VarEvia6mw=; b=K wvvHu9XXvXOEUjHQ6S1E4IlzXk7l4+o6Oo2k3C4gLEbTfDjwGDWysNYNvB0wxPlT ZlV41ARDNWwyyyB0RuyT6KiaAmRwwxjNwGN44PwVsFhLmEYYO7PL1TlgDqMmBkm8 8eMXdpWI+LfInTpZ6VOdvBULQn7rVTqKYqxohR8K4CkbDJiMQ3LaJk8Uqz+T4nPC VI5HzvZO1AqiaX5EKO6bN79AwPFF1y/ttjHpDsbv6Tn2MZmrL5aXKvkB/B+o5cYM 0rtIuZ4OMEZjsQYaXMqKIAygTvR46iBkx/rqqQlLBO5UdHy+SiPqpi2mT1o4rBei XH8b9mSqrjSPQmZhm5aig== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:08 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id f5bf208b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:06 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:11:57 +0100 Subject: [PATCH 04/11] 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: <20250129-b4-pks-meson-improvements-v1-4-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: 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 linking against libcurl as required. Signed-off-by: Patrick Steinhardt --- meson.build | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 82b6e62029..6f62728117 100644 --- a/meson.build +++ b/meson.build @@ -911,7 +911,6 @@ if curl.found() use_curl_for_imap_send = true endif - libgit_dependencies += curl libgit_c_args += '-DCURL_DISABLE_TYPECHECK' build_options_config.set('NO_CURL', '') else @@ -1631,7 +1630,7 @@ if get_option('curl').enabled() git_remote_http = executable('git-remote-http', sources: curl_sources + 'remote-curl.c', - dependencies: [libgit_commonmain], + dependencies: [libgit_commonmain, curl], install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1639,7 +1638,7 @@ if get_option('curl').enabled() test_dependencies += executable('git-http-fetch', sources: curl_sources + 'http-fetch.c', - dependencies: [libgit_commonmain], + dependencies: [libgit_commonmain, curl], install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1647,7 +1646,7 @@ if get_option('curl').enabled() if expat.found() test_dependencies += executable('git-http-push', sources: curl_sources + 'http-push.c', - dependencies: [libgit_commonmain], + dependencies: [libgit_commonmain, curl], install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1656,7 +1655,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], + dependencies: [libgit, curl], ) install_symlink(alias + executable_suffix, @@ -1667,13 +1666,15 @@ if get_option('curl').enabled() endif imap_send_sources = ['imap-send.c'] +imap_send_dependencies = [libgit_commonmain] if use_curl_for_imap_send imap_send_sources += curl_sources + imap_send_dependencies += curl endif test_dependencies += executable('git-imap-send', sources: imap_send_sources, - dependencies: [libgit_commonmain], + dependencies: imap_send_dependencies, install: true, install_dir: get_option('libexecdir') / 'git-core', ) From patchwork Wed Jan 29 07:11:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953479 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (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 A7B19199239 for ; Wed, 29 Jan 2025 07:12:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134734; cv=none; b=CuURCNwLs2eLnJ3/6iAWxEJTwlaF5T0v8Hl80rVFhmUHXX0d3tlGiCiU0VOcZMr5VhlGfm4GaZVJzvcnGzcZZxIUMQ2jLdLSYHH6BdVX+3nYeWFJbUyoDZdp5WSRf4KYvhYN8DQd/oIZuqxGP1GmnxDyZbPgQNZD9X473Qa9+Fg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134734; c=relaxed/simple; bh=gfmq9Bz/iI14EXSQeArFjuJMH63Mfimla+0Gfd1d5H0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rz7sLy5CxFBC8VMlsuVOgqvlrYa/KfzCwx8SSwXKZ2rTZnVZVvT+CHPvMBkkr90oEoSAPYxe/x+L3ql8QEJpRc8Uq2/aAgNyNvVdsKT1vcKH8lVGWQpybyFwpodV3HQWDVR/GU4XWhEtms8ywYhXEIcOK5wxoMKuTuti4hnP+/U= 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=YE/1e1Hv; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=zQeKgTl2; arc=none smtp.client-ip=103.168.172.154 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="YE/1e1Hv"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="zQeKgTl2" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 6419F1140105 for ; Wed, 29 Jan 2025 02:12:09 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Wed, 29 Jan 2025 02:12:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134729; x=1738221129; bh=+1iINIM4+lNJxj+3XBXnklPr4m4zzCV7g0cZRRd9kJA=; b= YE/1e1Hvz3n6L3vGXY0k30R/cKq2wZaSILQyxx7zGbLCRSOZyrpMZZUgMA+NH242 r9EmhZCNsEwH02nR3hs8p7UADgESaYYNx3xDggusY7XUnxlSCceSrvwZdSAYyO25 rGoUQkC8sFfm0b/XLmV2WIYdm1azy/S/yvkgGy0KtlmnLHkRKSMZoQHF0ApLf455 yAxG7WIqh40GIkODkC70uVSRt9WBghvFmjSfOYlj5QiCp0ELfMq6JPj/PpPjhE98 ZlwZCyKFGVvlNkZ2xZWF6QkbKEzTBGQDAb4Yh4gEn9/MZl1m/h5Mo3IgB3GuTJyH W+nQSEnFwlycCz74bTf67A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134729; x= 1738221129; bh=+1iINIM4+lNJxj+3XBXnklPr4m4zzCV7g0cZRRd9kJA=; b=z QeKgTl2xEvVwRMffXCJMz/VBG4FrYP9rRuK0kQJ2j8O66H4ZXAvskFkmqqbaP0ux ndF1BO/3LXmUcH7WTkbT46RlceSv4PK48InUd0mN9B7ixAl8dFJxnrr1gSKwmOuW ooEnDa0UTeps0EyqdnG35jEmHJ1gh42VjCjVm+rmlI9bxEOTNAgBtdwrBdViRB8z TWgwag5ScYPDnz5ktVPgk/nqu3MupQThDyYHDj2C7lBso1fjsrdFfh/+8arAcGgd 5QlhrVQJZOGjzJaONNijFtibX2ghzfswec0VWfrUJVgeOgphBaBfqBoeGqzOLkAO LX7ZpSpmFakI/mexLtW9Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:08 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 7ccdbbaf (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:07 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:11:58 +0100 Subject: [PATCH 05/11] 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: <20250129-b4-pks-meson-improvements-v1-5-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: 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. Signed-off-by: Patrick Steinhardt --- meson.build | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/meson.build b/meson.build index 6f62728117..e022235815 100644 --- a/meson.build +++ b/meson.build @@ -1623,30 +1623,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, curl], + ) + + 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, curl], + 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, curl], + sources: 'http-push.c', + dependencies: libgit_curl, install: true, install_dir: get_option('libexecdir') / 'git-core', ) @@ -1654,8 +1656,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, curl], + sources: 'remote-curl.c', + dependencies: libgit_curl, ) install_symlink(alias + executable_suffix, @@ -1665,16 +1667,9 @@ if get_option('curl').enabled() endforeach endif -imap_send_sources = ['imap-send.c'] -imap_send_dependencies = [libgit_commonmain] -if use_curl_for_imap_send - imap_send_sources += curl_sources - imap_send_dependencies += curl -endif - test_dependencies += executable('git-imap-send', - sources: imap_send_sources, - dependencies: imap_send_dependencies, + 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 Jan 29 07:11:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953477 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 AA4F719924E for ; Wed, 29 Jan 2025 07:12:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134733; cv=none; b=aYSoH6pVeAu4NOvNTD/f2tRDvRY2wGhEQzUgfOmVOW8lbk2EPSNYCLfmQixrXUiQ1wBzBma6lApaDrjcLV4vRr8Oj7z4UHAJ736hwVyGUymciAHKBZYLVDV3Wz25R5w/fQZKoNqV28nHMV1xu9e65bvVnLaQsHmyLKpOj0LUgKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134733; c=relaxed/simple; bh=2wzW2SOxtAF9Bj3c+5WMGjh0oQCv3wYTEYSrE4YY1vk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GgCQG646kyePLfT0pIGYx0zU7gqaUkrSR2l8kho+NF8rUlngzb7ETcN50Nf+awtuhKwGfjIjWThGghumqAp9WcFzuzr4fyXWCeowaAdoTRz2gy0eXPyLkfglAQvzUMBoulgSFPGwDetJmj1Q+v/kCdyQZ5tdPZHW4YkhJlprFrQ= 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=Vyv0sgDv; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=hzHuq5Ns; arc=none smtp.client-ip=103.168.172.151 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="Vyv0sgDv"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="hzHuq5Ns" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.phl.internal (Postfix) with ESMTP id 1AEB113801EB for ; Wed, 29 Jan 2025 02:12:10 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Wed, 29 Jan 2025 02:12:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134730; x=1738221130; bh=cHBnwmwb+7jilz3It8Nb8rup6RIBrEYaeBU8qlpTQ2A=; b= Vyv0sgDvdWQYm94PdmaD1Nm4MGP5ESHFG00PWPB3Hk0H4KcF5Deu3j5t405w+B/8 F3ZZ9Ew6/dXl5+On8HQqc4QIYC8LOtYBfosOy/5TsdjsbOlsLU+GdEbGlU/JM+tB m6lUcDZBBZ0Xr0q3gE7HMW2PRqumXhny4DUM3WTGn8czSTzkde2aWkvxcyw0bF1V ms9CjFz7AS5GL4RO+8WIRrlQS6mSGvdE95ZW8JNQCfF+JEJlwzuvlWELf5RVRHKt aqmLu7XrS4PbSuayVZU/lFab4vyKhUscdNqcyCD4A1MMBWJqGzZQWIC/3tihgi26 jVgHc29tGxNNqyH40hPFDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134730; x= 1738221130; bh=cHBnwmwb+7jilz3It8Nb8rup6RIBrEYaeBU8qlpTQ2A=; b=h zHuq5NsUkBfYZf3vySUUnnlYoBS820Celbx1yilYxe4vp2GuGruO10OUL+jrrDqR zUEoHOdNzMu65TcS9n2GXgJPTHivuQAMdWRcIvec4gihG27/IYroz2QlkiessIbt 8HYlyinGgG36rTQsQTv3Ebs0jXNjwq6e8+QVZTBpIp0Vw77e29AYse0FXDPAP3fL ABZRxgQPxjACT+YyidQn12fJRJ7PfVYCfMuOpigkC4kCmenuPYjWCvkLPK3LNILA /Rv0zfBpAsTw/rT8r7kN4yCKSQOzdGcXEN6wktsvkp2iC+pYu4CLqNI7S0Mm7JD+ 6S13ejlx70Wbky4aVtbdQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:09 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id d1002598 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:08 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:11:59 +0100 Subject: [PATCH 06/11] 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: <20250129-b4-pks-meson-improvements-v1-6-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: 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 e022235815..1e1e478d17 100644 --- a/meson.build +++ b/meson.build @@ -462,6 +462,7 @@ libgit_sources = [ 'userdiff.c', 'utf8.c', 'varint.c', + 'version.c', 'versioncmp.c', 'walker.c', 'wildmatch.c', @@ -1505,26 +1506,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 Jan 29 07:12:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953476 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 DCC9A1993A3 for ; Wed, 29 Jan 2025 07:12:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134733; cv=none; b=BJ0x2+OmC7txOUA46tvSae43+Wk+QBdQzA/oQbewnxIWPsNCrnsWizFBgKkiGiyrJBpz35boT+BhmLIbIcnPoHoby1nNGj3F1oDkqPpJci+KO365KePxeO0DFlxNRAmy+OvdczVzemEYGCTGgOR7h6+Z2KqJDbrHcvNVw/cO0YE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134733; c=relaxed/simple; bh=AKhrsEoXkM+8pjy4phMO+Sz5CxJoNRSoEmurjh68VZs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fej+YeNTVw+mDtHI+zocUoHoy9HAMZmKvlU46s0PFTq1ZdlKoCww7amd+Cp9N6tOiPodyr67+vcc+ppDRjFPmIDIIuT3t4iQefU8Zp7Zjo4lYuhITZC4lp5s3pXsimFtiXbEVWnrq4Ngmt1BlQKoLtTSuWqZbUEzamJLqMONGZ0= 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=jgTBmyOc; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=N1L6zA3I; arc=none smtp.client-ip=103.168.172.151 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="jgTBmyOc"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="N1L6zA3I" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.phl.internal (Postfix) with ESMTP id DED4A1380B1E for ; Wed, 29 Jan 2025 02:12:10 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Wed, 29 Jan 2025 02:12:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134730; x=1738221130; bh=GWhllDdaSxZQ4eSnlcpAazRNbvCvw/UI/ZNnmAGYts4=; b= jgTBmyOcsKgpqqTQaWYteZ3/lsmxnX4v/vfKZXcpqn3/af4hI7Wt3HSdw6t6YqpC 7auvt8TXFVz3IrdSeJYxZImJ68nKtBmUMosRDMjvDW8KMs4yDsltntEdQS3Duhxu H2IeygB9ReoPVjtTKFtk37B0doxgNFW0IIyosbcWWfGkFKpjMv+i+4/SgQBru35F 40DwkJGEqB1no52uANGpKn4BeHGNKAVFDbc7KPZ0rMArUdmTT1gUmk68KNSLoxbV WmbVaKv7th4NGpXklUxpPf0Ay1HUyzHQGW5dFMIinLHbAwToMb1ZuFIPGWOmctqs McEprmcYXfx67LOkdOtyIQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134730; x= 1738221130; bh=GWhllDdaSxZQ4eSnlcpAazRNbvCvw/UI/ZNnmAGYts4=; b=N 1L6zA3IC8bXeavAWWeczMrdVEtpcT4Hk6z5RLnFfC8PuqGHpcvz7mCyrfMCWdT4z vlasA5F01MY0wpJd8loCHBvpqC1JYfjqmiQ54arvJZg2X4N4BPN6YfZ12naKa8j0 0RxOdGCTvw5i7L6+J5mC6EWD+Kw4u6fJt8YM+WMDqGqFX7h7WzMLPMycvTovO0vh bmuWzAwsGOCYqIVTUW6GOQAF9rVpyx/pG1U/YKckSNpq1a8MLokL9zymoo/TXiz9 YoVwTWHf6h8WV7b1EOa4Hnp/kv2xV3NMNT8N7riYkpS1NwNIWj3FNwTvFRApimRr v4Ho3bVivKGu1GdnUOeTg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:10 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 521ed288 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:09 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:12:00 +0100 Subject: [PATCH 07/11] meson: deduplicate the list of required programs Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250129-b4-pks-meson-improvements-v1-7-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: X-Mailer: b4 0.14.2 When setting up Meson we detect a couple of executables that we rely on in order to build Git and prepend their respective directories to PATH. This is done so that Windows can locate these tools at build time in case they aren't included in the default PATH, as we know to pick up those required build tools from the Git for Windows path explicitly. The list of executables we check against is somewhat excessive though, as many of the tools are all part of coreutils. Let's deduplicate them so that we only check for one binary that is part of it, namely cat(1). Signed-off-by: Patrick Steinhardt --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1e1e478d17..48eb068fd8 100644 --- a/meson.build +++ b/meson.build @@ -187,7 +187,7 @@ shell = find_program('sh', dirs: program_path) tar = find_program('tar', dirs: program_path) script_environment = environment() -foreach tool : ['cat', 'cut', 'grep', 'sed', 'sort', 'tr', 'uname'] +foreach tool : ['cat', 'grep', 'sed'] program = find_program(tool, dirs: program_path) script_environment.prepend('PATH', fs.parent(program.full_path())) endforeach From patchwork Wed Jan 29 07:12:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953478 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (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 CB3A519C543 for ; Wed, 29 Jan 2025 07:12:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134734; cv=none; b=TJRF//XRCTAiCW/WtlFNN8CuG1OiBXUtlWgTicaCs11bK7cIXm6swE4jOFSEbkJ6v5sZWNqNsXuzyTyH3rey/rD7H563LkS8O1P/9JTge8BVIK9aA3WuWcJB9/K2oawO7rL5DVCRNRiLMtCykd0sO0Iw5Ad9fyEEhcO6QYVQwtc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134734; c=relaxed/simple; bh=BrxBjTLPzkGFIyJSC672QcWajo/q7kuw7dmBNePl/mI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ROAAMoe70AeqfaXhpV2RI6MQbK5jDk46t/AWKHJ35OXN53CietchSzktZaGx0688XwMqGKdqw8EXZf9/BMmfJQ0Xbj230E6EN9IZ+Ne+EI/Fajkpwp6sMzm4g6OcfnG9iKbfqkOG8cxPRdXn4kdP2da7BlK1Ogzhwj0UzTJ0zfs= 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=Ux2unMfR; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=CMfdfYFg; arc=none smtp.client-ip=103.168.172.154 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="Ux2unMfR"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="CMfdfYFg" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id B598E1140109 for ; Wed, 29 Jan 2025 02:12:11 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Wed, 29 Jan 2025 02:12:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134731; x=1738221131; bh=kuhCG1nvNWYsHBYL2GwZaed2ri+bQg3c+cVuu4LJlG0=; b= Ux2unMfRL2WhPIvpm3GH1nT/FvkTgY3EwBNi3pKL5kEs/v0bjyVfxnLruQRZDi/P Xpngi99TLM1r5Wiu05UYzh6vO4ijPb8u1Vi7IQhTr/Lwitrry47gagFjACLHCqpg UxBzrNV3imouV23QKoOmU/dBe9LWggzLrOuLCxEmeGyGpuMRCf9KA9qUCAka+1Fp MjW+IduFHS6CnyeFGOaxu41UotpdpqfloNwvVoW8aB84r+rs9P5wqJ2r9/nH3wHT VZX42iTEU9qFdovZjelD86wtJb4CPZmgTu99nLpPPINMSLd2PFaYthlmGX+TgI6d d06Q6u2kPY96U0qTeB043g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134731; x= 1738221131; bh=kuhCG1nvNWYsHBYL2GwZaed2ri+bQg3c+cVuu4LJlG0=; b=C MfdfYFggltk8x69uW9UG0O1JT4aJiVwcG0o5VtjpVdUlKcDs8VMFyPag0cuUSzJJ J+K8Ggv0a7pEmaXt+AZGap0rGfCL1sgAjbWGtp0oeQSEvKlZXdIQYzud2OtxXnum V6zhxxXQif5npwetCZCAMH2ZpZcSECwVpBsEXs57zJrVOJcc6jGqpTodUk3Ckow9 PF8bb2yoHz31uw7kRX91K7ak3ba1P+B+Q+waU5XXuIki8+VLv4uUIopMkzfXeS+e PAvveQaW9U2i3k0ktG2ypTi8ELCxcRJWpUBGL4S99fmG3eLeq/rJlXBq88vjCAPI zKeYe/bqJ/QaEPsModm5Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:11 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 6f118c72 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:10 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:12:01 +0100 Subject: [PATCH 08/11] meson: simplify setup of PATH environment variable Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250129-b4-pks-meson-improvements-v1-8-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: X-Mailer: b4 0.14.2 We're setting up the PATH environment variable such that a set of necessary build tools can be found at build time. Make this step a bit less repetitive by only looping through the set of found programs once. Signed-off-by: Patrick Steinhardt --- meson.build | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index 48eb068fd8..e3829f2365 100644 --- a/meson.build +++ b/meson.build @@ -181,22 +181,21 @@ if host_machine.system() == 'windows' program_path += [ 'C:/Program Files/Git/bin', 'C:/Program Files/Git/usr/bin' ] endif +cat = find_program('cat', dirs: program_path) 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) +grep = find_program('grep', dirs: program_path) +sed = find_program('sed', dirs: program_path) shell = find_program('sh', dirs: program_path) tar = find_program('tar', dirs: program_path) script_environment = environment() -foreach tool : ['cat', 'grep', 'sed'] - program = find_program(tool, dirs: program_path) - script_environment.prepend('PATH', fs.parent(program.full_path())) +foreach program : [cat, cygpath, diff, git, grep, sed, shell, tar] + if program.found() + script_environment.prepend('PATH', fs.parent(program.full_path())) + endif endforeach - -git = find_program('git', dirs: program_path, required: false) -if git.found() - script_environment.prepend('PATH', fs.parent(git.full_path())) -endif - if get_option('sane_tool_path') != '' script_environment.prepend('PATH', get_option('sane_tool_path')) endif From patchwork Wed Jan 29 07:12:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953480 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 727B319B59C for ; Wed, 29 Jan 2025 07:12:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134734; cv=none; b=ZZrJZLxuwi9U5y8JSwec6kNFZavBXju1AyzNnBfyDO3niKT88sJ6APIP4cO1MZvLeippu1uknK//SI2DpdHRFqhf0HkBnwJpZ0WdSd1+F0F/8Qq10jX61ljrx/j1faWOmcIPog1ZZjru80Aw+eo8ipv49nSedgAnFg4vPcPrzHE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134734; c=relaxed/simple; bh=WNGqsVraVGQBljaecVWRdKW84JrJUJWV+o+RA81S9nE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VxO4KikcHiSqQTNx++oFEzkMwfyJ1ADDlUDp7YL2ZH6qbehuAgc/rNwNXMjEco9e4+nWeGLG1dFFvppoOzizkYuYny1p3occPYnwyHaGD8rI7V1lYi8GUQzWciU9Pvs2I6IB8LJXK0//Sd3d6GRkkdBAQmD1unXqlMdPNGgd1iU= 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=h6D8uy72; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=wWthNIEr; arc=none smtp.client-ip=103.168.172.151 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="h6D8uy72"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="wWthNIEr" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id 8A0C51380B21 for ; Wed, 29 Jan 2025 02:12:12 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Wed, 29 Jan 2025 02:12:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134732; x=1738221132; bh=OKWNsZqLldMaTQL0csND+gjgN2yVylrZbyiyZsOe/pE=; b= h6D8uy724SkhKfFUpQ8Z7y9Biyh0gu/llCTHS/Hux0XUjtd4TdO5BUcb/qpjJGQl 70kKI9UJmv+b5IIMLvNW6j2sSytuo0d4BdM0Mu4ETRuR1VUZqv/mNwPJbu3k5xOo A7GaQFM3RrXV5XozsJtvxExz8WhezwnCIcAQBnf+srxe5BpBsCfE0sr8O5ox4xL8 rG4NN7IoH4QuiDVvPPr/eJHWA6QclgxChsqWO3tmwVQqxVwCh2HLfgBKspIGSNfY Z40760m/G1b3eD5UPnRYbywyU0Q2jQMXXvHRu8mifkLjfF2FWlgIMbuXJfz6DDSq Hw1kC0OGVLWGxhxViN8s4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134732; x= 1738221132; bh=OKWNsZqLldMaTQL0csND+gjgN2yVylrZbyiyZsOe/pE=; b=w WthNIErQu6NpkiGOxRomd5FcPPAb9U2rLwlK6mefojiuDVaqlB1Y/QmPleYg1Fo1 eAgxvh0Kexhv/LuWP2QYYgskbHBoio1It4dLhXxh/brPxiMsWT55Z+2R8tqrFLPz Rb9XcUd4r3IRfyymhqWexdvGZILLFuhDc0vuTnqQhWTWLA6tBG8WjyGUpwtRby3J /BOtDGNCye/InGauLC2pbIRrpqGyILrNU0jX5mQ7Up7c4qeBmJY2OtlRFtq+6CH7 Ye852ToQ5+QVOgUrzRg+GTA0DfRydfgeDN2YmM68dkblPujTah4QsFaCDF+bk6jL FLWFCucaLQaA1Vgi95LrQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:11 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id c7acc98d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:11 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:12:02 +0100 Subject: [PATCH 09/11] 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: <20250129-b4-pks-meson-improvements-v1-9-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: 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 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/howto/meson.build b/Documentation/howto/meson.build index c023c10416..92a08b13ee 100644 --- a/Documentation/howto/meson.build +++ b/Documentation/howto/meson.build @@ -41,7 +41,7 @@ custom_target( foreach howto : howto_sources howto_stripped = custom_target( command: [ - find_program('sed'), + sed, '-e', '1,/^$/d', '@INPUT@', From patchwork Wed Jan 29 07:12:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953481 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 373DA19E833 for ; Wed, 29 Jan 2025 07:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134736; cv=none; b=DQKdHGaItgXyObbGv33QwtumG+AYN7Ilo6XkzgPMpTe+I9iNlj7OZrz4tIuNV/STsZbolqsnWIOUwrSaQ8T+fG4ELqVYkzh9ElG7Cz+YnKyUNv13S83QqyTaNM2mRhC74QRKbRAfiKq/abVf2c9ALnW6IkCV2N3itTNhjUxc2hY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134736; c=relaxed/simple; bh=y9hZgunIB+W5uIC9oHHaYZl328iJrudqRulOgDBmCb8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PcTKWY6LzLd0wvEkoUVyyZtDO7Sf3wUznxOzlAcrlitt/BY8Yicf6gWMgtD1M6A3ojay7vGqJ8x9XkltaJRJhG5XO4hY1EL0LBcdEcMkYMbFY9YMc6BJ9+7LVotL6t5F0rbBBEG3rMDX599n+UxNALGKCx+b61y2h46EPGopBJw= 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=Fo6ukGFx; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=sEzNkmib; arc=none smtp.client-ip=103.168.172.151 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="Fo6ukGFx"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="sEzNkmib" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 63BA01380B1F for ; Wed, 29 Jan 2025 02:12:14 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Wed, 29 Jan 2025 02:12:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134734; x=1738221134; bh=f/WmCyRIG3SQSPojxYFuhN9uE4+MjCrkHskdniOJr+U=; b= Fo6ukGFxyX6Eqh89qH1T2Dn2GxUD/BsaxEXWyCnBkSC+7gI8EQF6ecdMPZDE2RsI XRlwKG8ydqkQOOTY1cj5SVutvIch/T+NX0/TBXdoCC9qntctSE+YjWVCAQ3/9yH3 qXScABzUJqEscWjjTIoxi7bN4y1ya0nuwl5mC/fy6lbOusek+KHpnH+7i3d8vxYz RRf5XTnV50g0DGvKa1XUDHClXJBaEHStVdm2Vl1uCjL1NJvJG8/tbt68T9kdGHic r0wL8QQp6g0LmQsPUaav84n3pTp7LD86lPRoyOymnD/XH3DYx1k43vwyRdS3lhk/ Tsh3IH0oyePOF3GmfoArGA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134734; x= 1738221134; bh=f/WmCyRIG3SQSPojxYFuhN9uE4+MjCrkHskdniOJr+U=; b=s EzNkmibm66bbA1ZVHRtNVn1P64D7U6Rs01/V4NA4zBnxetDQ5lWGw+q+gvSY3GDf Cc+4ct0tYMY1EOx1SPG6kDh4k+XfEnoT7x19vl5w3Ca4kA9TPmGZMpcdEASy2D23 e0PZFSbmJ/WiZKI0qAEg5AN5UDWlEmjJrsldEvPJUV1MNspQ/muNuL9UBy9YCFsf vRifjnnSKGEC1eoaVZXAvrpbVjlbSgGEJUKNQduV/zX0tbI+mKHYped2DHonf/6D 7B8gf92sPk5cTf63PFLsxZuEnZKQQ8oJTKZZc7sJl0/rqDBuLoo7BRa1rtL4aj9y 2ocWvbaOKQrmRgmDGuesw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:13 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id f5a055f0 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:12 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:12:03 +0100 Subject: [PATCH 10/11] 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: <20250129-b4-pks-meson-improvements-v1-10-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: X-Mailer: b4 0.14.2 We're assigning the `git` variable in three places: - In "meson.build" to store the external Git executable. - In "meson.build" to store the compiled Git executable. - In "Documentation/meson.build" to store the external Git executable, a second time. The last case is only needed because we overwrite the original variable with the built version. Rename the variable used for the built Git executable so that we don't have to resolve the external Git executable multiple times. Signed-off-by: Patrick Steinhardt --- Documentation/meson.build | 1 - meson.build | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Documentation/meson.build b/Documentation/meson.build index 2a26fa8a5f..6438fa6792 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -283,7 +283,6 @@ elif docs_backend == 'asciidoctor' ] endif -git = find_program('git', required: false) xmlto = find_program('xmlto') cmd_lists = [ diff --git a/meson.build b/meson.build index e3829f2365..828fbae8b0 100644 --- a/meson.build +++ b/meson.build @@ -1567,13 +1567,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', @@ -1664,7 +1664,7 @@ test_dependencies += executable('git-imap-send', foreach alias : [ 'git-receive-pack', 'git-upload-archive', 'git-upload-pack' ] bin_wrappers += executable(alias, - objects: git.extract_all_objects(recursive: false), + objects: git_builtin.extract_all_objects(recursive: false), dependencies: [libgit], ) From patchwork Wed Jan 29 07:12:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13953482 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 024C719F421 for ; Wed, 29 Jan 2025 07:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134737; cv=none; b=K4xKjmmdEvyZ5AX5eQL1mP561OssFtWuYqIzzYcCpOWg38R3OGYR0+uNesLYcMhC9L7Zg26V5l6B3ITQMcI3e8mUPdXxaETSqCNyMWj/LRL0KNVfCaGxy1fsJ7/IGq9Vp9g2buLBsxZY5vQS54Lx/HdK6c30Sh65Tw74gz7H99o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738134737; c=relaxed/simple; bh=2f02/fBS99tWr+sSAW4a9mX7VbtTBXssanpCaIBVBDc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bG4IWdWxe6w+Kr8Cwmd9ZyYDC11dEL8KktAQ1jMbwI2P/4vhKLuEETWuZpclUl90fUcySxVuDePRpMRQ+kh/+EqOJgvg6wz+RRweosRJ5T6bGCIGq63kmUzu9ybi2MQTQ+Ipm/n5J73lGCCbDrUtkqI3KbVuI2daps5K+1P5WwQ= 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=QLKMRwAI; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=nj3N69X6; arc=none smtp.client-ip=103.168.172.151 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="QLKMRwAI"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="nj3N69X6" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 423941380B21 for ; Wed, 29 Jan 2025 02:12:15 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 29 Jan 2025 02:12:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1738134735; x=1738221135; bh=++pFvX45/+OBIgLLbEzgsbmUbDd4EwMMAR+DgpfSkDI=; b= QLKMRwAIFuJ+RkDMvQl6/RbpwbZsOVdcmKljfkgKUE5Yj5y9Z7AZ47ntaW/UTijm UVnrNJdAt0TqSVPPaOVoycnTuBqcCtE3zUtxsNXPXVpHLWEMcDYQullLS0ThJXPc Vme8A/YEWgx4CoQkP0KjzZW3kRlvBzPvqAjkqSnvlxrE5F92YWvzCQz/rTLoCCXj tU/e1F4u5ISLRD5A/KIJVKECft730NhV6ehoRVwBGZrZ1ElY/D5K0F7GCHAeIfKF RlOzblJ2/WW25p8sfMvhGymWFPDOhQCB7lZznfB2Uj3MyKFbKQYuewppJHtDfKS0 7G02my1WGddXFBR/ZsEl7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1738134735; x= 1738221135; bh=++pFvX45/+OBIgLLbEzgsbmUbDd4EwMMAR+DgpfSkDI=; b=n j3N69X6OfWSsV7l2p0uSILv3WwXbAJu5SyWQ3g430QNa5ueKMzXWIfHUVpudIaPl ZZXv0Ci2+JNzIGYd1BXO25wQX++tuScLkI88LuRHBh93OVqDm8biZChmVtN7VfSe 3008Tk+3IWchDu3Yehs0xbObsl4piDvFWh79fESXPUOAVpxf+OQdENVOqAluC/Rr gpVxXxst4h8mYDIotKtYPJMh53Tmev+Jo3CSYWuGFg+9unGNQiOQT9XAOWEXTgf4 AMlmxA0U2OZbNDErFknEH0Pw69wq3+3HFy7+yvHOat9pbtHyEczn+VCa12heFhZ4 ewRz6S1QdUenJ5Fw3Hf8w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhfffugg gtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghi nhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepffeuieduje dvkeehuedvkeefffeivdeuleetkeduheejteekgedvudfgtdfgieelnecuvehluhhsthgv rhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnh gspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithes vhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 29 Jan 2025 02:12:14 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 2f96b99e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 29 Jan 2025 07:12:13 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 29 Jan 2025 08:12:04 +0100 Subject: [PATCH 11/11] 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: <20250129-b4-pks-meson-improvements-v1-11-ab709f0be12c@pks.im> References: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> In-Reply-To: <20250129-b4-pks-meson-improvements-v1-0-ab709f0be12c@pks.im> To: git@vger.kernel.org Cc: X-Mailer: b4 0.14.2 The calls to `find_program()` in our documentation don't use our custom program path. This variable gets populated on Windows with the location of Git for Windows so that we can use it to provide our build tools. Consequently, we may not be able to find all necessary binaries on Windows. Adapt the calls to use the program path to fix this. While at it, drop `required: true` arguments, which are the default anyway. Signed-off-by: Patrick Steinhardt --- Documentation/meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/meson.build b/Documentation/meson.build index 6438fa6792..c6117366ff 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -206,9 +206,9 @@ manpages = { docs_backend = get_option('docs_backend') if docs_backend == 'auto' - if find_program('asciidoc', required: false).found() + if find_program('asciidoc', dirs: program_path, required: false).found() docs_backend = 'asciidoc' - elif find_program('asciidoctor', required: false).found() + elif find_program('asciidoctor', dirs: program_path, required: false).found() docs_backend = 'asciidoctor' else error('Neither asciidoc nor asciidoctor were found.') @@ -216,7 +216,7 @@ if docs_backend == 'auto' endif if docs_backend == 'asciidoc' - asciidoc = find_program('asciidoc', required: true) + asciidoc = find_program('asciidoc', dirs: program_path) asciidoc_html = 'xhtml11' asciidoc_docbook = 'docbook' xmlto_extra = [ ] @@ -245,7 +245,7 @@ if docs_backend == 'asciidoc' asciidoc_conf, ] elif docs_backend == 'asciidoctor' - asciidoctor = find_program('asciidoctor', required: true) + asciidoctor = find_program('asciidoctor', dirs: program_path) asciidoc_html = 'xhtml5' asciidoc_docbook = 'docbook5' xmlto_extra = [ @@ -283,7 +283,7 @@ elif docs_backend == 'asciidoctor' ] endif -xmlto = find_program('xmlto') +xmlto = find_program('xmlto', dirs: program_path) cmd_lists = [ 'cmds-ancillaryinterrogators.txt', @@ -404,7 +404,7 @@ if get_option('docs').contains('html') pointing_to: 'git.html', ) - xsltproc = find_program('xsltproc') + xsltproc = find_program('xsltproc', dirs: program_path) user_manual_xml = custom_target( command: asciidoc_common_options + [