From patchwork Tue Jan 14 11:56:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13938683 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (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 2FA78234D00 for ; Tue, 14 Jan 2025 11:56:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855781; cv=none; b=bUS/7J/cGfR/qaj5XURl+oNH+4/qLQaUQEWkRX8HD2nvFIWpnLRbHA4qnHZSb7iskpKQCAwpZjSBmI9YpV3ILb+VGdeyQ3HtwpyELlAP6ZrxKC7vCWE/n1l/yhZZY7tcuP43dWgWhvCOMz8MC9W1SE4h284UPiu2OxFKIwHSIt0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855781; c=relaxed/simple; bh=smEKV+80UqMktGJ8Vj7dFDn1BQpdk1zpHk/bwpEY9PU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OsoBawDK0qB0Wsq7ux2zhjGT53fWGO9ZQFzLqQOLjjar812SLRYGlBSIUyec7OhCdp1bGG8RooBEHC/6/3GYyJeq6aVcRmmVABtnyPnP/R9qn5UJ1n9XlHsRVj33Z6vH1maZPprdIT2c2Xxk8PxUuzqEoMoBmgZlAVg0947sQzU= 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=tFy8PIEI; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=refk10+n; arc=none smtp.client-ip=103.168.172.159 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="tFy8PIEI"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="refk10+n" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4A6781140141; Tue, 14 Jan 2025 06:56:18 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Tue, 14 Jan 2025 06:56:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1736855778; x=1736942178; bh=Viu82sTd4p0DFlv0KxwzpmjV4EFP0erMsCJ/VOgSuD8=; b= tFy8PIEIWbLJSAyuXux7QQ1aM5P91etLuRL4u+8JflZfirnHg+fxJb1Adz7xHxz0 OpV/kIcHlz7N7mI5ghI2yWxgBPLEZsvheTGxd3NHRV4UB1z72YzMXZqyAy+RybfF xiFTsQoePZbXTXOgHBPg3ayt04uh+zJSP0FPBnr8DXORKOCU0el91Ejp+Jj5kma2 J7ZtwhqIl3neG8W0glXB6Krqsfpf4XZpEzMM7fWyXLNpUUJ8UCP3B68prMv8acYM aXbvMSPjgcMd18TzA1eQTOV7ImauKjWzLV2/LgkilUKqMI1fV+EqziEtr7OjxV8K K2NwB+dl8dABqIbu+qCaCw== 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=fm2; t=1736855778; x= 1736942178; bh=Viu82sTd4p0DFlv0KxwzpmjV4EFP0erMsCJ/VOgSuD8=; b=r efk10+nIAFnb12QYTX753NZAKGPKHA1Z5f0T8HgRUBTdIrgZ6y0uiV+z+x/wqz+W WHdoaGM7mx7CLDfa4EUaIs2WxmSF3k4ehoZcvvqapsZkJau+NhkAUxmI/A2YWiyE kvszBPt006Lfg74j9kh2vvEtBeviVkyLSNUPXhoRY1iYEF4ebGVTdXfsQ6tEgUKi upM4jGDYAqG/OigXO1fxxpo49YEbwzx7ME2+lkiR4W8bQXuSWSXH/lYi8Q9VknBU 5Iyaa17Bc78X/Bm6ZIO0yS7NROh+llv/iBEILtDlZ12+SuJ3Vxix2dZQzSZrjUxX EkqJfGc/o3ei5vPM84r8w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeefhfeugeelheefjeektdffhedvhfdvteefgfdtudff udevveetgeeuuedtkefhgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegvvhgrnhdrmhgrrhhtihhnsehgmhgrihhlrdgtoh hmpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomhdprhgtphhtthhopehm ihhrthhhrdhhihgtkhhfohhrugesghhmrghilhdrtghomhdprhgtphhtthhopegvshgthh ifrghrthiisehgvghnthhoohdrohhrghdprhgtphhtthhopehgihhtsehvghgvrhdrkhgv rhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:17 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 5d1a9bbd (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:14 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:11 +0100 Subject: [PATCH v2 01/11] GIT-VERSION-GEN: simplify computing the dirty marker Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-1-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 The GIT-VERSION-GEN script computes the version that Git is being built from. When building from a commit with an unclean worktree it knows to append "-dirty" to that version to indicate that there were custom changes applied and that it isn't the exact same as that commit. The dirtiness check is done manually via git-diff-index(1), which is somewhat puzzling though: we already use git-describe(1) to compute the version, which also knows to compute dirtiness via the "--dirty" flag. But digging back in history explains why: the "-dirty" suffix was added in 31e0b2ca81 (GIT 1.5.4.3, 2008-02-23), and git-describe(1) didn't yet have support for "--dirty" back then. Refactor the script to use git-describe(1). Despite being simpler, it also results in a small speedup: Benchmark 1: git describe --dirty --match "v[0-9]*" Time (mean ± σ): 12.5 ms ± 0.3 ms [User: 6.3 ms, System: 8.8 ms] Range (min … max): 12.0 ms … 13.5 ms 200 runs Benchmark 2: git describe --match "v[0-9]*" HEAD && git update-index -q --refresh && git diff-index --name-only HEAD -- Time (mean ± σ): 17.9 ms ± 1.1 ms [User: 8.8 ms, System: 14.4 ms] Range (min … max): 17.0 ms … 30.6 ms 148 runs Summary git describe --dirty --match "v[0-9]*" ran 1.43 ± 0.09 times faster than git describe --match "v[0-9]*" && git update-index -q --refresh && git diff-index --name-only HEAD -- While the speedup doesn't really matter on Unix-based systems, where filesystem operations are typically fast, they do matter on Windows where the commands take a couple hundred milliseconds. A quick and dirty check on that system shows a speedup from ~800ms to ~400ms. Signed-off-by: Patrick Steinhardt --- GIT-VERSION-GEN | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index f2af817feaeb384dee0ffd197f02a31cf2d31f87..b8b683b9337e5771e14a2cfb84022a11489bb432 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -39,13 +39,9 @@ then test -d "${GIT_DIR:-.git}" || test -f "$SOURCE_DIR"/.git; } && - VN=$(git -C "$SOURCE_DIR" describe --match "v[0-9]*" HEAD 2>/dev/null) && + VN=$(git -C "$SOURCE_DIR" describe --dirty --match="v[0-9]*" 2>/dev/null) && case "$VN" in *$LF*) (exit 1) ;; - v[0-9]*) - git -C "$SOURCE_DIR" update-index -q --refresh - test -z "$(git -C "$SOURCE_DIR" diff-index --name-only HEAD --)" || - VN="$VN-dirty" ;; esac then VN=$(echo "$VN" | sed -e 's/-/./g'); From patchwork Tue Jan 14 11:56: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: 13938685 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (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 520D0234CF3 for ; Tue, 14 Jan 2025 11:56:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855782; cv=none; b=TuEhulz68UAS+Y7JkGG0z4E8IiJ9mA61kuRedInoQqE9XPu/uDcSVBHKsq1cyQICNUDDB8U0O26WRq9HFK/nMslY6x6qF6SXqAwX8xWwbi+24ycHcARCOo3EwceHamisMUP9rsVFNbtn3wzkyceYBgZJhuD5L6JnzfL+ZtCVMsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855782; c=relaxed/simple; bh=eNmMP7xiuRZzPfxvWj0JrXYlRpEoBdJJmLY4EnD7vAE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dBU3pHEmegjXOIs8vMC5pbHca1BWbSE8mTIjo+YRJcv3MWe8cUkSZWlEJhItq/Alp33voL7eNt+xjadfAFGLoGSNQyLm4zPWTk+x7iI3SFVOUilx5lqnCO7/MJcUH06NjkNhAlc/IWiX6lj4nbMWCuriaaV2PjugevXslUQrU1g= 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=Z5JEbkMo; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=eAmNyKNW; arc=none smtp.client-ip=103.168.172.159 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="Z5JEbkMo"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="eAmNyKNW" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 528371140161; Tue, 14 Jan 2025 06:56:19 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Tue, 14 Jan 2025 06:56:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1736855779; x=1736942179; bh=hPMlmK8xuzjkpL6Z16LUUBfypbQatgwbb69UZoqwT3o=; b= Z5JEbkMo3AI/orW5Y3kzafKpl9gBZ59Xyxj3yqXokGv4zCs6j9YIe9cB1CPz/YzE VQm8G0Rk6s3wfS6GlnsTz+MnWHUxgMjNNvcpRp+G50x6fi4ApjgZwt2I/pPE/lwj 4SR1tAxQVlPLLIIlZlqxRt3lYZZwNLHOvi7UJjkI6sOfbxKTdsLoSZTzCZK71Vee ZlFLR7zuUgKXvcU9CoJmPuYuMoaA+yUJfB04WEum2C5ZE7pxAoM6moO/5A5FdYH9 f8vWfz/evlrTuCJ2qz79ePG5pZxBFP8W2iVS4NHjq3LRf7++NjdkgURjCRGnj8vA vDUKBOihjvNrRo7jpOrllw== 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=fm2; t=1736855779; x= 1736942179; bh=hPMlmK8xuzjkpL6Z16LUUBfypbQatgwbb69UZoqwT3o=; b=e AmNyKNWDW0tVSjIqvhpySzAgY7RbLwQcKVJ9a9GGkHE2Pd90NQ1YLKZggeNmP0ZI k1ns+B09+yUYv9hAor8DHejMzm7Ytmsk+v5VERXm0HNUP2NHAlXiOecoW0PHroBy uRWy79IWpKAjbrjIDWpU91PbgoEIQu9ApYF2wmGbEeAee5XB/+h7ALj6CaAU6v84 zsSq8s2BlR6O/tGGZw8ws/lF0rBQYjTe7kjf4mBPyRchb68cWcnPx3KwFS2s5bX0 KR6FoENnl69XNnX7y+hAbF+cSMiGR7K1pBtQi6rd6Gk9e0uBPBqSI3Empvph7Qlf 9apeFswz3hKROxpDFA0Fw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegvshgthhifrghrthiisehgvghnthhoohdrohhrgh dprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohep mhhirhhthhdrhhhitghkfhhorhgusehgmhgrihhlrdgtohhmpdhrtghpthhtohepvghvrg hnrdhmrghrthhinhesghhmrghilhdrtghomhdprhgtphhtthhopehgihhtshhtvghrsehp ohgsohigrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:18 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 64589ae3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:15 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:12 +0100 Subject: [PATCH v2 02/11] GIT-VERSION-GEN: allow running without input and output files Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-2-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 The GIT-VERSION-GEN script requires an input file containing formatting directives to be replaced as well as an output file that will get overwritten in case the file contents have changed. When computing the project version for Meson we don't want to have either though: - We only want to compute the version without anything else, but don't have an input file that would match that exact format. While we could of course introduce a new file just for that usecase, it feels suboptimal to add another file every time we want to have a slightly different format for versioned data. - The computed version needs to be read from stdout so that Meson can wire it up for the project. Extend the script to handle both usecases by recognizing `--format=` as alternative to providing an input path and by writing to stdout in case no output file was given. Signed-off-by: Patrick Steinhardt --- GIT-VERSION-GEN | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index b8b683b9337e5771e14a2cfb84022a11489bb432..9d201a98fd2766911544225c62159cbfe8dff5fe 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -5,21 +5,29 @@ DEF_VER=v2.48.0 LF=' ' -if test "$#" -ne 3 +if test "$#" -lt 2 || test "$#" -gt 3 then - echo >&2 "USAGE: $0 " + echo >&2 "USAGE: $0 (--format=|) []" exit 1 fi SOURCE_DIR="$1" -INPUT="$2" -OUTPUT="$3" -if ! test -f "$INPUT" -then - echo >&2 "Input is not a file: $INPUT" - exit 1 -fi +case "$2" in +--format=*) + INPUT="${2#--format=}" + ;; +*) + if ! test -f "$2" + then + echo >&2 "Input is not a file: $2" + exit 1 + fi + INPUT=$(cat "$2") + ;; +esac + +OUTPUT="$3" # Protect us from reading Git version information outside of the Git directory # in case it is not a repository itself, but embedded in an unrelated @@ -74,19 +82,25 @@ read GIT_MAJOR_VERSION GIT_MINOR_VERSION GIT_MICRO_VERSION GIT_PATCH_LEVEL trail $(echo "$GIT_VERSION" 0 0 0 0 | tr '.a-zA-Z-' ' ') EOF -sed -e "s|@GIT_VERSION@|$GIT_VERSION|" \ +REPLACED=$(printf "%s" "$INPUT" | sed -e "s|@GIT_VERSION@|$GIT_VERSION|" \ -e "s|@GIT_MAJOR_VERSION@|$GIT_MAJOR_VERSION|" \ -e "s|@GIT_MINOR_VERSION@|$GIT_MINOR_VERSION|" \ -e "s|@GIT_MICRO_VERSION@|$GIT_MICRO_VERSION|" \ -e "s|@GIT_PATCH_LEVEL@|$GIT_PATCH_LEVEL|" \ -e "s|@GIT_BUILT_FROM_COMMIT@|$GIT_BUILT_FROM_COMMIT|" \ -e "s|@GIT_USER_AGENT@|$GIT_USER_AGENT|" \ - -e "s|@GIT_DATE@|$GIT_DATE|" \ - "$INPUT" >"$OUTPUT".$$+ + -e "s|@GIT_DATE@|$GIT_DATE|" +) -if ! test -f "$OUTPUT" || ! cmp "$OUTPUT".$$+ "$OUTPUT" >/dev/null +if test -z "$OUTPUT" then - mv "$OUTPUT".$$+ "$OUTPUT" + printf "%s\n" "$REPLACED" else - rm "$OUTPUT".$$+ + printf "%s\n" "$REPLACED" >"$OUTPUT".$$+ + if ! test -f "$OUTPUT" || ! cmp "$OUTPUT".$$+ "$OUTPUT" >/dev/null + then + mv "$OUTPUT".$$+ "$OUTPUT" + else + rm "$OUTPUT".$$+ + fi fi From patchwork Tue Jan 14 11:56: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: 13938686 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (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 928DD234D06 for ; Tue, 14 Jan 2025 11:56:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855782; cv=none; b=reTbs/vZCY2pkHVq68WLOrawdGpvY4ShL+DCvkQi8ZJP0/fgRIDB11Az4BI1ziwndCnMiQnVOBiS0nqyUSYmIWdlW2Y9Id3pZnHv62CjolGMEkoE3L4EBrnc9Kq8RIcUxT4hA6Q4vg+aoknbJlaioLymOkhVTCqKWchuYaCd5HY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855782; c=relaxed/simple; bh=RD6bTeRH5E3wcZBW8RgUXCoeI6kiPL96q6m7+XSF6gI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YAKVRXw9KQDK4PU6gpcJAvj245GRdpy5bm9ra7qplbFNNW18HHx3u8yPdlCr4ARsz2METgNgQjvA9tbXFZ4vm6xQ95VFnn7PISum/BnUbeU8jejgJ0EjXkBxeBYMBTEra545nAZ9eI1b5kxNe8Hgv1CoDW3XF0gqnBkBy+B3TvA= 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=ZtOR58+I; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=WTsT4gF7; arc=none smtp.client-ip=103.168.172.147 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="ZtOR58+I"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="WTsT4gF7" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id AC93713801E6; Tue, 14 Jan 2025 06:56:19 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Tue, 14 Jan 2025 06:56:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1736855779; x=1736942179; bh=nD6R+tffNb7lmYo3DhjiI2mOrsxqwiBgIyG2+6zR69E=; b= ZtOR58+IMxqa+HoRM1C0ysBriwaULT7K9ipa6RF0cTJ3A8R+8MVPwpv+59+IKJkK VnuuXeYH7WYy87RnuIv3QheHaygwsqgqk9KQGvnezpWU5t1klQdrkQS8AvauNaiR S4qhpLoaVH7oFBCPOb7VZEGcSrDEMq3RWnbsCtt2Od16lfG4ZCf53hPYkZ6PQl0s dksUyHiq8rFkUlo7/1soWhaIt1mQyiEspCvJbowgoq/8CrxqbaOAMpBEOeBvHRyu AQ1qU9UBL3qAQd6X254f1GVj2lmTokmOKBPZM0dc7tOdV5eqGHefhQybDjSjytC5 kPsG5oKMvlKvobw0dL04hw== 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=fm2; t=1736855779; x= 1736942179; bh=nD6R+tffNb7lmYo3DhjiI2mOrsxqwiBgIyG2+6zR69E=; b=W TsT4gF7GNXE9Q02yGh2iPEiJDyiGIfgSYm7rjWN84+aQdtgaiKeSZexLDpDJc/Z0 SehkRXy7bqoSOth5vOl9ZrZE5ixAd21eZhiuBum9+B9G9KLNDnmbOuaB1MooDGMq wA1IxRKl1pJUTmgEHKiXPF4NxDntUDnaBHB2pyVz9NmZfGD1lys7UKBbsXOcgRrC 1szTpLKt9Z7l2uuUUXlVkeB7FPqlM+B6G0CM7Pa+eAvT/UXpm7RuuZqLHE7c+Nx2 x7Y7dzaBDIAR7+Ft4Gr+1TsqkGiDyE7nVxkL3PwoVYSYVllwJ9IXhtIhsAySRGgL emmq6V+8yOsyG1I7laJ6g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtshhtvghrsehpohgsohigrdgtohhmpdhrtg hpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegvshgt hhifrghrthiisehgvghnthhoohdrohhrghdprhgtphhtthhopegvvhgrnhdrmhgrrhhtih hnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhhirhhthhdrhhhitghkfhhorhgusehg mhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:18 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id fb714708 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:15 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:13 +0100 Subject: [PATCH v2 03/11] meson: populate project version via GIT-VERSION-GEN Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-3-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 The Git version for Meson is currently wired up manually. It can thus grow (and alread has grown) stale quite easily, as having multiple sources of truth is never a good idea. This issue is mostly of cosmetic nature as we don't use the project version anywhere, and instead use the GIT-VERSION-GEN script to propagate the correct version into our build. But it is somewhat puzzling when `meson setup` announces to build an old Git release. There are a couple of alternatives for how to solve this: - We can keep the version undefined, but this makes Meson output "undefined" for the version, as well. - We can use GIT-VERSION-GEN to generate the version for us. At the point of configuring the project we haven't yet figured out host details though, and thus we didn't yet set up the shell environment. While not an issue for Unix-based systems, this would be an issue in Windows, where the shell typically gets provided via Git for Windows and thus requires some special setup. - We can pull the default version out of GIT-VERSION-GEN and move it into its own file. This likely requires some adjustments for scripts that bump the version, but allows Meson to read the version from that file trivially. Pick the second option and use GIT-VERSION-GEN as it gives us the most accurate version. In order to fix the bootstrapping issue on Windows systems we simply set the version to 'unknown' in case no shell was found. As the version is only of cosmetic value this isn't really much of an issue. Signed-off-by: Patrick Steinhardt --- meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 7361eb2eaad422e7a6c6ed95d275615836c21cdb..213998986e8942cee080fc5b9b675860cf429ecc 100644 --- a/meson.build +++ b/meson.build @@ -170,7 +170,14 @@ project('git', 'c', meson_version: '>=0.61.0', - version: 'v2.47.GIT', + # The version is only of cosmetic nature, so if we cannot find a shell yet we + # simply don't set up a version at all. This may be the case for example on + # Windows systems, where we first have to bootstrap the host environment. + version: find_program('sh', required: false).found() ? run_command( + 'GIT-VERSION-GEN', meson.current_source_dir(), '--format=@GIT_VERSION@', + capture: true, + check: true, + ).stdout().strip() : 'unknown', ) fs = import('fs') From patchwork Tue Jan 14 11:56: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: 13938687 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (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 A66AA20F999 for ; Tue, 14 Jan 2025 11:56:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855783; cv=none; b=OlaCqCb9SNozwBgvJ8REglMy6nSUqPnaf+eKLsn4nFo3ZR9QCkpHHPRL9c1a3IedHZhR8V7COOcuOjlUpPy9LDDQiMlbywp1GPRYVsibBYOw7dwr7z0LiTzQnRHC2B/xTbzgith8GvjdPnq+z3vSVYL+p0j8lB3Yi/APGNSxtd8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855783; c=relaxed/simple; bh=ZM+WzAGpkE0oovaS89+C4vmVLlw1GZudC7zMuujq1vQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j/rErDyeJg89aSh6hr7m6fWC+enPh/q9H3/hBoZiKPxTeXYg3NwIPeAMt/ISCksCxBCKYwom0CBehhUx3PHynxG4S6kqyWCrXwxk7sHpD8QO4LgJfoQsKQObFsLR/N5q+sNs7CbGlUuBO26DrZ1AaKjwH/QDGNdtmH2hcl2Jor0= 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=jHoaKwTZ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Vf25u4to; arc=none smtp.client-ip=103.168.172.147 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="jHoaKwTZ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Vf25u4to" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id A941813801BC; Tue, 14 Jan 2025 06:56:20 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Tue, 14 Jan 2025 06:56:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1736855780; x=1736942180; bh=TgWqotxr6U9LactNVCZwwk7xHzcbzpMddPUeaMWcDjU=; b= jHoaKwTZbTc6LJvmRll5AIM0UIZFpdbSQYe8hNNeEPPTxYaL4u9pXUl5Cq9YRmla 7YEEaFPSiNf0JM4F1HViLUwbj5RCShza7/bCfo9AeNDT2SfK5qskQ9+jsgooJCKx 5PVYtap9GfltZFzunDbvhz73ab4YXx4U9dl9GQhMYqTeSZs/Onfwn66LBADPcE0Z n621U7fHDd+aREuItERAFJcCh09s9G7NZbx44o8W3WnRcOCGyR4KzAeTEzVRYNQO bTbVWLRLg13iQIVHMXw+x4tsj5EEHtUl5CjAshlLZVoxZkopPxGhNACGvJ3STPkr 2Q0cSniLMyfdp1LPhhRb2w== 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=fm2; t=1736855780; x= 1736942180; bh=TgWqotxr6U9LactNVCZwwk7xHzcbzpMddPUeaMWcDjU=; b=V f25u4tozTjoRT0X3nJLvyOiZXKxarA5OBHvPWIp+tP91leHd0w6lXT/JOnLP97Lq 2lOzNpuuLgUx9BBSbVaDt2O/kWZGh/+WT5ePp4nrGyTV4ShxWzzpWuSarNKCvGCx z/ICMlfQUtyFD5sFRIUotaQVWk1TLbYGblh6QMqvKpgLZCz0I31zWaAnDgPV0StV +2BkJeStciFIhN0f/NkZv6rRbIV6yL5pKexh3mOsytyBLLVlIBATWk283ndm1CyQ kGT8pWnHKD6Dk9jBnFn1E8NBnaHmejRTIkreCZ/uVknCVYL1vDk8puI699WlFA0g YZsB90+9yUgoTTe7fGh4g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtohepvghstghhfigrrhhtiiesghgvnhhtohhordhorhhgpdhrtghpthhtohep vghvrghnrdhmrghrthhinhesghhmrghilhdrtghomhdprhgtphhtthhopehgihhtshhtvg hrsehpohgsohigrdgtohhmpdhrtghpthhtohepmhhirhhthhdrhhhitghkfhhorhgusehg mhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:19 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id c85c0d0f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:16 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:14 +0100 Subject: [PATCH v2 04/11] meson: fix dependencies for generated headers Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-4-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 We generate a couple of headers from our documentation. These headers are added to the libgit sources, but two of them aren't used by the library, but instead by our builtins. This can cause parallel builds to fail because the builtin object may be compiled before the header was generated. Fix the issue by adding both "config-list.h" and "hook-list.h" to the list of builtin sources. While "command-list.h" is generated similarly, it is used by "help.c" and thus part of the libgit sources indeed. Reported-by: Evan Martin Signed-off-by: Patrick Steinhardt --- meson.build | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index 213998986e8942cee080fc5b9b675860cf429ecc..4053024dadeb0aafc067784b976ed3bd96171181 100644 --- a/meson.build +++ b/meson.build @@ -487,6 +487,13 @@ libgit_sources = [ 'xdiff/xutils.c', ] +libgit_sources += custom_target( + input: 'command-list.txt', + output: 'command-list.h', + command: [shell, meson.current_source_dir() + '/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'], + env: script_environment, +) + builtin_sources = [ 'builtin/add.c', 'builtin/am.c', @@ -614,14 +621,7 @@ builtin_sources = [ 'builtin/write-tree.c', ] -libgit_sources += custom_target( - input: 'command-list.txt', - output: 'command-list.h', - command: [shell, meson.current_source_dir() + '/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'], - env: script_environment, -) - -libgit_sources += custom_target( +builtin_sources += custom_target( output: 'config-list.h', command: [ shell, @@ -632,7 +632,7 @@ libgit_sources += custom_target( env: script_environment, ) -libgit_sources += custom_target( +builtin_sources += custom_target( input: 'Documentation/githooks.txt', output: 'hook-list.h', command: [ From patchwork Tue Jan 14 11:56: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: 13938688 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (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 07E14229611 for ; Tue, 14 Jan 2025 11:56:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855783; cv=none; b=rLOjF2tjhUzpHITMJOMNbq4ShQsYQm67oiL9o/IS6b6FQYoXCRqkF/SN5PurUzrGWr8RJm9KEK+v4sh6YGuM8klfJdOFP9FFBvc3P23Qv+4IUms590EorPv3zhdHhshZ3hXdo5xr/A/zG5/xTlWp6kTnDeTTtuQXAqFdsqjLP0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855783; c=relaxed/simple; bh=DVYLCjbCn53dNvrs6odJ8XPipiNq9HJEYlHN8wQNK3k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KTSMNCTQnO1XhNT3vLvrSxBdJoPOCZOD0l7E3qrrc/31Ve4/Blm0xpn9/4EcINp71J1myneLFOKiX8K8rjlB87KKEV4nW/bPghSnLmRzPmgMJwFFOTcFWQAP4fAnNMjWWqjs0MYIDIFRz9PJeJ2XxjjP2U+b4cj1WUTD2HV7nWM= 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=SRoapL4r; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=XBwfBHPg; arc=none smtp.client-ip=103.168.172.159 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="SRoapL4r"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="XBwfBHPg" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id 098381140169; Tue, 14 Jan 2025 06:56:21 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Tue, 14 Jan 2025 06:56:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1736855781; x=1736942181; bh=pSwOC7avqCxD9R2LOJxx8WX9Xynae/2LDs9vdLOsp1w=; b= SRoapL4r5h2SaspHmoyaOIz/m0cawsu7LhXYkvYhTgwFUfopOTodnRApa5vPxbBq VQ/wmNZsicEdeV+7HHTIWCr6atBCiNXtDWFy0WjptCj37EhL7rI3LVYiPNlKw22X mhPjP8vtn/ZbZYMMGHws6ZTsxAwbBL0Fxqn5nOEqH09HH8xYHXoQsysIpqzT4t5j 9is92cYFSs8ky5hlcD02lqgwHdzMzZfRJxHzaM08XXvAhGaMD68AtdKB4QQz66vi iRjw7S8b81lkZlQOldCasoECW81R0R8S/cQ1C8jsEtF9H9dAXRYC11arn+Xoy2lj 1xOF+RJprAftOGkdY5LWPQ== 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=fm2; t=1736855781; x= 1736942181; bh=pSwOC7avqCxD9R2LOJxx8WX9Xynae/2LDs9vdLOsp1w=; b=X BwfBHPgqt3hm98JhQ3rNPJHUgQYtJseokkaa0/H4aEQlvQDVfTfZl2cfLEyZiOdd aqM5w1toYWwnbcqXfLz/KxSkpLKe0sR1WnOX118PcgmpHiEFP2AmLbnWV3Lb4fwJ DP10varhzYM52Ng4Z9HqlI1SiHnG4ObU9sZXwcUvsXfDsYe543Xc9SrkLjTzyx4c /e3WJCWSba4m/FVeyA24nTfm0/HrKP6xW7xDwBLt7bTvFsCA4rWiyRcXy7Cq4OwG 4DnI2aipIsZv21Ym0ueAPnCGQWjNN9LvFqZqxGQiMb1mFD6Oyo4oRyy8hDGR8CHM Jl/NyxgRs16bjjSN9Mz4Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhhirhhthhdrhhhitghkfhhorhgusehgmhgrihhlrdgtohhmpdhrtghp thhtohepghhithhsthgvrhesphhosghogidrtghomhdprhgtphhtthhopegvshgthhifrg hrthiisehgvghnthhoohdrohhrghdprhgtphhtthhopegvvhgrnhdrmhgrrhhtihhnsehg mhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:19 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 94011171 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:17 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:15 +0100 Subject: [PATCH v2 05/11] meson: wire up development environments Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-5-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 The Meson build system is able to wire up development environments. The intent is to make build artifacts of the project available. This is typically used to export e.g. paths to linkable libraries, which isn't all that interesting in our context given that we don't have an official library interface. But what we can use this mechanism for is to expose the built Git executables as well as the build directory. This allows users to play around with the built Git version in the devenv, and allows them to execute our test scripts directly with the built distribution. Wire up this feature, which can then be used via `meson devenv` in the build directory. Signed-off-by: Patrick Steinhardt --- meson.build | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meson.build b/meson.build index 4053024dadeb0aafc067784b976ed3bd96171181..ab4f229436d3070de692a24c3a196a79d214b46f 100644 --- a/meson.build +++ b/meson.build @@ -1939,6 +1939,14 @@ configure_file( configuration: build_options_config, ) +# Development environments can be used via `meson devenv -C `. This +# allows you to execute test scripts directly with the built Git version and +# puts the built version of Git in your PATH. +devenv = environment() +devenv.set('GIT_BUILD_DIR', meson.current_build_dir()) +devenv.prepend('PATH', meson.current_build_dir() / 'bin-wrappers') +meson.add_devenv(devenv) + summary({ 'curl': curl.found(), 'expat': expat.found(), From patchwork Tue Jan 14 11:56: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: 13938689 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (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 2ACAD229629 for ; Tue, 14 Jan 2025 11:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855783; cv=none; b=a9kp27Oa5TIz3Yw/y7MiBtEKvPUwntDLUJnFQXrq/w9OLb3xJxEVGNuUOu0P0aQWaEBH5UwGxMpEev759cub/iInz3glLJSsjgozOi/Etto7MQQ5ueJhjyr7MogqwGrWsYluIQz4F9ohRyjsNCaIjB+h3uXKpRl4lBdMJa9cIF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855783; c=relaxed/simple; bh=hNlRZ5DSrQgBj6xo3lQv+te4RcCfQgl0dZdFkzDhCwA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A9wb5lIMOWAQFS4eCk18WqF7SGYmq96USpphMUWix2Xr/pRV5gQKRUPOi4zOu5mGvTP0cYhFsmjxmL+No+P622un/NHvIBjaPKyDDfMJ/Pa66jOgojba6v4AOBfZ69Pe/2lnFyOcDbOpxpNDrlduSa2HBuPp5eWvltLFiPv89p8= 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=vZdQw9GW; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=dQxhutck; arc=none smtp.client-ip=103.168.172.147 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="vZdQw9GW"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="dQxhutck" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 644751380214; Tue, 14 Jan 2025 06:56:21 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 14 Jan 2025 06:56:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1736855781; x=1736942181; bh=BO0jNhl3ws4p7GWFz1ENpTowbP6Zga+LkLtSypSP6iw=; b= vZdQw9GWO+6uTvqMn5WWzIf3v4aJ7tynFOWEafh7cMbEEMWGgJ2dCtC13NJA6H3w 16ZKuWTdWz7r4gvkXpfVnsgIBL41Q1m2fLYsVjcuoOcZZ0wAtz55aBkeMrrWKjVc LtRogMdtjiY1fvFjBlFvXWmqh0CM/PHbfuHnzZGxrL/gOoK3ElOjEInfRQkFb5IU XwJO/qyHy48dR5b+3bF1bwwqvzNmlMl5pig5s4G2jPw2pad8W25Dio2KIGnik+65 PWFa5gHaPWq2V2gvpb1+Mx/6CQcTE+RPIeEPARcxG3pC89XPmskpvOAWCab4Jojv ciGwJJSc79Q+chusZEpdzg== 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=fm2; t=1736855781; x= 1736942181; bh=BO0jNhl3ws4p7GWFz1ENpTowbP6Zga+LkLtSypSP6iw=; b=d Qxhutck24Bm5KVNSEZtUSRy21FEM1yI+nez6W9a0neSkiC3r8yUukaXJiU7/qjIn H5xAF/M4+6RFwVCVb1iqiyM9iRfrII9By4zb6NCoAQLnRN+K/R5vNsZ1t0L9yWOp VoGBtDH83Z8CCC2O4avISBxV30V729fs5clXpOc16+B/iSLZGpR+EX+3IUq7DmIV ttWOyTKE7zmRjJvvg26GBHqpI6JqBnMVS0UJjexICE6NkC/sVXQcSNRWFXjfTs/T meqwglmWZSTfcMNgEycF0V5cWbEhPX0wY5sPFoygU8+9NoWY5Mgqe7ook6is2WNH RTlTTyrE9VQUyYyyV5gjg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomhdprhgtphhtthhopegvshgt hhifrghrthiisehgvghnthhoohdrohhrghdprhgtphhtthhopehmihhrthhhrdhhihgtkh hfohhrugesghhmrghilhdrtghomhdprhgtphhtthhopegvvhgrnhdrmhgrrhhtihhnsehg mhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:19 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id eeb6de27 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:18 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:16 +0100 Subject: [PATCH v2 06/11] meson: wire up generation of distribution archive Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-6-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 Meson knows to generate distribution archives via `meson dist`. In addition to generating the archive itself, this target also knows to compile and execute tests from that archive, which helps to ensure that the result is an adequate drop-in replacement for the versioned project. While this already works as-is, one omission is that we don't propagate the commit that this is built from into the resulting archive. This can be fixed though by adding a distribution script that propagates the version into the "version" file, which GIT-VERSION-GEN knows to read if present. Use GIT-VERSION-GEN to populate that file. As the script is executed in the build directory, not in the directory where we generate the archive, we have adapt it to honor the "MESON_DIST_ROOT" environment variable. Signed-off-by: Patrick Steinhardt --- GIT-VERSION-GEN | 4 ++++ meson.build | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 9d201a98fd2766911544225c62159cbfe8dff5fe..f6764555ce6fd46ca4ddbaebb3b48809707e60f8 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -28,6 +28,10 @@ case "$2" in esac OUTPUT="$3" +if test -n "$OUTPUT" && test -n "$MESON_DIST_ROOT" +then + OUTPUT="$MESON_DIST_ROOT/$OUTPUT" +fi # Protect us from reading Git version information outside of the Git directory # in case it is not a repository itself, but embedded in an unrelated diff --git a/meson.build b/meson.build index ab4f229436d3070de692a24c3a196a79d214b46f..5d074134195e5689d08da5597f0859d9623d014e 100644 --- a/meson.build +++ b/meson.build @@ -1947,6 +1947,18 @@ devenv.set('GIT_BUILD_DIR', meson.current_build_dir()) devenv.prepend('PATH', meson.current_build_dir() / 'bin-wrappers') meson.add_devenv(devenv) +# Generate the 'version' file in the distribution tarball. This is used via +# `meson dist -C ` to populate the source archive with the Git +# version that the archive is being generated from. GIT-VERSION-GEN knows to +# pick up this file. +meson.add_dist_script( + shell, + meson.current_source_dir() / 'GIT-VERSION-GEN', + meson.current_source_dir(), + '--format=@GIT_VERSION@', + 'version', +) + summary({ 'curl': curl.found(), 'expat': expat.found(), From patchwork Tue Jan 14 11:56: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: 13938690 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (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 03070243325 for ; Tue, 14 Jan 2025 11:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855784; cv=none; b=OBRPwTrWser7ocd5y3NmbQLucJ8emfUlsBsacZWtH/qSkRRny3vaesSQRhIt8uJi36VXtz8Spt8bMZLkAln5ZzTzDAE5qVFsjSqegbPSia2tQHch+u9qZOpzLx8a9mLikbdDDGzOAMG/MOjAYq+3yk3QuvdJpNxL013tXsoC2Ns= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855784; c=relaxed/simple; bh=p3U/Q1YUmlJi8irPErJ8hExxM6ngOvRMchGGMSFu/EU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QHVBGFq7oEvohNfmt6E9ELLfMeLGUbN26gQpwiGykgA1z3PZ+tLrGuy8okgRdxN8CJvZvq/FngtS6QxnPNwKrcNBCDIrui666P37c8xomnYUGCKdLE94D278lEenxaCBMhBIshnwbC0wxH7EJx9y+w4SEdkjSlFaVo/qrkfgVJ8= 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=oTtnR4Pa; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=HZiOhCLd; arc=none smtp.client-ip=103.168.172.147 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="oTtnR4Pa"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HZiOhCLd" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 0B0FF138029B; Tue, 14 Jan 2025 06:56:22 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Tue, 14 Jan 2025 06:56:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1736855782; x=1736942182; bh=tGW0u5900v7aoumL6YmDh64gT5842dDFdXHh9GFbFMM=; b= oTtnR4PaNQp4YOl8z0HX3j7DXoLG+EsThrkzJCv77cuNXyHmg0bR6vtqpx0wwCb9 8rYSS78gi5sJDgIhLlolEl9WELGkK87qzVtq12WdRd5O2qHoyO2IGKm7yyJJgNrv QazqFV/F3Wn2GcIhJfFM0hSYSoVMSDxQtBuIGqsFPHGKN+cRVyZVD7dhxg+r96yO n7mD8/Q7oobelh9loPA/Du4xlkKtAUHh2fwhIGrwnpSuhmLQxuhhZTA8NnN87eWm 4Nz2Lf4iTatdQQFsCrMyiDRQs7t4HIq2Acuy0Y8Fe3ZWvYdEHOfNA4m2qnshRqP+ p0r3avQ/HirleawRcPSU4w== 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=fm2; t=1736855782; x= 1736942182; bh=tGW0u5900v7aoumL6YmDh64gT5842dDFdXHh9GFbFMM=; b=H ZiOhCLdjs5N6TrK7pPVjLI1oaysFIzU6nbsTfvl+2wLfX5ZUYYREpLyurkQqAuNg qSUfGlgz/Qu/tZiCK1h+hEYFHRZlNE9M2A6f9GOL/lPpGASdH0nx/vfQXKQAZ6Sz pcWEcWU5UR5sRj7WIm9xp5xYHUjEt4WP0cS4WDQZN+T+T4iOQd3JaserCf08cbMx kxKSWaS7ZFVlThayht5xGLGYE8hjiJZTfX6/4en8rc3aGhUQmxLlbHEWxxJMOGot 0xVmVDabmQxoEbq2HvkmjjP+S7cF1FXCcsvk2f+tzmSmBHpnb7A7AGPtxeed4ASC i7O2fjscL2aZHHRLPWg8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegvshgthhifrghrthiisehgvghnthhoohdrohhrgh dprhgtphhtthhopegvvhgrnhdrmhgrrhhtihhnsehgmhgrihhlrdgtohhmpdhrtghpthht ohepghhithhsthgvrhesphhosghogidrtghomhdprhgtphhtthhopehmihhrthhhrdhhih gtkhhfohhrugesghhmrghilhdrtghomhdprhgtphhtthhopehgihhtsehvghgvrhdrkhgv rhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:20 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id cae2bbda (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:19 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:17 +0100 Subject: [PATCH v2 07/11] meson: wire up fuzzers Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-7-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 Meson does not yet know to build our fuzzers. Introduce a new build option "fuzzers" and wire up the fuzzers in case it is enabled. Adapt our CI jobs so that they build the fuzzers by default. Signed-off-by: Patrick Steinhardt --- ci/run-build-and-tests.sh | 3 ++- meson.build | 4 ++++ meson_options.txt | 2 ++ oss-fuzz/meson.build | 20 ++++++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 76667a1277720d74e09e8da227b5e0832003e0e2..6c828c3b755153dab179f73346e7124bda49c90e 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -53,7 +53,8 @@ case "$jobname" in *-meson) group "Configure" meson setup build . \ --warnlevel 2 --werror \ - --wrap-mode nofallback + --wrap-mode nofallback \ + -Dfuzzers=true group "Build" meson compile -C build -- if test -n "$run_tests" then diff --git a/meson.build b/meson.build index 5d074134195e5689d08da5597f0859d9623d014e..95baada74af8f7731867e7075d9986b32a034ff4 100644 --- a/meson.build +++ b/meson.build @@ -1906,6 +1906,10 @@ if get_option('tests') subdir('t') endif +if get_option('fuzzers') + subdir('oss-fuzz') +endif + subdir('bin-wrappers') if get_option('docs') != [] subdir('Documentation') diff --git a/meson_options.txt b/meson_options.txt index 89b01bad042b533b23e0e2b4b780ce152ee688c8..34ba679cf931b67a794a9bb7e765bfb22106381e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -95,3 +95,5 @@ option('tests', type: 'boolean', value: true, description: 'Enable building tests. This requires Perl, but is separate from the "perl" option such that you can build tests without Perl features enabled.') option('test_output_directory', type: 'string', description: 'Path to the directory used to store test outputs') +option('fuzzers', type: 'boolean', value: false, + description: 'Enable building fuzzers.') diff --git a/oss-fuzz/meson.build b/oss-fuzz/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..ed79665501655eae4948623c07114fab23a55393 --- /dev/null +++ b/oss-fuzz/meson.build @@ -0,0 +1,20 @@ +fuzz_programs = [ + 'fuzz-commit-graph.c', + 'fuzz-config.c', + 'fuzz-credential-from-url-gently.c', + 'fuzz-date.c', + 'fuzz-pack-headers.c', + 'fuzz-pack-idx.c', + 'fuzz-parse-attr-line.c', + 'fuzz-url-decode-mem.c', +] + +foreach fuzz_program : fuzz_programs + executable(fs.stem(fuzz_program), + sources: [ + 'dummy-cmd-main.c', + fuzz_program, + ], + dependencies: [libgit, common_main], + ) +endforeach From patchwork Tue Jan 14 11:56: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: 13938691 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (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 0301124025B for ; Tue, 14 Jan 2025 11:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855784; cv=none; b=U8x9835kLWjGTNF90e9lp7rmn1dyqoijUeiLRGkpsjBSp/Un7dZxdusO/67O0Q0e+G33dO7j1u95v37EiNX2wgA4HS2BwSs6eMBvP+XMqGw6ZT90diMCJW+X1DA1Rhd4g99cINpQDXs+2wLOxWPNIvwru2MAHnHfu5kQVjrU+oM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855784; c=relaxed/simple; bh=1/ZMGrjHzkYgB+k/z2RG+GIoGpdJOTe6AlYZQ2TGW8k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V803wvi8L7IiVqA+xkVSS7laFfaj/N5Tu2KgHNlBYr+Y8EY0tukxjRZOvWpP+BHBElsHDDTzxDmxFTd+GSDIF7ubyJ3x5PIc/dllr4Mnaiiovfm7QrMGynJHlMdhZhBDEa2zZ3RIoIXdgPYtBF1990++gf/Kr5XDlspDlpGA82Y= 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=kO3R40WU; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=XnvWVdjq; arc=none smtp.client-ip=103.168.172.147 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="kO3R40WU"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="XnvWVdjq" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 56F5913802DA; Tue, 14 Jan 2025 06:56:22 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Tue, 14 Jan 2025 06:56:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1736855782; x=1736942182; bh=NdXRFBALmsgg9pu8o5pE0rU71pzDb0632ki0cnaDLWY=; b= kO3R40WUzVRsEE/xdvQhzYmdeRVTaQqA94Xm3WE+9HLijnBTx8Cya8PiA2xGQckI y9uDfXxlPG4CO46PpjkAJeY9TGt950k5TzrLjGTQ0IyJj+iVJKdlhE4jX1ZbA0RM YeLzopuuwdHqit8ECT2WKdKvQ7NW49iunlRH8q6oIAmkk2AhWBhL87UUxPAsB9TW r95bJgATMxBVAm4PIAdzOdIzpmZazS45mCWtBCHUTM5QkniWtrrqDrlLiSZ4o0ts DqLeisFbAdzfhaXxs1dD4ZK5baltPo+n0hxbLg/6xgu6NP8rn3ZumrhJRoOrtFnE 6wf6Iav4tp44Q8fStlyKHw== 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=fm2; t=1736855782; x= 1736942182; bh=NdXRFBALmsgg9pu8o5pE0rU71pzDb0632ki0cnaDLWY=; b=X nvWVdjqklC3d/j0kEWM0+3ovGHr968CyXqzLJwZuK4mfhomGVtgs+i2Us1FHMN1G AE3O9hQG8w5x7AeG0i75MztwJ6Xe7Fa6VOQqZds+IdPCTd3LKgENExA4uCzWu/K/ FX8gdB3BaI8zGMxblog2+OazFRnmVvRxUDNTTCoe67I5IaXzZD7bAxoRzJkjd0jU ekyliWwgtsUlIIlZXaIJiPhgMl+XWl9mOc41GBfiIv4hJ8PMhFRpBqhe/4+/R2bZ pqvZaYKk6pY7w9kLNiT1l6o4rE6nwihG/vjYWzqS1QYQ+3yQjaymSFtI5fqvY3u6 fFpFo/w5FPCdDRYTs/3MQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegvvhgrnhdrmhgrrhhtihhnsehgmhgrihhlrdgtoh hmpdhrtghpthhtohepmhhirhhthhdrhhhitghkfhhorhgusehgmhgrihhlrdgtohhmpdhr tghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegvsh gthhifrghrthiisehgvghnthhoohdrohhrghdprhgtphhtthhopehgihhtshhtvghrsehp ohgsohigrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:21 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 8b26b81c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:20 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:18 +0100 Subject: [PATCH v2 08/11] meson: make the CSPRNG backend configurable Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-8-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 The CSPRNG backend is not configurable in Meson and isn't quite discoverable, either. Make it configurable and add the actual backend used to the summary. Signed-off-by: Patrick Steinhardt --- meson.build | 28 +++++++++++++++++++++------- meson_options.txt | 2 ++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 95baada74af8f7731867e7075d9986b32a034ff4..e50ccac5c9f6d310d8c9f83d893ea802b5827252 100644 --- a/meson.build +++ b/meson.build @@ -1332,6 +1332,7 @@ if not meson.is_cross_build() and fs.exists('/dev/tty') libgit_c_args += '-DHAVE_DEV_TTY' endif +csprng_backend = get_option('csprng_backend') https_backend = get_option('https_backend') sha1_backend = get_option('sha1_backend') sha1_unsafe_backend = get_option('sha1_unsafe_backend') @@ -1343,7 +1344,7 @@ if https_backend == 'auto' and security_framework.found() https_backend = 'CommonCrypto' endif -openssl_required = 'openssl' in [https_backend, sha1_backend, sha1_unsafe_backend, sha256_backend] +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']) if https_backend == 'auto' and openssl.found() https_backend = 'openssl' @@ -1428,18 +1429,30 @@ else error('Unhandled SHA256 backend ' + sha256_backend) endif -if compiler.has_header_symbol('stdlib.h', 'arc4random_buf') +# Backends are ordered to reflect our preference for more secure and faster +# ones over the ones that are less so. +if csprng_backend in ['auto', 'arc4random'] and compiler.has_header_symbol('stdlib.h', 'arc4random_buf', required: csprng_backend == 'arc4random') libgit_c_args += '-DHAVE_ARC4RANDOM' -elif compiler.has_header_symbol('bsd/stdlib.h', 'arc4random_buf') + csprng_backend = 'arc4random' +elif csprng_backend in ['auto', 'arc4random_bsd'] and compiler.has_header_symbol('bsd/stdlib.h', 'arc4random_buf', required: csprng_backend == 'arc4random_bsd') libgit_c_args += '-DHAVE_ARC4RANDOM_BSD' -elif compiler.has_function('getrandom', prefix: '#include ') + csprng_backend = 'arc4random_bsd' +elif csprng_backend in ['auto', 'getrandom'] and compiler.has_header_symbol('sys/random.h', 'getrandom', required: csprng_backend == 'getrandom') libgit_c_args += '-DHAVE_GETRANDOM' -elif compiler.has_function('getentropy', prefix: '#include ') + csprng_backend = 'getrandom' +elif csprng_backend in ['auto', 'getentropy'] and compiler.has_header_symbol('unistd.h', 'getentropy', required: csprng_backend == 'getentropy') libgit_c_args += '-DHAVE_GETENTROPY' -elif compiler.has_function('RtlGenRandom', prefix: '#include \n#include ') + csprng_backend = 'getentropy' +elif csprng_backend in ['auto', 'rtlgenrandom'] and compiler.has_header_symbol('ntsecapi.h', 'RtlGenRandom', prefix: '#include ', required: csprng_backend == 'rtlgenrandom') libgit_c_args += '-DHAVE_RTLGENRANDOM' -elif openssl.found() + csprng_backend = 'rtlgenrandom' +elif csprng_backend in ['auto', 'openssl'] and openssl.found() libgit_c_args += '-DHAVE_OPENSSL_CSPRNG' + csprng_backend = 'openssl' +elif csprng_backend in ['auto', 'urandom'] + csprng_backend = 'urandom' +else + error('Unsupported CSPRNG backend: ' + csprng_backend) endif if get_option('runtime_prefix') @@ -1976,6 +1989,7 @@ summary({ }, section: 'Auto-detected features') summary({ + 'csprng': csprng_backend, 'https': https_backend, 'sha1': sha1_backend, 'sha1_unsafe': sha1_unsafe_backend, diff --git a/meson_options.txt b/meson_options.txt index 34ba679cf931b67a794a9bb7e765bfb22106381e..5429022f30621105cd6974e4260cca60e5f24324 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -47,6 +47,8 @@ option('regex', type: 'feature', value: 'auto', description: 'Use the system-provided regex library instead of the bundled one.') # Backends. +option('csprng_backend', type: 'combo', value: 'auto', choices: ['auto', 'arc4random', 'arc4random_bsd', 'getrandom', 'getentropy', 'rtlgenrandom', 'openssl', 'urandom'], + description: 'The backend to use for generating cryptographically-secure pseudo-random numbers.') option('https_backend', type: 'combo', value: 'auto', choices: ['auto', 'openssl', 'CommonCrypto', 'none'], description: 'The HTTPS backend to use when connecting to remotes.') option('sha1_backend', type: 'combo', choices: ['openssl', 'block', 'sha1dc', 'CommonCrypto'], value: 'sha1dc', From patchwork Tue Jan 14 11:56: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: 13938692 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (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 CD43928EC68 for ; Tue, 14 Jan 2025 11:56:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855785; cv=none; b=sI1zPSa7HJxHtA7QcOB0PikcrvTpJvt+872Mob4gqp68knIIk6j2CvnOartUk3F64QpiYn7w+OtZluUd69M0ArX/PLq9e4oldjKnR5BeAJUUkAwxnJpR7uqIfzDYgRbZb0XnXRPT5Jg+V5if3f3l5uwx/ovqancvXMqiW/6ggi4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855785; c=relaxed/simple; bh=gSXySZCGfIUynZg8Ht3OzPKekirWtkNlLj8WG+FowHQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RMy+5YQvxBsPuHK/vfbV2C5bdGveuXyjs5spEXIHvoO/FOUXeW47qp4z9+2zSqk1Ga7MVh7Ot5FH8LWYlYzMDD8wW6hvWAQV095k2W+F4oBz9fnp1xhJrb7rpJ9QKGBCQ6hPMoo7YQNqjdasPWNPCmizMx3kyjjSeKSnI+mscyc= 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=H7rSwgZR; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=BnVNM5SY; arc=none smtp.client-ip=103.168.172.159 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="H7rSwgZR"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="BnVNM5SY" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id D5533114012E; Tue, 14 Jan 2025 06:56:22 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 14 Jan 2025 06:56:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1736855782; x=1736942182; bh=uqIbFGoX0ckU+WgLwVHZdvC+uiC4WT9vjcxZAJoo4qk=; b= H7rSwgZR+RRtz4ZCKdtvX7NWWm7pREXqKXMv7/0oKoV8s2eq7S3KiP7ROzG80WB0 g916fgopY4mT+/DlMUfYMhTLW6quDRINGaZmzX+CvQ+Nyb1Vk+oRkYfpljr69fJB JEymERgX+JyYnYalqy6LwJklzwLAnKufBakGtcq9nLFmh8IR+Z/mXkiiHt0W51AG hEK0rxnkfXUNr1ZhmOswsq9Sivtqcn25ukaNy67AY6sWQmu5midmC5MqLwSwC4Xu tGXoqnBh5QTMXOz9gjXNufTnUsCZfVQmZ/bjx3xjN/wDj4bzYy/1BzwowmygOBR9 w5ManxoUhgWu3n4krJjUZg== 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=fm2; t=1736855782; x= 1736942182; bh=uqIbFGoX0ckU+WgLwVHZdvC+uiC4WT9vjcxZAJoo4qk=; b=B nVNM5SYKqnE4l3GJHvMsxB/03vZjSD/nP82rc8lskNCJpF1h3wnrPtoHBJcJuOrE /QJzvjMsQfzherio/rRWNpqV7mqfS8VmXPCGfkIf4bH6sDLbdK0knuLC4jUvDgn3 2Fcgh1+f9UQSqznCusGP3ChjoI+ULnErhtTPokVn2J3Me7TbBwnIUFMYxzeX2Uhh 0bwqJPRZjw7TXom+VcpFiaAQh1BXdeK1jScG4r+21GKUN6YQSh40W6SYnN1LIaIp 1ESuwd+dUmqixkw+4ljgX33edf/Bdxv8U4pLJ7MbcquUAxa1UL2u1ABNkcHMIrum H9nTzvZ3Ew9yXQdDlmlMQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtshhtvghrsehpohgsohigrdgtohhmpdhrtg hpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehmihhr thhhrdhhihgtkhhfohhrugesghhmrghilhdrtghomhdprhgtphhtthhopegvvhgrnhdrmh grrhhtihhnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepvghstghhfigrrhhtiiesghgv nhhtohhordhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:21 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 74a7b537 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:21 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:19 +0100 Subject: [PATCH v2 09/11] meson: fix compilation with Visual Studio Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-9-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 The Visual Studio compiler defaults to C89 unless explicitly asked to use a different version of the C standard. We don't specify any C standard at all though in our Meson build, and consequently compiling Git fails: ...\git\git-compat-util.h(14): fatal error C1189: #error: "Required C99 support is in a test phase. Please see git-compat-util.h for more details." Fix the issue by specifying the project's C standard. Funny enough, specifying C99 does not work because apparently, `__STDC_VERSION__` is not getting defined in that version at all. Instead, we have to specify C11 as the project's C standard, which is also done in our CMake build instructions. We don't want to generally enforce C11 though, as our requiremets only state that a C99 compiler is required. In fact, we don't even require plain C99, but rather the GNU variant thereof. Meson allows us to handle this case rather easily by specifying "gnu99,c11", which will cause it to fall back to C11 in case GNU C99 is unsupported. This feature has only been introduced with Meson 1.3.0 though, and we support 0.61.0 and newer. In case we use such an oldish version though we fall back to requiring GNU99 unconditionally. This means that Windows essentially requires Meson 1.3.0 and newer when using Visual Studio, but I doubt that this is ever going to be a real problem. Tested-by: M Hickford Signed-off-by: Patrick Steinhardt --- meson.build | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meson.build b/meson.build index e50ccac5c9f6d310d8c9f83d893ea802b5827252..30d7a894904dfe86bedb2a7a8de25529502403e5 100644 --- a/meson.build +++ b/meson.build @@ -178,6 +178,14 @@ project('git', 'c', capture: true, check: true, ).stdout().strip() : 'unknown', + default_options: [ + # Git requires C99 with GNU extensions, which of course isn't supported by + # MSVC. Funny enough, C99 doesn't work with MSVC either, as it has only + # learned to define __STDC_VERSION__ with C11 and later. We thus require + # GNU C99 and fall back to C11. Meson only learned to handle the fallback + # with version 1.3.0, so on older versions we use GNU C99 unconditionally. + 'c_std=' + (meson.version().version_compare('>=1.3.0') ? 'gnu99,c11' : 'gnu99'), + ], ) fs = import('fs') From patchwork Tue Jan 14 11:56: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: 13938693 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (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 4A7C628EC91 for ; Tue, 14 Jan 2025 11:56:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855785; cv=none; b=tIfuGu397mei3DzMI1OIkfzsFxaw2W1rsBKnO6UKruWKYtoD08pRo5qKKm80gcv8cr2MQ/NrvaZ6bwStxzdQRWre+E5gFO66Uwk+QrVSn7z15vwk4ffZ9IrMr13CTOkJikBAu6vZa0JBsscMlEpUqbE1+mATT4gdWhWR/A60W+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855785; c=relaxed/simple; bh=UM2eqku/ZOVM12Xp8OXQTv3skvz3RQUKKnUxKPH6GLg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N2c34Te3LPHJvWO9lKtIQxCMns/TDIsNpDjcGmzNnFVBZrpq+2OdgDzK78hsoZHJmi2hb3F9Uuzze8U/rOD0c5LoI7P8WFemX3qdtZX1QZcyYz6MPS0v7N5GKaphWlyX5ifKgjBaA4FrCcSD2ZdzI+/stE/UoJiNc8CnUDfTZVc= 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=Bf/52B8z; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=IUEhe0Ng; arc=none smtp.client-ip=103.168.172.159 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="Bf/52B8z"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="IUEhe0Ng" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5B9F7114015B; Tue, 14 Jan 2025 06:56:23 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Tue, 14 Jan 2025 06:56: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=fm2; t=1736855783; x=1736942183; bh=pco7noKo0yiW6uDdt3Ue0s3iDrCPIIm2ghhYXyasGkA=; b= Bf/52B8zR42SXmHBezX3mbqS3g7pfaFjOve0eGaOQTxyjA/RoJtihPqXSuLBMWnq HY+qYBmAUF0z1IUsNk0UPxPgaKuRzYgHoMwhJo4d+jmgWFwuspLxqP2DE4fN+kDC bhsmCkBph2Ume+oCFnHqlVeemMvbMxVZXMsNeQHs0TnnihKQ4Rm8pMgKiBF19O4m V8Y46EyRTc8M+wwiXuxVYq1a2u+hg8D0kB9KXs0G2WXbFbtJUvgFzmYrjjxDetS6 46UgkJpqxd9gSSXdvgMKn0fJQDklcsUkzGCvoQXXPuLp9DdtRKhbs8iiFWOzfoou Pep93zxUsy2Jx8IwfJf/yg== 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=fm2; t=1736855783; x= 1736942183; bh=pco7noKo0yiW6uDdt3Ue0s3iDrCPIIm2ghhYXyasGkA=; b=I UEhe0NgncTjbdOf2PbIXrz+UE2yoDnF+3X/VN035t4WgrLgSeWj6yhG74FNeiO4c kLGpQO1F8zK+T+Tpip1xX6f3AFMI4w9MKKyH6pkrV6EV+KcS0UUhL2eGKI3qRyVm JVSueJbbk+4pjc2siiBGkFA9Cd2gHJQWzhS20UGVOqseHXsmS9ZJt6bHZyZ7aLN6 Bpim7SNraTOXeBwZ80CI6c39sRa12PnevOe7tQJNBXeQvzTLafDlgeoPrRCPae0a 2JCau+YGhOkiW4FkoGj/IOOW6GxRdx4eatnzMNPX2bfP/6EmkYR+ZD1WMMetld2F J6xGW9yviAG9D7/fb4Mow== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteekudeh jeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmh grihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehgihhtshhtvghrsehpohgsohigrdgtohhmpdhrtg hpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehmihhr thhhrdhhihgtkhhfohhrugesghhmrghilhdrtghomhdprhgtphhtthhopegvshgthhifrg hrthiisehgvghnthhoohdrohhrghdprhgtphhtthhopegvvhgrnhdrmhgrrhhtihhnsehg mhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:22 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 52e9405e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:22 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:20 +0100 Subject: [PATCH v2 10/11] ci: raise error when Meson generates warnings Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-10-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 Meson prints warnings in several cases, like for example when using a feature supported by the current version of Meson, but not yet supported by the minimum required version as declared by the project. These warnings will not cause the setup to fail by default, which makes it quite easy to miss them. Improve this by passing `--fatal-meson-warnings` to `meson setup` so that our CI jobs will fail on warnings. Signed-off-by: Patrick Steinhardt --- ci/run-build-and-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 6c828c3b755153dab179f73346e7124bda49c90e..964322055f5db0eae0c794b543664e24ae4249f7 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -52,6 +52,7 @@ esac case "$jobname" in *-meson) group "Configure" meson setup build . \ + --fatal-meson-warnings \ --warnlevel 2 --werror \ --wrap-mode nofallback \ -Dfuzzers=true From patchwork Tue Jan 14 11:56: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: 13938694 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (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 C827D3DABE3 for ; Tue, 14 Jan 2025 11:56:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855786; cv=none; b=HL9VSXPPnolvYlx8oyDwON+D4Dj5tfSJ+Zf4jgZGG1T7uckhoCaF9tNLc3iPW2lsnCUMZ8XLGGVEZFqoQs6eRtJPoekjXHlDG9llaLuJkZmGEkJWNkf06AvD3+dlmiJ31FBWuBIriYaPAKsXC+QN8qh8QoyNBgnAAvIqzYSyyjM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736855786; c=relaxed/simple; bh=pXZDLhfIsFDW4HiVgYHFY60hbxELcc7n7gejKucS+yA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DseV3YvkZzfqARMeXgMa7zhdY4ZVjZ7ZKtQHwIvSd89N5mPZ790oEhk+H0eMBnJsYwZ92aSU9DVcYgs2jh4YssL0y5TlJfjPw7l304w3u8aNGPh5TGp3oGBIpMRnzk477F3+EFRIK3k0ckJ8TsQ4TtcugXg/0DOGDdVhJvdn2BU= 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=Hhfe80k2; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=EfIoNaLs; arc=none smtp.client-ip=103.168.172.147 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="Hhfe80k2"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="EfIoNaLs" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 305BA13802FB; Tue, 14 Jan 2025 06:56:24 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 14 Jan 2025 06:56:24 -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=fm2; t=1736855784; x=1736942184; bh=GASN2Fh+DLEt2B1IRqXmBDtWc3S5ohSffczj+TY7KKA=; b= Hhfe80k23XwzduXoPfjhY2bbmNVtGHL1rM+HPdFsp/a71vE1aTRCVgCWNTfIy96p q3AWjHYsqsK7E2xhlPSWxoBC9tgJisKyBgZHG5Z2eMFVNjqXWiGs8DTz+sIPLYsH m7YbNIVQB3BQ/AgAf1bubY175sVHprxJmwZd+pYo1LL2oHtb7w2qRlk+SHz3RDI4 8pXc+gSMW+JR1OnOmihxg2bvw9iLCF8LDdxs/ZfhsFt90a+J3dJhgIBlPqC5egOy siDi+wk0fDGghlWE+pbORh3NLDnibRJ4QCiwLGZHH+Yd9uRvMF89hV3AyAMu+1jA pXHfuNCNNRcKHJqS7mtCiQ== 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=fm2; t=1736855784; x= 1736942184; bh=GASN2Fh+DLEt2B1IRqXmBDtWc3S5ohSffczj+TY7KKA=; b=E fIoNaLssjZjbEQGlQzie+I48M7fxep0BtYtNTp5TIIZWMvfuwzSfs+C6tj4vqfc/ 1/3QhvP+gQAnmL1IkZwXONyR4KbSmWkVM7hKPgE7R69ghIbMFsLeRKhxPr9rHJZp XeYWuiEQNsNEiKrS3Iq0M+qlicdZeFAiVkv/vm3E9vVKM1QAlOQHU8iBy15MOzBj BDJiva4YNmLbtd0WI5lWBnm8DC1P+6XfwbvPSclLvQ9/06yNl2D0ZCRbMdn8DQ54 PJ3xCLr83nm8uY3mpkeY4Lpt/YCMny29jZlrWvnOvQUDtm4gIPx9ryk3ftuvMck9 KSwoHSmNRwKhT0zFVd28A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeevlefgtddttddvtdduieelvefhkeeuhedvtdegiedt leekffeiffeljedvgfeuieenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhphihthh honhdrohhrghdphhgrgiigrdhsvgenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopeehpdhmoh guvgepshhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdho rhhgpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomhdprhgtphhtthhope hmihhrthhhrdhhihgtkhhfohhrugesghhmrghilhdrtghomhdprhgtphhtthhopegvshgt hhifrghrthiisehgvghnthhoohdrohhrghdprhgtphhtthhopegvvhgrnhdrmhgrrhhtih hnsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jan 2025 06:56:22 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id ac473ee3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jan 2025 11:56:22 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 14 Jan 2025 12:56:21 +0100 Subject: [PATCH v2 11/11] ci: wire up Visual Studio build with Meson Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250114-b4-pks-meson-additions-v2-11-8d7ec676cfd9@pks.im> References: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> In-Reply-To: <20250114-b4-pks-meson-additions-v2-0-8d7ec676cfd9@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford X-Mailer: b4 0.14.2 Add a new job to GitHub Actions and GitLab CI that builds and tests Meson-based builds with Visual Studio. A couple notes: - While the build job is mandatory, the test job is marked as "manual" on GitLab so that it doesn't run by default. We already have a bunch of Windows-based jobs, and the computational overhead that these cause is simply out of proportion to run the test suite twice. The same isn't true for GitHub as I could not find a way to make a subset of jobs manually triggered. - We disable Perl. This is because we pick up Perl from Git for Windows, which outputs different paths ("/c/" instead of "C:\") than what we expect in our tests. - We don't use the Git for Windows SDK. Instead, the build only depends on Visual Studio, Meson and Git for Windows. All the other dependencies like curl, pcre2 and zlib get pulled in and compiled automatically by Meson and thus do not have to be provided by the system. - We open-code "ci/run-test-slice.sh". This is because we only have direct access to PowerShell, so we manually implement the logic. There is an upstream pull request for the Meson build system [1] to implement test slicing in Meson directly. - We don't process test artifacts for failed CI jobs. This is done to keep down prerequisites to a minimum. All tests are passing. [1]: https://github.com/mesonbuild/meson/pull/14092 Signed-off-by: Patrick Steinhardt --- .github/workflows/main.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 900be9957a23fcaa64e1aefd0c8638c5f84b7997..7f55f8b3a91d6caf95934af308a2bd35a19a62f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -248,6 +248,58 @@ jobs: with: name: failed-tests-windows-vs-${{ matrix.nr }} path: ${{env.FAILED_TEST_ARTIFACTS}} + + windows-meson-build: + name: win+Meson build + needs: ci-config + if: needs.ci-config.outputs.enabled == 'yes' + runs-on: windows-latest + concurrency: + group: windows-meson-build-${{ github.ref }} + cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Set up dependencies + shell: pwsh + run: pip install meson ninja + - name: Setup + shell: pwsh + run: meson setup build -Dperl=disabled + - name: Compile + shell: pwsh + run: meson compile -C build + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: windows-meson-artifacts + path: build + windows-meson-test: + name: win+Meson test + runs-on: windows-latest + needs: [ci-config, windows-meson-build] + strategy: + fail-fast: false + matrix: + nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + concurrency: + group: windows-meson-test-${{ matrix.nr }}-${{ github.ref }} + cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Set up dependencies + shell: pwsh + run: pip install meson ninja + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: windows-meson-artifacts + path: build + - name: Test + shell: pwsh + run: meson test -C build --list | Select-Object -Skip 1 | Select-String .* | Group-Object -Property { $_.LineNumber % 10 } | Where-Object Name -EQ ${{ matrix.nr }} | ForEach-Object { meson test -C build --no-rebuild --print-errorlogs $_.Group } + regular: name: ${{matrix.vector.jobname}} (${{matrix.vector.pool}}) needs: ci-config diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9254e01583306e67dc12b6b9e0015183e1108655..4976e18a0503298f38230f5ba7348675baf48664 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -149,6 +149,44 @@ test:mingw64: - git-sdk/usr/bin/bash.exe -l -c 'ci/print-test-failures.sh' parallel: 10 +.msvc-meson: + tags: + - saas-windows-medium-amd64 + before_script: + - choco install -y git meson ninja openssl + - Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 + - refreshenv + # The certificate store for Python on Windows is broken and fails to fetch + # certificates, see https://bugs.python.org/issue36011. This seems to + # mostly be an issue with how the GitLab image is set up as it is a + # non-issue on GitHub Actions. Work around the issue by importing + # cetrificates manually. + - Invoke-WebRequest https://curl.haxx.se/ca/cacert.pem -OutFile cacert.pem + - openssl pkcs12 -export -nokeys -in cacert.pem -out certs.pfx -passout "pass:" + - Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\Root -FilePath certs.pfx + +build:msvc-meson: + extends: .msvc-meson + stage: build + script: + - meson setup build -Dperl=disabled + - meson compile -C build + artifacts: + paths: + - build + +test:msvc-meson: + extends: .msvc-meson + stage: test + when: manual + timeout: 6h + needs: + - job: "build:msvc-meson" + artifacts: true + script: + - meson test -C build --list | Select-Object -Skip 1 | Select-String .* | Group-Object -Property { $_.LineNumber % $Env:CI_NODE_TOTAL + 1 } | Where-Object Name -EQ $Env:CI_NODE_INDEX | ForEach-Object { meson test -C build --no-rebuild --print-errorlogs $_.Group } + parallel: 10 + test:fuzz-smoke-tests: image: ubuntu:latest stage: test