From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1492401-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id C9637158007
	for <garchives@archives.gentoo.org>; Sat,  4 Mar 2023 00:48:22 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id DD0A1E07B2;
	Sat,  4 Mar 2023 00:48:21 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.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) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id C1C59E07B2
	for <gentoo-commits@lists.gentoo.org>; Sat,  4 Mar 2023 00:48:21 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(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 smtp.gentoo.org (Postfix) with ESMTPS id 6D56A340C8A
	for <gentoo-commits@lists.gentoo.org>; Sat,  4 Mar 2023 00:48:20 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 191D18B6
	for <gentoo-commits@lists.gentoo.org>; Sat,  4 Mar 2023 00:48:18 +0000 (UTC)
From: "Matt Turner" <mattst88@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" <mattst88@gentoo.org>
Message-ID: <1677890882.c759e1314a540cc5d08ca4b5b7b7ccbfce7fa277.mattst88@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/glib/files/, dev-libs/glib/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-libs/glib/files/glib-2.74.5-tests-Skip-assert-msg-test.py-if-gdb-fails.patch dev-libs/glib/glib-2.74.5.ebuild
X-VCS-Directories: dev-libs/glib/ dev-libs/glib/files/
X-VCS-Committer: mattst88
X-VCS-Committer-Name: Matt Turner
X-VCS-Revision: c759e1314a540cc5d08ca4b5b7b7ccbfce7fa277
X-VCS-Branch: master
Date: Sat,  4 Mar 2023 00:48:18 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 6e8d6ee4-e3a5-4035-8030-ee90be60d716
X-Archives-Hash: 8f5a936d45298d824f1e34d241f03962

commit:     c759e1314a540cc5d08ca4b5b7b7ccbfce7fa277
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  4 00:47:55 2023 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat Mar  4 00:48:02 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c759e131

dev-libs/glib: Add patch to skip test

The assert-msg-test.py test doesn't work under sandbox.

Closes: https://bugs.gentoo.org/871330
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 ...ests-Skip-assert-msg-test.py-if-gdb-fails.patch | 33 ++++++++++++++++++++++
 dev-libs/glib/glib-2.74.5.ebuild                   |  2 ++
 2 files changed, 35 insertions(+)

diff --git a/dev-libs/glib/files/glib-2.74.5-tests-Skip-assert-msg-test.py-if-gdb-fails.patch b/dev-libs/glib/files/glib-2.74.5-tests-Skip-assert-msg-test.py-if-gdb-fails.patch
new file mode 100644
index 000000000000..ed8fc97b3992
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.74.5-tests-Skip-assert-msg-test.py-if-gdb-fails.patch
@@ -0,0 +1,33 @@
+From 19a8df9d8bff279a55b0fa3bb7ba4fbf7fcbefa8 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Thu, 2 Mar 2023 00:13:22 -0500
+Subject: [PATCH] tests: Skip assert-msg-test.py if gdb fails
+
+Similar to commit 6e44151bf74d, skip the test if gdb is unable to read
+/proc/PID/mem, which gdb does as a fallback if ptrace is unavailable.
+
+This allows the test to skip when run under Gentoo's sandbox.
+---
+ glib/tests/assert-msg-test.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/glib/tests/assert-msg-test.py b/glib/tests/assert-msg-test.py
+index 4936fa083..33aa2249e 100755
+--- a/glib/tests/assert-msg-test.py
++++ b/glib/tests/assert-msg-test.py
+@@ -158,9 +158,9 @@ class TestAssertMessage(unittest.TestCase):
+ 
+             # Some CI environments disable ptrace (as they’re running in a
+             # container). If so, skip the test as there’s nothing we can do.
+-            if (
+-                result.info.returncode != 0
+-                and "ptrace: Operation not permitted" in result.err
++            if result.info.returncode != 0 and (
++                "ptrace: Operation not permitted" in result.err
++                or "warning: opening /proc/PID/mem file for lwp" in result.err
+             ):
+                 self.skipTest("GDB is not functional due to ptrace being disabled")
+ 
+-- 
+2.39.2
+

diff --git a/dev-libs/glib/glib-2.74.5.ebuild b/dev-libs/glib/glib-2.74.5.ebuild
index 678d48cb72dd..f0c142206738 100644
--- a/dev-libs/glib/glib-2.74.5.ebuild
+++ b/dev-libs/glib/glib-2.74.5.ebuild
@@ -69,6 +69,8 @@ MULTILIB_CHOST_TOOLS=(
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-2.64.1-mark-gdbus-server-auth-test-flaky.patch
+
+	"${FILESDIR}"/${P}-tests-Skip-assert-msg-test.py-if-gdb-fails.patch
 )
 
 pkg_setup() {