From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 90B171581EE for ; Sun, 06 Apr 2025 05:36:41 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 79FB53432D5 for ; Sun, 06 Apr 2025 05:36:41 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 4CEA41104CC; Sun, 06 Apr 2025 05:35:08 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 8C7461104C3 for ; Sun, 06 Apr 2025 05:35:07 +0000 (UTC) Received: from mop.. (unknown [82.8.138.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sam@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 7AD5D342F8E; Sun, 06 Apr 2025 05:35:06 +0000 (UTC) From: Sam James To: gentoo-dev@lists.gentoo.org Cc: base-system@gentoo.org, eschwartz@gentoo.org, Sam James Subject: [gentoo-dev] [PATCH 2/2] meson.eclass: build test targets first in meson_src_test Date: Sun, 6 Apr 2025 06:34:49 +0100 Message-ID: <6cef3ecbaa1909ebe9d848fa0d6ba3e9891ca7bd.1743917689.git.sam@gentoo.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <28881e68ac50fef361c4d0a0f8dd87d1faa7bcb4.1743917689.git.sam@gentoo.org> References: <28881e68ac50fef361c4d0a0f8dd87d1faa7bcb4.1743917689.git.sam@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 263fcc5c-3792-48f8-857e-06196574884a X-Archives-Hash: 2b2851029e4b8997afa1c747e47f71b0 Newer versions of meson [0] don't build all test targets upfront (which makes this more noticeable, still was a thing before w/ custom handling) so, in the common case, test binaries are built by the `meson test` call. That means their compile/link lines aren't emitted (even with `meson test --verbose`) and they're also built without respecting $(makeopts_jobs) as `meson test --num-processes` only affects test execution parallelism. Preempt that by calling `eninja meson-test-prereq` first which solves both problems. We can safely do this unconditionally as this target was added in meson-0.63.0 and we depend on >=meson-1.2.3 in the eclass. [0] https://mesonbuild.com/Release-notes-for-1-7-0.html#test-targets-no-longer-built-by-default Signed-off-by: Sam James --- eclass/meson.eclass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eclass/meson.eclass b/eclass/meson.eclass index 382c80ec08214..da3c3c53650b4 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -458,13 +458,16 @@ meson_src_test() { pushd "${BUILD_DIR}" > /dev/null || die + nonfatal eninja meson-test-prereq || die -n "test prereqs failed" + local mesontestargs=( + --no-rebuild --print-errorlogs --num-processes "$(makeopts_jobs "${MAKEOPTS}")" "$@" ) - nonfatal edo "${mesontestargs[@]}" + nonfatal edo meson test "${mesontestargs[@]}" local rv=$? [[ ${rv} -eq 0 ]] || die -n "tests failed" -- 2.49.0