public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/kcov/
Date: Fri, 30 May 2025 14:51:02 +0000 (UTC)	[thread overview]
Message-ID: <1748616622.deeb9ae769dea1a95e6f4000b4249cf9fa8bb234.sam@gentoo> (raw)

commit:     deeb9ae769dea1a95e6f4000b4249cf9fa8bb234
Author:     Mattéo Rossillol‑‑Laruelle <beatussum <AT> protonmail <DOT> com>
AuthorDate: Fri May 30 13:21:12 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 30 14:50:22 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=deeb9ae7

dev-util/kcov: fix tests

Some files generated by kcov are stored in `KCOV_SYSTEM_PIPE`,
`KCOV_SYSTEM_DESTINATION_DIR` or `TMPDIR`. By default, these variables are set
to /tmp; however, file creation here is not allowed. These variables are now set
to "${T}".

Full system instrumentation tests force using /tmp and are therefore disabled.

Closes: https://bugs.gentoo.org/938668
Signed-off-by: Mattéo Rossillol‑‑Laruelle <beatussum <AT> protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42350
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/kcov/kcov-43.ebuild   | 14 +++++++++++++-
 dev-util/kcov/kcov-9999.ebuild | 18 +++++++++++++++---
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/dev-util/kcov/kcov-43.ebuild b/dev-util/kcov/kcov-43.ebuild
index 014165152149..66b5b306e300 100644
--- a/dev-util/kcov/kcov-43.ebuild
+++ b/dev-util/kcov/kcov-43.ebuild
@@ -56,6 +56,13 @@ pkg_setup() {
 
 src_prepare() {
 	if use test; then
+		find tests \( -name "*.cc" -or -name "*.py" -or -name "*.sh" \) \
+			-exec sed -Ei "s%/tmp([^-])%${T}\1%g" {} + \
+			|| die "Cannot fixing the temporary directory"
+
+		sed -i "s/[a-z].*test_system_mode.*/pass/" tests/tools/libkcov/main.py \
+			|| die "Cannot remove full system instrumentation tests"
+
 		sed -Ei "/skip_python2/ s/= .+/= True/" tests/tools/test_python.py \
 			|| die "Cannot disable Python 2 tests"
 
@@ -74,7 +81,12 @@ src_configure() {
 }
 
 src_test() {
-	PYTHONPATH="${S}/tests/tools" edo "${PYTHON}" -m libkcov \
+	PYTHONPATH="${S}/tests/tools" \
+		KCOV_SYSTEM_PIPE="${T}/kcov-system.pipe" \
+		KCOV_SYSTEM_DESTINATION_DIR="${T}/kcov-data" \
+		TMPDIR="${T}" \
+		edo \
+		"${PYTHON}" -m libkcov \
 		-v \
 		"${BUILD_DIR}/src/kcov" \
 		"${T}" \

diff --git a/dev-util/kcov/kcov-9999.ebuild b/dev-util/kcov/kcov-9999.ebuild
index 32f6b0358b92..66b5b306e300 100644
--- a/dev-util/kcov/kcov-9999.ebuild
+++ b/dev-util/kcov/kcov-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -15,7 +15,7 @@ if [[ "${PV}" = 9999 ]]; then
 	EGIT_REPO_URI="https://github.com/SimonKagstrom/kcov.git"
 else
 	SRC_URI="https://github.com/SimonKagstrom/kcov/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-	KEYWORDS="~amd64 ~x86"
+	KEYWORDS="amd64 ~x86"
 fi
 
 LICENSE="GPL-2 MIT"
@@ -56,6 +56,13 @@ pkg_setup() {
 
 src_prepare() {
 	if use test; then
+		find tests \( -name "*.cc" -or -name "*.py" -or -name "*.sh" \) \
+			-exec sed -Ei "s%/tmp([^-])%${T}\1%g" {} + \
+			|| die "Cannot fixing the temporary directory"
+
+		sed -i "s/[a-z].*test_system_mode.*/pass/" tests/tools/libkcov/main.py \
+			|| die "Cannot remove full system instrumentation tests"
+
 		sed -Ei "/skip_python2/ s/= .+/= True/" tests/tools/test_python.py \
 			|| die "Cannot disable Python 2 tests"
 
@@ -74,7 +81,12 @@ src_configure() {
 }
 
 src_test() {
-	PYTHONPATH="${S}/tests/tools" edo "${PYTHON}" -m libkcov \
+	PYTHONPATH="${S}/tests/tools" \
+		KCOV_SYSTEM_PIPE="${T}/kcov-system.pipe" \
+		KCOV_SYSTEM_DESTINATION_DIR="${T}/kcov-data" \
+		TMPDIR="${T}" \
+		edo \
+		"${PYTHON}" -m libkcov \
 		-v \
 		"${BUILD_DIR}/src/kcov" \
 		"${T}" \


             reply	other threads:[~2025-05-30 14:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-30 14:51 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-30 14:51 [gentoo-commits] repo/gentoo:master commit in: dev-util/kcov/ Sam James
2025-05-20 18:54 Arthur Zamarin
2024-08-04  9:17 Joonas Niilola
2024-07-30  8:49 Pacho Ramos
2024-07-30  8:49 Pacho Ramos
2022-02-26 19:53 Sam James
2022-02-26 19:53 Sam James
2019-04-09  3:14 Austin English
2017-11-28  0:49 Austin English
2017-01-26 19:01 Austin English
2017-01-26 19:01 Austin English
2017-01-25 23:58 Austin English

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1748616622.deeb9ae769dea1a95e6f4000b4249cf9fa8bb234.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox