public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/pkgcore/files/, sys-apps/pkgcore/
Date: Sun,  9 May 2021 20:24:43 +0000 (UTC)	[thread overview]
Message-ID: <1620591881.e536d2fd0a5a0ace16a215b6bc900d3bee623bc3.mgorny@gentoo> (raw)

commit:     e536d2fd0a5a0ace16a215b6bc900d3bee623bc3
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun May  9 20:20:23 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun May  9 20:24:41 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e536d2fd

sys-apps/pkgcore: Fix pmaint hang due to signal handler setup

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../pkgcore/files/pkgcore-0.10.18-sighdlr-2.patch  | 56 ++++++++++++++++++++++
 sys-apps/pkgcore/pkgcore-0.11.8-r2.ebuild          | 52 ++++++++++++++++++++
 2 files changed, 108 insertions(+)

diff --git a/sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr-2.patch b/sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr-2.patch
new file mode 100644
index 00000000000..d5ab23c4282
--- /dev/null
+++ b/sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr-2.patch
@@ -0,0 +1,56 @@
+From 9faa4288ce0b9f90292e9afc2777ce62317d861a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sun, 9 May 2021 21:36:32 +0200
+Subject: [PATCH] ebuild.processor: Ensure that signal handlers are set only
+ once
+
+Prevent the signal.signal() calls from being made more than once.  This
+was changed in 533f1edd70054a5479ee85719d3cbef0d15627fd when the calls
+were moved to EbuildProcessor's __init__ method.  However, it seems
+to cause 'pmaint regen' to hang randomly which keeps blocking Gentoo
+git repository mirrors.
+
+Fixes #307
+---
+ src/pkgcore/ebuild/processor.py | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/src/pkgcore/ebuild/processor.py b/src/pkgcore/ebuild/processor.py
+index 323e7e9a..384dc1f0 100644
+--- a/src/pkgcore/ebuild/processor.py
++++ b/src/pkgcore/ebuild/processor.py
+@@ -24,7 +24,7 @@ import os
+ import signal
+ import threading
+ import traceback
+-from functools import partial, wraps
++from functools import partial, wraps, lru_cache
+ from itertools import chain
+ 
+ from snakeoil import bash, fileutils, klass
+@@ -297,6 +297,12 @@ def chuck_StoppingCommand(ebp, line):
+         raise ProcessorError(args[1])
+ 
+ 
++@lru_cache(maxsize=None)
++def set_signal_handlers():
++    signal.signal(signal.SIGTERM, partial(chuck_TermInterrupt, None))
++    signal.signal(signal.SIGINT, chuck_KeyboardInterrupt)
++
++
+ class EbuildProcessor:
+     """Abstraction of a running ebd instance.
+ 
+@@ -320,8 +326,7 @@ class EbuildProcessor:
+         self._outstanding_expects = []
+         self._metadata_paths = None
+ 
+-        signal.signal(signal.SIGTERM, partial(chuck_TermInterrupt, None))
+-        signal.signal(signal.SIGINT, chuck_KeyboardInterrupt)
++        set_signal_handlers()
+ 
+         spawn_opts = {'umask': 0o002}
+         if self.userpriv:
+-- 
+2.31.1
+

diff --git a/sys-apps/pkgcore/pkgcore-0.11.8-r2.ebuild b/sys-apps/pkgcore/pkgcore-0.11.8-r2.ebuild
new file mode 100644
index 00000000000..37b799d4830
--- /dev/null
+++ b/sys-apps/pkgcore/pkgcore-0.11.8-r2.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{8..9} )
+DISTUTILS_IN_SOURCE_BUILD=1
+inherit distutils-r1
+
+if [[ ${PV} == *9999 ]] ; then
+	EGIT_REPO_URI="https://github.com/pkgcore/pkgcore.git"
+	inherit git-r3
+else
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos"
+	SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+fi
+
+DESCRIPTION="a framework for package management"
+HOMEPAGE="https://github.com/pkgcore/pkgcore"
+
+LICENSE="BSD MIT"
+SLOT="0"
+
+RDEPEND="dev-python/lxml[${PYTHON_USEDEP}]"
+if [[ ${PV} == *9999 ]]; then
+	RDEPEND+=" ~dev-python/snakeoil-9999[${PYTHON_USEDEP}]"
+else
+	RDEPEND+=" >=dev-python/snakeoil-0.9.6[${PYTHON_USEDEP}]"
+fi
+BDEPEND="
+	test? (
+		>=dev-python/pytest-6[${PYTHON_USEDEP}]
+		dev-vcs/git
+	)
+"
+
+PATCHES=(
+	"${FILESDIR}/pkgcore-0.10.18-sighdlr.patch"
+	"${FILESDIR}/pkgcore-0.10.18-sighdlr-2.patch"
+)
+
+distutils_enable_tests setup.py
+
+src_test() {
+	local -x PYTHONDONTWRITEBYTECODE=
+	distutils-r1_src_test
+}
+
+python_install_all() {
+	local DOCS=( NEWS.rst )
+	[[ ${PV} == *9999 ]] || doman man/*
+	distutils-r1_python_install_all
+}


             reply	other threads:[~2021-05-09 20:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-09 20:24 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-24 16:49 [gentoo-commits] repo/gentoo:master commit in: sys-apps/pkgcore/files/, sys-apps/pkgcore/ Ulrich Müller
2021-08-25 16:55 Michał Górny
2021-05-23  8:01 Michał Górny
2021-05-15 11:51 Michał Górny
2021-05-10 18:08 Michał Górny
2021-03-15  9:40 Michał Górny

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=1620591881.e536d2fd0a5a0ace16a215b6bc900d3bee623bc3.mgorny@gentoo \
    --to=mgorny@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