From patchwork Wed Jan 22 12:05:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13947219 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8BD2211A04 for ; Wed, 22 Jan 2025 12:05:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547554; cv=none; b=QckLwLV/HbM+E5CmZ/Yb0UJsj7m0N8daskmCzFKNM5HLyKksTWp9hhNNLPvdMI7Ey1FNgRk9caH9JYjwDoy7HgGnDNVf8KCR0QNfSBghKExgjfw46ZzFsb+HAwlBpq/PtTdVWlR0/SL7zsxSCFmHzy5aFrjK5rxkf8Pep7TT5N0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547554; c=relaxed/simple; bh=SNz+W5KyHThpkeUld53cKAIhGTl5SnveEvsSuV6M1kk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A5ccpmBY8kWo/eePtnfPunlWVNUeIX/YENezf67YKBpOH8eAlVjP8rLuKbugY+GljxJm0x0PWtUQ7UN/hJV9GY8nF6v+Na6eSr1B+uWw+79GjrlNrpfmnhDWRssl32w1vlS8hfhdu635BV63jPEyl5OF+862qxhUA9KVVAMPO/s= 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=rVR8oUNZ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=kpkRI45B; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="rVR8oUNZ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="kpkRI45B" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id BA09A138084A; Wed, 22 Jan 2025 07:05:51 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Wed, 22 Jan 2025 07:05:51 -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=1737547551; x=1737633951; bh=vy0jYuJFzTzYbPR4fPcvIHXOBMaQuaJxwwbnOhAgqaI=; b= rVR8oUNZTzJpjkseSNZ3Jd6WPB2LLq0DZadKlTddcb8K4eA7GdlKf+fDcJAdjKdZ 3mXSzJEYb9nmNVQt193Ck5KHVzvBmM/bznvuPqi6xgXGgcBq4Q8er7yPv41LjBZp GX8cU+XUY76uYn6g0+Qjzn9Et9COwGjeyxHcaiwPzkS53vKvmv02GrwUc2vNifAm w23n/iaAhwF3+3qOkiatAzaHt4V/eNBoSVuLPa5eiq05VMGWNzlU+RO250XsvsLj 5A/2wa2qbsKJsw2XKj4yZ40QU7yT75edyn9DK4VRzsvHPotTmzGQAJHzjX33PZWm UPcOTfYejAo3ZEzJmvemTQ== 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=1737547551; x= 1737633951; bh=vy0jYuJFzTzYbPR4fPcvIHXOBMaQuaJxwwbnOhAgqaI=; b=k pkRI45BgVK2BowC2uzOsyWY3LP50GDq7DndAWD59e+RjaDEAHN4Aso4WYYfRE7J5 Rl//dKfqKoIuDm1hJieSCscqURaUNiHoFnVE9ZPw6rOftoyleyRXLXdoqQW/WE6c 4qWI91Ef+8AXuj7jE7d32Iy8JK5HD5vxboikgGd+8eI/ZrbNrVyaQVZsnIUYMOVa ATAiTr8kMXDruCUFWENou0oEf9QtRkiBrP2kgngPnz0N+6kcLuS0HD+6CgmpiVRu XaclaYHIwhmFT42qxEKfQsOIHd3vmhkAFJ4pWYPkZ8q6Vg5lLAnal2EUOTH1plus SCzEf/Xp2L8I74KVIm9Iw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepfefhueegleehfeejkedtffehvdfhvdetfefgtddu ffduveevteegueeutdekhfegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepvghvrghnrdhmrghrthhinhesghhmrghilhdrtg homhdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthht ohepthhoohhnsehiohhttghlrdgtohhmpdhrtghpthhtohepmhhirhhthhdrhhhitghkfh horhgusehgmhgrihhlrdgtohhmpdhrtghpthhtohepvghstghhfigrrhhtiiesghgvnhht ohhordhorhhgpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:05:50 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id d3f31b2d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:48 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:44 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-1-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes 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 f2af817fea..b8b683b933 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 Wed Jan 22 12:05:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13947220 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EA1F212B1F for ; Wed, 22 Jan 2025 12:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547556; cv=none; b=ZiA2qqf2QKFnuASQlfAUDsWPdaE6HDFT0aDZnVRKVJJig8OEqGzLXTUUp2w19hmR+eyDNn6pnc4JXR4HetlrRejskFH2iXZZ9v4usrHZgqFNs3l2kfQDauQaBvprRfetm/Oj0fVsUEkGlPlQvES9aoukppKmGogorP2B0G3nziQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547556; c=relaxed/simple; bh=OJgDr53N9mr9neTmn/NxZo907K4+s7jNEqhCEZUOC04=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q6l3BlVko/rdOwcNLhhgHD28/wu516jiXIiKr5S5Vad/SKvIzTxJNctuEoZUmFgBmae9pJuYWwsbBf3MoxHzDEwi7TEhzPKgaSHgwRcylMgBv5xn9sIQhGACqiO7ThCxJgYNNyf9oxDflKE6PJl4M20goAUFCC9ZQF8v7WkR2Qs= 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=BJaAK7HW; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=wCO+pN4H; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="BJaAK7HW"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="wCO+pN4H" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id 499CC1140141; Wed, 22 Jan 2025 07:05:53 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Wed, 22 Jan 2025 07:05:53 -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=1737547553; x=1737633953; bh=fUZzubkqQmpkkKUta1dfLjqL0X3NP0+/cAhn6g57o0o=; b= BJaAK7HWOn0nV7x2bR5ZZahPwN+8heb0vBKDjp1jbHevmwEEXGesT9NDGRuJOx3n JPg5d0/T1VzcAMaBj9xWKgrl5IJiIScMsOa17wXrAfXrA4efLSYE6FqmWDzL4H+V +SZdKHKg3UOvmW+xJxoCEmMV3K3Nw/YMvhy6y9g0qACEX1vaVfDL8LRncwfm2FvF 1Dw47bnysBsTuyhg2Hs3ehsicwR1mDg8KQbrfA7Ncfm6eoYJw75UG0E+bq+6NWQP 8no8ewZLywKOzZV885AojDAm/TC/JjeZgB8eLdPg/DqWWx+IXUBQU3KVh919hZ8z knEBqWL+fDyUsCQ3QNsBug== 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=1737547553; x= 1737633953; bh=fUZzubkqQmpkkKUta1dfLjqL0X3NP0+/cAhn6g57o0o=; b=w CO+pN4HfYtQLADjC/PEUuqKk2GDwbVL+6RNFTnGqHe2GM+CTHi5ySlINCyfK8BW1 xxPXnZXOOt3dZ+555v4GJlFsgTUOfj3Qc7b8jwwYrGb4u8UHKWWWmbZU52tyMZPv h1J6tbpnpOMBfmAJDdl8TmXcv5JWSJDWNdg8/UXmFvtLSFjYrxZ2mA7PZfzRxtJ0 IJczogvXyWttkwinSVQE37jI2fnZNRnahnAhPlBVCUjUo5vRbrVUNoT0qmmhJ97r JKpp2pTVhcc65pg2KjTVdDNdHYpqXMVVnnZ4QVqLr4jLXXtfwetpDlNpAMZvkbO+ igXU8Rkoq1LSll4/pPneA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomhdprh gtphhtthhopehtohhonhesihhothgtlhdrtghomhdprhgtphhtthhopehmihhrthhhrdhh ihgtkhhfohhrugesghhmrghilhdrtghomhdprhgtphhtthhopehgihhtsehvghgvrhdrkh gvrhhnvghlrdhorhhgpdhrtghpthhtohepvghvrghnrdhmrghrthhinhesghhmrghilhdr tghomhdprhgtphhtthhopegvshgthhifrghrthiisehgvghnthhoohdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:05:51 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 570da590 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:49 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:45 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-2-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes 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 b8b683b933..9d201a98fd 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 Wed Jan 22 12:05:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13947221 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCC00212D68 for ; Wed, 22 Jan 2025 12:05:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547557; cv=none; b=VFuzr6sIXfik9amfzK8rgADg2Nc9L4x1AQ9i4QaFKO5cD3km9nbRqRvLpp1SSJTv3v99/Mp6QE0wt+P+8HYb969DOSq0F1WbseZ4CsKrQIEh24BfwO865KH8I+Dj2jEatyArr+71/Qfi43sV135DEBx/XbssXRf7Y1xNhpzPmiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547557; c=relaxed/simple; bh=UBFTHgn1IOr8SWTf+6qljlNV9IbsMwPcISTxkLd98M8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=USW5m8LeBssGeC190FsO7P/3gLZkQ7zEZFJrr1MrI+/XgEy9/T1I0fZHkyYFdyrKXky8YFkkEy9qeBgP3uncfLQZQNYO0IO1gL5eiOq/0G1hjuvWpvmXs0tpRLb3qj3VPp0G4mzaLOlLuXXZvO6DSslSzq/oBrdYoRzA0PUCj5E= 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=RgEgMTFP; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=tAa5kAkb; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="RgEgMTFP"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="tAa5kAkb" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id CADDA11400B4; Wed, 22 Jan 2025 07:05:54 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Wed, 22 Jan 2025 07:05:54 -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=1737547554; x=1737633954; bh=i4fZHWMKJFnfwetqkkLFeLMM1jDSTxDt4+6zS29l0jU=; b= RgEgMTFPfOpaD20FaDNlZP/5X8H17Cwi25471ED3xp2d31ihCo7s07GfOiy24G7M 54+B/RWK5YdeEmunGZcN+d0dmfHTJOPKHmOJ8q0T22wgq/Gu4nVKPgi2251CVp0d /DgwfV2y49SFHIDj9Od+k5o1dMqCKj7ZxKWc/HTgzly0z5AbVp2Oqv045LGDOpDX F0ZB9aLJEfMW0xfXhzdamHW/ypJfeLZXIZS3o57rvDWwStn/LNQ27Os/b2RprdDH MYvfJJsQ5hE1HWcCTgGybuN123ZgoZmdTu87kmCeXOwL7Ig6XjJag0CUkjjGYxF0 iM5WMUKHaVpaj0y0c7y+AA== 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=1737547554; x= 1737633954; bh=i4fZHWMKJFnfwetqkkLFeLMM1jDSTxDt4+6zS29l0jU=; b=t Aa5kAkbCPNnrgnyzutenUa4HGGzwTIEwnz5VPsuJw7nqIYhBuYy2QlXiKChP0+iJ /lDwObgIUS02TFeqZfJ6GmJLnuO2OLbTGTFZbDSPqD0JmeHOeuY5nzHy0vXTv2Hp B1Lohd48M+p4OgpmFjB7PXyvlkk087IslKjyHfdmtYzC9a6i2d71098EjvUrpmhg 5msyAYaI1tMFhluiL+4i/Dy4C7B+qWNKhSRTaOy2l0t7/yRIDQ4i+B6B9wvuf+i9 AFS5WKEPyeGaB+2F3EZKqzETcTceMq4s8IQTXDbIvH0yCZW02iipboyJHrOMDPB7 OcsmWbkuEOmNiL4y+1VJw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrgh dprhgtphhtthhopegvshgthhifrghrthiisehgvghnthhoohdrohhrghdprhgtphhtthho pegvvhgrnhdrmhgrrhhtihhnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhoohhnse hiohhttghlrdgtohhmpdhrtghpthhtohepmhhirhhthhdrhhhitghkfhhorhgusehgmhgr ihhlrdgtohhmpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:05:53 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id e6d33031 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:50 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:46 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-3-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes X-Mailer: b4 0.14.2 The Git version for Meson is currently wired up manually. It can thus grow (and already 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 7361eb2eaa..213998986e 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 Wed Jan 22 12:05:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13947222 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 458CC212B2F for ; Wed, 22 Jan 2025 12:05:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547558; cv=none; b=cV21eQhiCyX1i63LHbPgY6D0Qhu1lsmsCjjcJxiBzXjTBqSe67F6O856G757mevJBwvATuzqjTN0rrk4HkxG0mhhtvwItqbjYduMOExWP0/bRWgnvc1RpvORrhMaFYrPCGiS6RUiOFIaPkylB2TpO3BlIXMd7IIL1Klh92inYiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547558; c=relaxed/simple; bh=4zm9yoeayWZEoBI3tVdgj4FKGfDiNrpd6JmfGtg1msc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FRrCQkOK7ZP7L+iWsdx3Bin3MOREOjK4irF5n6PQr33lwtiEM5XWr9oFfufXaVwRLo6VWLcNcWx5ahcyntjqEt5p0Nq4AC/A7iKAHF06sPjRiQBv3oh+NBiUEDo/fFRuO9rTbXvm0IL0tsSWvxbXgTj324kdigki1UVMdRAvc8s= 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=nK9y6ez/; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=O06BodqD; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="nK9y6ez/"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="O06BodqD" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4992911401B6; Wed, 22 Jan 2025 07:05:56 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 22 Jan 2025 07:05:56 -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=1737547556; x=1737633956; bh=YXPIS7c3UyGVrQhe6aSse6uQPxFSSLfE8nTySMqYjZw=; b= nK9y6ez/GKpXxmCkquyMs1kgL7VGJbmoWG4EhxmqkUXerSMkw/c9uyNK/ErGq7yH fl4/xIAiMw7chMJo/kGJ8A9NJAZwFDeXmtIAr65M9E7za1mw4W0NGAa1uzjE8MvH TyQ88Pzvx5oktEA9opixIVVfKvAZue9m+MZZVrJoxE7qzp4dO6D/ufjcaDnFITpn I5x3YEGO19uTdTeml7QmfSK3Grd8ORwhd+rvJZHIneBMkB+W2civ+J3wsaoq2WNB GskiuLQMPMLyuwJN+GJGMCbyuK60uT5tZ8TAQ+Uh9sxT/++g87ajQTnnGNb6CihL Rva2DLw56bJAwM0rEmS8fQ== 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=1737547556; x= 1737633956; bh=YXPIS7c3UyGVrQhe6aSse6uQPxFSSLfE8nTySMqYjZw=; b=O 06BodqDL1pZrzxlm/2oD+iVmNb8jGsJytBYf7IzvDUc1e6aE4NC4mUaUphcuCvD6 xGiqWehzlGFN9sBz02uqV5rgACk+233Hnz9sCMyDoLHPTpmKraCF0J8snMYfsair fPI2tlb7Kol6fk4dVfLLefs5n18noQkoYDquyxfffZ3u2Yadid3Hgpee0vRl2Efw 0RbuncA05pViZ2VY5rS1zqmNlXhfdhJbENSypVrg7geTMX7Xlf8XBdQ6pTm784YX Xbi8KLpYR/YS5aejum1Q4oo2mM2IgO2pnoVEvVvZjI+4c5MrLh8UBxY/ouDPPIXZ ukjcb2a1K2SFCmvI1Lhyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepvghvrghnrdhmrghrthhinhesghhmrghilhdrtg homhdprhgtphhtthhopehgihhtshhtvghrsehpohgsohigrdgtohhmpdhrtghpthhtohep vghstghhfigrrhhtiiesghgvnhhtohhordhorhhgpdhrtghpthhtohepghhithesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehmihhrthhhrdhhihgtkhhfohhruges ghhmrghilhdrtghomhdprhgtphhtthhopehtohhonhesihhothgtlhdrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:05:54 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 757f48de (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:51 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:47 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-4-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes 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 213998986e..4053024dad 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 Wed Jan 22 12:05:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13947223 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1935212D90 for ; Wed, 22 Jan 2025 12:05:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547560; cv=none; b=sWjx1cbcXjBaIDMLO5HmeRtVkJI2aKry9P6JSArIyqOGs60sY8iiCos/6hziKS+NRmfAghfZUZaKbLSC9IQHmSnCGIGZL/MgACIG1djYUYrB5E3uID60gnIrokQPOrnwk9AB4+RibKF4mBQ44UzEpvK55r7rurAyaU1+ImhDKw4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547560; c=relaxed/simple; bh=QCdvprsSXT/jvwab/Y8Dx8tYjhcfe8avTExJHVO8KcI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sY3Bp5c/Xk6XnTKx3JRHdg+RyQypKUsGyXQBrv+wuX6jDYRP96O8xGiXOa2fNmNALRDnnosE8y/YNV3+yLMJ6AeybPsM1FIWcc89u06khAdNv3EtjyRRQbQg4LKVwgmzmAgU89VimC00pbPgN32nuK2AMYgATNvqx9YXG53u9xU= 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=LBO/kkQv; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=jeZldScV; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="LBO/kkQv"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="jeZldScV" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id C2A9D114012E; Wed, 22 Jan 2025 07:05:57 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Wed, 22 Jan 2025 07:05:57 -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=1737547557; x=1737633957; bh=5lItKbMhgB+OCQWl488spyKjK5GQxcWb91YlyIixdjg=; b= LBO/kkQv9xSy92zWMK/kGAtsR8l90eGDE20eiryTT175hPM2Ir30wWe5IlDvSB0I p6mCsse4X3pMpzqajzFBmiHc6IL6yz318QklVo1uETM+R9DKp/jD8sQgRIqIo1Io rGuS969fR+K5vL2THsTu8Sm+dNIjyzaZ+2KVXSJ8ZIP5ncTUBiYTO1YN3sM25uTp M1HNB4TZBslzbZfnYdzR8iKgJq7irDHuvYLv3Mk8BhZUTAYNJ086JUovs/ih8GK+ j2HsMxRA/+TN5JnacKFQEI+826BUPGNXXC8pnXJ4p+2byZwvJ7gIt9AY/bq2Xeq9 J/6vPASX/iOjhkhNAuvzDg== 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=1737547557; x= 1737633957; bh=5lItKbMhgB+OCQWl488spyKjK5GQxcWb91YlyIixdjg=; b=j eZldScVQF7FmiA5pRtUpbsu0sAgMN99UnW9hnP1KmTRw7FIZ3LQwfrRRsu+ZnEH3 vcE6ljuDL85xZr9Z3LEKMnR535QBLRTVvZPyO1BpHoX8w9WKV7h2sOMYcLaOTAM1 9qkiWYjz9bqGbid58KvglIWXG6oOcBRs+6Z+oxqXcBo5k3rla/Fp07GFEk9WcEKl fqTO3BygAtUqdjmOj6m5yfH1oEn1ZlMgYqYNiipY8BWr3W2x2cdN+is+jfUAMPn2 KylYqesjsDUhaykYEOr9Lum40wh7eMTTWT4uhIja5wK+Yj6syPptK0DvXUvgwfEN S+aVioWb3fkj6U4KOE3jA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeivdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepthhoohhnsehiohhttghlrdgtohhmpdhrtghpth htohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegvshgthhif rghrthiisehgvghnthhoohdrohhrghdprhgtphhtthhopegvvhgrnhdrmhgrrhhtihhnse hgmhgrihhlrdgtohhmpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomhdp rhgtphhtthhopehmihhrthhhrdhhihgtkhhfohhrugesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:05:56 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 3b811d27 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:52 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:48 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-5-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes 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 4053024dad..ab4f229436 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 Wed Jan 22 12:05:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13947224 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21D65212F98 for ; Wed, 22 Jan 2025 12:05:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547561; cv=none; b=pkzEq13utPUA3vYGZs8OsSuPalEX3pD33MyY/JUn+Wz9u1dpQnRuMJ/fKZhGtTht8+BFxum7+gUv6G2+6IvR6ioVUPljUyV8iHHDXiLpy1DXmOZOvHukAVCt9dod3oWYl1nTm2KYO49oWm1c8gE5zAw232+24AkxDNzD1DvtdS0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547561; c=relaxed/simple; bh=tyFF+1nKiTv5kl4t+C710iKJn5V23uSpfqznsa5NUB4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pxlQ+H/96tV08hPYup0ZeRKG386NOwPcHuu3pwg9qsTlU5ndpC0oKznB09+v0rnLV6d24ZLvoLLuvn2MVNrQR7G3ZmrnzCuNy3mswICDxd1JtLkQzEm3gqjfVwt4fx4mFITPmNkxOwpHxISuFNwlUV9eUjJ+UU2TRZSZCmix6DE= 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=TqxPJU7z; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=LVCUXiAF; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="TqxPJU7z"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="LVCUXiAF" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 539ED1380832; Wed, 22 Jan 2025 07:05:59 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 22 Jan 2025 07:05:59 -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=1737547559; x=1737633959; bh=vjkplmel2ZgGrKirTPzkfZFEFUIRmhwELw4zrep17Vs=; b= TqxPJU7zrbsQ8g+WwUfoaVv8bf2ATkQYiz+PLDVulppHCYVSu2tir1hWrpPy3yNe v8IZLZqGcVQNk5GrB11eeOnuCvfr+kwie8mfgb41eH3UaJd20sA5/Wm8d3CUJOfG w4nzR2Lr8lG6eP6MELz4UrvU6I+nSTJIwUWWF1UxKCWfzDC8WQdz/1ADdktgu2yh TozcOACL0l7ICHKnaumy/FD535oNwKjD9AGScHLN7OlVEK7MB1ZcMneSBWkcE0Vq JuUKDCaVYlvtPD2fmo7COvmQ91rDb4dcueY4HiZt11fxU4cnMJswOnWDhVPepLlr kXC310SMZChRTLe40P7tDQ== 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=1737547559; x= 1737633959; bh=vjkplmel2ZgGrKirTPzkfZFEFUIRmhwELw4zrep17Vs=; b=L VCUXiAFz2bC7WUHaxhFUnKR1UgDNrLptp170nXP4HqgBj/mNSXcZ9d9n4SmfkUU6 ktCs/uiJTyjpXPshPoZfSi8sU3hTHHSx4HI0BxOgU+voIGMQGwOxtrXsGKScYLgq lZRW3K60g8TTbxhgKurMCMgogFKJQVgjfbT8ifVL3tAUt7eAO8EYqlv6Ngf0/x/N lbWoXuF/kCIZf17wyEDoM8rHg0Xap4gAFLpNmXWNzQInJMHcFFknomogfQ5dt2n+ cMyOFVkL5xS6Q91l+jUN+CSdY1otn8Gl0ysqfxgIoPDW0TTSAh6n8V1VNDnKssqU pD1MQXD6TQWzXDaUlbfUg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeivdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomhdprh gtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepthho ohhnsehiohhttghlrdgtohhmpdhrtghpthhtohepvghstghhfigrrhhtiiesghgvnhhtoh hordhorhhgpdhrtghpthhtohepvghvrghnrdhmrghrthhinhesghhmrghilhdrtghomhdp rhgtphhtthhopehmihhrthhhrdhhihgtkhhfohhrugesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:05:57 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 4159e3d3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:53 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:49 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-6-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes 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 to use a shell to resolve the "MESON_DIST_ROOT" environment variable. Signed-off-by: Patrick Steinhardt --- meson.build | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/meson.build b/meson.build index ab4f229436..a59072edf5 100644 --- a/meson.build +++ b/meson.build @@ -1947,6 +1947,19 @@ 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. +meson.add_dist_script( + shell, + '-c', + '"$1" "$2" "$3" --format="@GIT_VERSION@" "$MESON_DIST_ROOT/version"', + 'GIT-VERSION-GEN', + shell, + meson.current_source_dir() / 'GIT-VERSION-GEN', + meson.current_source_dir(), +) + summary({ 'curl': curl.found(), 'expat': expat.found(), From patchwork Wed Jan 22 12:05:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13947225 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6CCF212FAF for ; Wed, 22 Jan 2025 12:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547563; cv=none; b=U7HJYl6yb2BgqK2zOcpeJ60BjESDqg2l6iTWpbr1hNuxGwVWDkMXBCV8QpKfYoJHRYzLllMkNcp81g+nqXeNAm59qT7cChyVGvszBoZ4OAF+0iwpcRlBltnVaH8ARMCqMNZL9eOrANSuBzbqF+7/m65L1rHZ+bckocwpGY8oiVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547563; c=relaxed/simple; bh=N+XoOzYVZuLkxy5Fh7yv3Xm0mltfMthdUKtcJSlQcXY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oLb5GuzmcpuqinS40VpSc2PEP0B9fYjAJ2KTHBRjMEMHV7VL6OtRNfd4XIY6fzUc620UJNrZZ0JM3n3PMQ78qDLgc5MBmnLvfh37X7vQ7Q/88nKm+dv956oz9LP+reF6di9G67JavwuaR0eXT1Dd9osoSfBiqRfdzIwrWB9Oq40= 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=EqARDA7r; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=iIUuYVqH; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="EqARDA7r"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="iIUuYVqH" Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id D3295138083C; Wed, 22 Jan 2025 07:06:00 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Wed, 22 Jan 2025 07:06:00 -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=1737547560; x=1737633960; bh=dvAsikl8hB7dJ6Z5hiVOt+KQZBQJfI4ebexqeAEvvFo=; b= EqARDA7rMq6p95CDH3woDD+8LVJMZJGVYduPF8P3ykRAYg/DAbSSu42JYBZCf+ni B14Hn61XdxYN6gtSLHpwCIRi4y0VfoEe3zRDLYxOoX2j8cBSOMjAZ1qimkF4gaVR c9J4GJUrZdP9logRM62Z5+vZBvenMGTij2CHwZN8xZUZyulkqm6d7FSKrUI9zeFC XP7LQe9o65QlCjvB6Omb5Vp3gPnq+mqoPRhiTMywoHTmEtzViQ9oJPH9dFzm7ITX xJjPqjCfhrn1z7hsGxHM/O4IXHaShoiwP0A7OvIlN/sHCZtOH8aHbl8sQnTRPfyQ /hvlVHqmhee663YQj68Ibg== 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=1737547560; x= 1737633960; bh=dvAsikl8hB7dJ6Z5hiVOt+KQZBQJfI4ebexqeAEvvFo=; b=i IUuYVqHPYiNaT8XMaqYfy3obNwoHCS3zBYSOReGmEwG14qJrv1QSPSzn0+nTZxG9 HszFNwi1Zc6nHUdgkzMH1aky5LvFjXgS3fUz/G76N2EWgUfFuZV1FTUm1hP5K338 ifae1vrjm99NIZl9JipbkJIeCVQfIw5cyrarEXaESxMpFQSTbfCMm34ABhEqZQmB YfKbNYkg4HRuShpHZX5l4Qxm60xmzmotJ/lOKD62Dftg/g8vzB4WYx7SqtFfrnwR KoVp9zTWQhkNUQHx6pYeHFAiQbDKZeNF0jbWGBzmVbg4guwsBqAr9ckHi5Bg+pq7 JJX1TlAmxvu1ejIjWT/kw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepthhoohhnsehiohhttghlrdgtohhmpdhrtghpth htohepmhhirhhthhdrhhhitghkfhhorhgusehgmhgrihhlrdgtohhmpdhrtghpthhtohep vghstghhfigrrhhtiiesghgvnhhtohhordhorhhgpdhrtghpthhtohepghhithesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegvvhgrnhdrmhgrrhhtihhnsehgmhgr ihhlrdgtohhmpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:05:59 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id d9be6ea5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:54 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:50 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-7-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes 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 76667a1277..6c828c3b75 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 a59072edf5..052bd80ac4 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 89b01bad04..34ba679cf9 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 0000000000..ed79665501 --- /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 Wed Jan 22 12:05:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13947226 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 359F5212FB2 for ; Wed, 22 Jan 2025 12:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547563; cv=none; b=OSmCCMvWnLw0X6E3zJxv5D6cHbROWvPICIA54CNWmUjIlJYTPFNpElwfeLyJ2M4E22RoooUiYaFBmff0rjVqJ18jkf9tON0aQo1ppz6UqxYbUv+9ySzDCuRn2le4TqnM5dnREVGuo+YG02SVFSCTO6X/+i4Da0yvkN5+klw9ynU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547563; c=relaxed/simple; bh=/JrCEUlxIP4VVWbWSTwTZ+1wNmZDTeE88YD/98/PMfM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q+IIjrVYdnLSocUjKi8myRyucNDwHoVO23FBWbaFgFeWM8M6o+UA6ptlot4wL/LFb9ygH8dZNWJL6DPqU3roppi52sbOMpcrgsFOt9W3KM25V8OzVngp0IVMjSm8IkjUmC9dyznIKq3VUfU+rDdtKF7UG7B3vBbkfy1SBS71jh8= 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=Uppdafg7; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ObvOHsjp; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="Uppdafg7"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ObvOHsjp" Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4E73B11400B4; Wed, 22 Jan 2025 07:06:01 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Wed, 22 Jan 2025 07:06:01 -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=1737547561; x=1737633961; bh=FcPGgaN0gI4JyDHDpSA47Pof5qztuZtx26+kcCgTJzY=; b= Uppdafg7v3IZzNVaU+sE+VEChlQ6FUfmmXvevEmZfgvScG3KFKBetVdzsVrjCSB2 AbfWi2lBoiy8C/qMmYyM9JmJSA3phFjk/sxIey4X08qF2mcf0qvl9YDANKT/KOLh 5DQB1GiZSSsq6k44EcMi9RdMBtPnG0UFNarGG3mWfDhhNbiHajTvij4/A0msJeGK os9ThpNE1JXPW89ux+gV2+wTnbMJPJK+gxUlVbusD48T7krs0LtYmy66/KMxnPe9 aUzsujO1ro/7Q2vxn5NrDN1iAEEp9rHiZMxti5NtKaDS4/SfTPnqiNNC3fVcDEA/ DDGkurtL1LgXn3oB7qLdrg== 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=1737547561; x= 1737633961; bh=FcPGgaN0gI4JyDHDpSA47Pof5qztuZtx26+kcCgTJzY=; b=O bvOHsjpwsPWhvHhSX+8BQJep02pDsun1MdmNEnfsHyi1L6weSaKx0z8VGAMAdPiW uhj531rGGUiY9m8jUCaVi0ZPiGAQ1qy3VEW9wUqAnzYAYYv4Lb/L9GkqQqFCW2i7 AxgSFZoBcvNAAysypuLQoNcP9btx5eKb2jX1svJnbJgIi/tw3iud+qUatUTa2rRn Tds748UOXg+DGXjh6VyzgdXBAwBNl9mR/QGwLxOhaI7FSkdMTbZ9jLHxrAwAliId ePjqR0hkvGG+QBcK5F+67Tfvg3olFEzZjo3RHm4SV9eA6SSg1KQMmEfbpSjgSd/f 5cxFUZl4E+6jXO0wITisg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepvghvrghnrdhmrghrthhinhesghhmrghilhdrtg homhdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthht ohepvghstghhfigrrhhtiiesghgvnhhtohhordhorhhgpdhrtghpthhtohepmhhirhhthh drhhhitghkfhhorhgusehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhoohhnsehiohht tghlrdgtohhmpdhrtghpthhtohepghhithhsthgvrhesphhosghogidrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:05:59 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id f9516d26 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:54 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:51 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-8-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes 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 052bd80ac4..22dcd4aeee 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') @@ -1977,6 +1990,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 34ba679cf9..5429022f30 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 Wed Jan 22 12:05:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13947227 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA980212B0F for ; Wed, 22 Jan 2025 12:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547564; cv=none; b=beATQ9S0POYu2umtWyBcEq/ZycuUKKd/d1s2VwWVIj+DTJpPpjodP9+Xz1+6wYTIIuBOpexP4Erayacls6Ja2prl0o5jmd5kPZ8ZfX1aBhct8ZGfLKMuZ52RzdPsWxK8aAZlWv/Kf5AP5+WBhvzuKFzYA93DYShXS8/ibvkNrzQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547564; c=relaxed/simple; bh=h8/qP/smFk3ntSh1yJUNQD2MhZW+BtOaSjKXjcZrYvI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LcNZth5+GK/CGz63M5AhA+m7Eg9LI1ROQolhDvvDgJfclEk5ecFFRj7J5PqWYYhvC1fQYaDvp8ajB6AP7lFt83n+hRUgaUMuDjf/mXbUFjIIJKuG4XM9rKXF8fkc8vQ6vxH0lqXHBFETXH2xN/kyFEgsWVRstJQ+Nir33sdZZLk= 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=JjXcTEBu; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=A1EDw+Nl; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="JjXcTEBu"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="A1EDw+Nl" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4EF0D1140093; Wed, 22 Jan 2025 07:06:02 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Wed, 22 Jan 2025 07:06:02 -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=1737547562; x=1737633962; bh=r2mq0WnjDXC93wE6KxVmJ/vjseMvebLzVAW/TFGnpLg=; b= JjXcTEBu8fsioXX04+oxP5soEHbNGP30KGCUgh6B7Hd0Buyyv9vTEjThuIRfwz2z IarG3clu4UQw4tByXQY4Kq2SaUsV2E6zpFPTm/zivbceN8nxx5WKmZ1ot0WGhmNp /AsXj5m5M2jAxLjPcQqFq5SEePLYl8fly5gg5lqPt/fjAGNmtXHihPs6yWWTDIet xslU0UXWVByyRfCm9Lk7xmwdrC04iNMPoYX1O98aw9eNGICUtri2QxlTJQEYC4+T 7m+0kgwKclgnPpuiT92Ku5toio5SP1Smb+M+6SiZ3KaiUc0hbzLcimB8th1OBuUh ZFXjMX7ZbF39tHTSQ+lexQ== 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=1737547562; x= 1737633962; bh=r2mq0WnjDXC93wE6KxVmJ/vjseMvebLzVAW/TFGnpLg=; b=A 1EDw+Nlfu2ISp1XH70++sb4U9tksD82455RRaVwfcaRVY+X/gqRDR1eX/aUlunFR vUJGAMn84aaLfG3xg43Oj45+ZD64eEGEqvUQKUqs0E9GKq1sh7XC6PyOVCUAb4lF wMqJxryKmT4YX1ucK4lzAZX4T6dxaZ6VBGn2ZJFYsaca5mFolby0MsK/TeuJfs6l ho2/yHnMb4dAHf94uvD7MP9CgvkXyBLEVg2S3MAmfJsSd1Sy2Vg+BEIUgBI3ailp UFlrxpU4ELT4staAKPBGIquZpu243zTe2q/DK7rMhMY5IPcyYM5d8EKuShFaDBtM NPnnC6xb8zgamGBLUkLaQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepmhhirhhthhdrhhhitghkfhhorhgusehgmhgrih hlrdgtohhmpdhrtghpthhtohepthhoohhnsehiohhttghlrdgtohhmpdhrtghpthhtohep ghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegvshgthhifrghrth iisehgvghnthhoohdrohhrghdprhgtphhtthhopehgihhtshhtvghrsehpohgsohigrdgt ohhmpdhrtghpthhtohepvghvrghnrdhmrghrthhinhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:06:00 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 78fa226e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:55 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:52 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-9-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes 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 22dcd4aeee..af7ca042b9 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 Wed Jan 22 12:05:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13947228 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC70321322C for ; Wed, 22 Jan 2025 12:06:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547565; cv=none; b=urwN/yRxamD1fHrxUERqoSMwku4nojHtSDbkI+HjYduH16yqv5Vyh/dFzJMUA9P/aCtZuZrFMWBdtMWBfcDrSMqY0iRpYdiV5Zs2qeYEXS2eWkXRCq5Xx73J3cBmqShmUJdYgnmqviVOVlljr736ISd9VMDdIVAnXLnVCCfpzfQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547565; c=relaxed/simple; bh=xL+4oL4PNjsyMqgax82+0oYPqsjoTQKo35juYfOqLjE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Efc60NXwwFmPL43VVcrckRtxLyJFXgHoMqOH3uL2VJYnv6pFZIx4bE8ee2V0qHt4FNgqSYWxoziGEJakckRC9DClMlJnix7S5jkQrP6zi1YexJwd/LuEPAJLNqdXOHMGMJFRtwGoW3VATBX+b4rKW3aurulF7OxbbkwZp3z7Af4= 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=qZT8orvM; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Ps6iizts; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="qZT8orvM"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Ps6iizts" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id C9A9A138038F; Wed, 22 Jan 2025 07:06:02 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 22 Jan 2025 07:06:02 -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=1737547562; x=1737633962; bh=aey3s6R1yaaRfrPVIbSbWfMSTdhiBZCeHx3Vvbyl31E=; b= qZT8orvM+IJDC/ephlJDYsPFpmKffz1LfVVTZ9IqI/OfLxzLX793SxWC4vd6hlPN JVYnnkiSye0fYyEeLkPuB9Vxn3FsuGALGW4WOn0u/YmBu41/fUMqHb9umrE/p5a3 UY0qxoBornsAI83IHXTdUOvolcira0ivEO6wKNYaZsq9TedEmtgVQ4CeZYxf2ZD8 CwfTQAp/N3bvZ+G8EOxOoFtS034bQRD7qA+4w6p/3mCBho4SkW0L1akJKwHxycqa rO+1/hEYZYaCf9JFdLJ/WWYZGcYZ6oGiYOzMLYCsfwf+6RHsXrMGBcQwvTMOZSpM uE2stEsuKf4fTQxU44U5KQ== 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=1737547562; x= 1737633962; bh=aey3s6R1yaaRfrPVIbSbWfMSTdhiBZCeHx3Vvbyl31E=; b=P s6iiztspZmKtFqnRttTe5z+r2DYzhgpgv3VPEbAaHL8QHQ96GUlrUvKK2cxzZlR8 k+f4ZiPtSL01AIa8dNQRRg6UnDRCs/tsMmEVWwL89C3jMujwX1gAYesnUtQScmZh 6J5L1drwMSNeH2JXcFDLiKt0W8W/Hnmpcghzu3uuqVcWni/bShN8Z2MFBKpDqOSo yIZ5npAVmi5O7MagrMN0LwzebT6JNxP3q7xRhZC3E3rYB4SFwi5PG77e6c8qnvzW +k5W9AVIq0CBE+rzDdjRFXnvOC8oTuPFie7kgs2aztkAND6T61x/utIZQEEhgK3t JKxcNvbLPQC3kBCKgwNDw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkedu heejteekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrgh dprhgtphhtthhopehgihhtshhtvghrsehpohgsohigrdgtohhmpdhrtghpthhtohepvghs tghhfigrrhhtiiesghgvnhhtohhordhorhhgpdhrtghpthhtohepthhoohhnsehiohhttg hlrdgtohhmpdhrtghpthhtohepmhhirhhthhdrhhhitghkfhhorhgusehgmhgrihhlrdgt ohhmpdhrtghpthhtohepvghvrghnrdhmrghrthhinhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:06:01 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 7fbaf865 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:56 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:53 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-10-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes 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 6c828c3b75..964322055f 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 Wed Jan 22 12:05: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: 13947229 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE73B21170E for ; Wed, 22 Jan 2025 12:06:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547565; cv=none; b=SbjL9QkQw8hlM7F2ySaso0scXyijv/9hNStx1IUeOCzhCzibbTgRR/B1+39s6W1YZHc1zwO4/B14pPtDArXbfzXoGCqxN9f8Bk0XElwl8bsFCXfB/yepKfu0PbI3Am4+8ZQLxKM9qloK1mBAVd3C3SvpQ9PYZZLelpcMhvjMiic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737547565; c=relaxed/simple; bh=5l9FhOrzqA1x8OonA6pzg4LbHzqdLmYx+59aHjHYyuo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PXJEeHAib/e5cC5YuqD+VNFcozI1KdvCBuy50WPb9MyIUGkzzUzAEKBIjzl7q+mczLEQAmyLUrememDYKuWNYGGRSueaf2G0Y/SuIsN+UxtMAPdKGub375Ew4wskkZ1X0Gkt6Pus7C+A39yNxyYB5SzuBT1qKLF+i4CwsPPDTAc= 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=cLUPXOKp; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=rtseLzqF; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="cLUPXOKp"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="rtseLzqF" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 2F6431380832; Wed, 22 Jan 2025 07:06:03 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 22 Jan 2025 07:06:03 -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=1737547563; x=1737633963; bh=FYcMzuTd4LwinRyvVkDk5qDPOrGn1yKAV69erOyjicE=; b= cLUPXOKpcEg2HNYB3Fos0WeVy/cGbeP3eWr9LhWuYH98t1e+I3XvEZWY8AmT5S47 GMh4c+deOjD+8+TDHVa7lZADo3Coud6a4dQBktgUO62h8L+5YeCe/0T6k3NS9kyq gQDbyvtJE4l0vv2A6KahcULEq613LqFvx6HBgtApbS1IE6fmXA25I7oWmAgRrVgb KzKlvyDwow3kSkrMeeWE2NLQZoV3qOyxA+92XBKcEDZfrYa1/x524HK9N7TjJFDJ zzTJLR540EtN6yOEJivMH2KHSF3g6k0i78cD1NLzSwHqcYEWxLfkuM6wNQWsvcHn XC1lWzZCQ76lE4pW/1ckJA== 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=1737547563; x= 1737633963; bh=FYcMzuTd4LwinRyvVkDk5qDPOrGn1yKAV69erOyjicE=; b=r tseLzqFPkROJR28lGMWzBi8LpBDxv7sChgwvTF9veMvUSlwc3EVH9vJkXyZAGOxW fUqV998yHfqPD9N9CAon8MclhN9nRp6OPPRm2SQXtgjswtSwqiXNqvDxfZXybC/P +i3hhO2xnEXA7LooNrAtEkBgVF0ntw4/djQGmuFshc/BeF0Ehg4SBO99HRiJrSXo 2fc/0YJueZQOjD6NUURr7DeA00oBXBWdkCYWYo6B1vlOfS0btieydGJ+u99ALBt/ cojZIZiI2lw2zOZ/v9gUXeOo8+UO5yZStWzse0dXFCVrhOPgfR9zSOTukkNS9hO6 3QCvKm7N0PBA3v7jg3nHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejfedgudeivdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepveelgfdttddtvddtudeileevhfekueehvddtgeei tdelkeffieffleejvdfgueeinecuffhomhgrihhnpehgihhthhhusgdrtghomhdpphihth hhohhnrdhorhhgpdhhrgiggidrshgvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepiedpmh houggvpehsmhhtphhouhhtpdhrtghpthhtohepthhoohhnsehiohhttghlrdgtohhmpdhr tghpthhtohepvghvrghnrdhmrghrthhinhesghhmrghilhdrtghomhdprhgtphhtthhope hmihhrthhhrdhhihgtkhhfohhrugesghhmrghilhdrtghomhdprhgtphhtthhopegvshgt hhifrghrthiisehgvghnthhoohdrohhrghdprhgtphhtthhopehgihhtshhtvghrsehpoh gsohigrdgtohhmpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jan 2025 07:06:01 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id cad4972a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 22 Jan 2025 12:05:57 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 22 Jan 2025 13:05:54 +0100 Subject: [PATCH v3 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: <20250122-b4-pks-meson-additions-v3-11-5a51eb5d3dcd@pks.im> References: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> In-Reply-To: <20250122-b4-pks-meson-additions-v3-0-5a51eb5d3dcd@pks.im> To: git@vger.kernel.org Cc: Evan Martin , Eli Schwartz , Junio C Hamano , M Hickford , Toon Claes 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 900be9957a..7f55f8b3a9 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 9254e01583..4976e18a05 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