From 8ed7a83475ff105514b4471b98506c31938b2a45e6671373224b976622bff3e6 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Thu, 11 Dec 2025 05:54:03 +0000 Subject: [PATCH 1/2] - Update to 0.9.9: * Fix PROC_MAP_REGEX for three digit minor device id by @fab1ano in #73 * Add support for RISC-V by @yuzibo in #76 * Fix arguments of pipe/pipe2 system calls. by @jopereira in #78 * do not raise an exception for a valid process status by @duanev in #80 * Remove deprecated imp module by @hamarituc in #81 * Use importlib instead of imp in setup_cptrace.py by @skitt in #83 - Drop patches, included upstream: * python-ptrace-pr81-importlib.patch * python-ptrace-pr83-importlib.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-ptrace?expand=0&rev=21 --- .gitattributes | 23 ++++++ .gitignore | 1 + _multibuild | 4 + python-ptrace-0.9.8.tar.gz | 3 + python-ptrace-0.9.9.tar.gz | 3 + python-ptrace-pr81-importlib.patch | 34 ++++++++ python-ptrace-pr83-importlib.patch | 42 ++++++++++ python-python-ptrace.changes | 94 +++++++++++++++++++++ python-python-ptrace.spec | 128 +++++++++++++++++++++++++++++ 9 files changed, 332 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _multibuild create mode 100644 python-ptrace-0.9.8.tar.gz create mode 100644 python-ptrace-0.9.9.tar.gz create mode 100644 python-ptrace-pr81-importlib.patch create mode 100644 python-ptrace-pr83-importlib.patch create mode 100644 python-python-ptrace.changes create mode 100644 python-python-ptrace.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..553b69b --- /dev/null +++ b/_multibuild @@ -0,0 +1,4 @@ + + cptrace + test + diff --git a/python-ptrace-0.9.8.tar.gz b/python-ptrace-0.9.8.tar.gz new file mode 100644 index 0000000..45895d7 --- /dev/null +++ b/python-ptrace-0.9.8.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b54c43e87caf02d1452d6400649822c99e8f7ca31fa3f655ea88caf85369e3d4 +size 104079 diff --git a/python-ptrace-0.9.9.tar.gz b/python-ptrace-0.9.9.tar.gz new file mode 100644 index 0000000..abdc01f --- /dev/null +++ b/python-ptrace-0.9.9.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e643a7199fdef9ee35cb3afda293951dff0b1a628fa891856fd36b1482f1d2c +size 106526 diff --git a/python-ptrace-pr81-importlib.patch b/python-ptrace-pr81-importlib.patch new file mode 100644 index 0000000..c3a9186 --- /dev/null +++ b/python-ptrace-pr81-importlib.patch @@ -0,0 +1,34 @@ +From 80e0c97a84eccb8b82737cf40b9c5581c20c245f Mon Sep 17 00:00:00 2001 +From: Mario Haustein +Date: Sat, 16 Sep 2023 13:49:43 +0200 +Subject: [PATCH] Remove deprecated `imp` module + +--- + setup.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/setup.py b/setup.py +index 4d6ba36..ad54f9a 100755 +--- a/setup.py ++++ b/setup.py +@@ -28,7 +28,7 @@ + # - git commit -a -m "post-release" + # - git push + +-from imp import load_source ++import importlib.util + from os import path + try: + # setuptools supports bdist_wheel +@@ -55,7 +55,10 @@ + with open('README.rst') as fp: + LONG_DESCRIPTION = fp.read() + +-ptrace = load_source("version", path.join("ptrace", "version.py")) ++ptrace_spec = importlib.util.spec_from_file_location("version", path.join("ptrace", "version.py")) ++ptrace = importlib.util.module_from_spec(ptrace_spec) ++ptrace_spec.loader.exec_module(ptrace) ++ + PACKAGES = {} + for name in MODULES: + PACKAGES[name] = name.replace(".", "/") diff --git a/python-ptrace-pr83-importlib.patch b/python-ptrace-pr83-importlib.patch new file mode 100644 index 0000000..bc0a351 --- /dev/null +++ b/python-ptrace-pr83-importlib.patch @@ -0,0 +1,42 @@ +From 41f5378bbf4bfa75970d5cc3f6615411cff61a6c Mon Sep 17 00:00:00 2001 +From: Stephen Kitt +Date: Sun, 10 Dec 2023 19:07:27 +0100 +Subject: [PATCH] Use importlib instead of imp in setup_cptrace.py + +Signed-off-by: Stephen Kitt +--- + setup_cptrace.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/setup_cptrace.py b/setup_cptrace.py +index 8de9d01..f06b792 100755 +--- a/setup_cptrace.py ++++ b/setup_cptrace.py +@@ -1,5 +1,7 @@ + #!/usr/bin/env python + ++import importlib.util ++ + SOURCES = ['cptrace/cptrace.c'] + + CLASSIFIERS = [ +@@ -17,7 +19,6 @@ + + + def main(): +- from imp import load_source + from os import path + from sys import argv + +@@ -29,7 +30,10 @@ def main(): + + cptrace_ext = Extension('cptrace', sources=SOURCES) + +- cptrace = load_source("version", path.join("cptrace", "version.py")) ++ cptrace_spec = importlib.util.spec_from_file_location("version", ++ path.join("cptrace", "version.py")) ++ cptrace = importlib.util.module_from_spec(cptrace_spec) ++ cptrace_spec.loader.exec_module(cptrace) + + install_options = { + "name": cptrace.PACKAGE, diff --git a/python-python-ptrace.changes b/python-python-ptrace.changes new file mode 100644 index 0000000..434dbcf --- /dev/null +++ b/python-python-ptrace.changes @@ -0,0 +1,94 @@ +------------------------------------------------------------------- +Thu Dec 11 05:53:43 UTC 2025 - Steve Kowalik + +- Update to 0.9.9: + * Fix PROC_MAP_REGEX for three digit minor device id by @fab1ano in #73 + * Add support for RISC-V by @yuzibo in #76 + * Fix arguments of pipe/pipe2 system calls. by @jopereira in #78 + * do not raise an exception for a valid process status by @duanev in #80 + * Remove deprecated imp module by @hamarituc in #81 + * Use importlib instead of imp in setup_cptrace.py by @skitt in #83 +- Drop patches, included upstream: + * python-ptrace-pr81-importlib.patch + * python-ptrace-pr83-importlib.patch + +------------------------------------------------------------------- +Sun Mar 3 19:17:50 UTC 2024 - Ben Greiner + +- Update to 0.9.8 + * Added Arm 64bit (AArch64) support. + * Implemented ``PTRACE_GETREGSET`` and ``PTRACE_SETREGSET`` + required on AArch64 and available on Linux. + * Issue #66: Fix ``SIGTRAP|0x80`` or ``SIGTRAP`` wait in + syscall_state.exit (``PTRACE_O_TRACESYSGOOD``). +- Build PEP517 wheels separately in multibuild +- Add patchtes for Python 3.12: + * python-ptrace-pr81-importlib.patch gh#vstinner/python-ptrace#81 + * python-ptrace-pr83-importlib.patch gh#vstinner/python-ptrace#83 +- Remove upstreamed patch: + * add-aarch64-support.patch + +------------------------------------------------------------------- +Wed Jan 13 07:33:18 UTC 2021 - Guillaume GARDET + +- Backport patch to add aarch64 support: + * add-aarch64-support.patch + +------------------------------------------------------------------- +Wed Jan 13 07:28:20 UTC 2021 - Guillaume GARDET + +- Update to 0.9.7: + * Add missing module to install directives +- Update to 0.9.6: + * Drop Python 2.7 support. six dependency is no longer needed + * Add close_fds and pass_fds to createChild() function + * Enhance strace.py output for open flags and open optional parameters + * Add support for PowerPC 64-bit (ppc64) + +------------------------------------------------------------------- +Thu Sep 10 12:37:13 UTC 2020 - Guillaume GARDET + +- aarch64 is not yet supported, so exclude it + See: https://github.com/vstinner/python-ptrace/issues/57 + +------------------------------------------------------------------- +Wed Aug 5 12:47:08 UTC 2020 - Marketa Calabkova + +- Update to 0.9.5 + * Fix readProcessMappings() for device id on 3 digits. Patch by Cat Stevens. + * Drop Python 2 support. + +------------------------------------------------------------------- +Tue Sep 10 11:05:34 UTC 2019 - Tomáš Chvátal + +- Update to 0.9.4: + * Issue #36: Fix detaching from process object created without is_attached=True + * The project now requires the six module. + +------------------------------------------------------------------- +Tue Sep 19 07:10:02 UTC 2017 - mimi.vx@gmail.com + +- update to 0.9.3 + * Fix test_strace.py: tolerate the openat() syscall + +------------------------------------------------------------------- +Wed Jun 28 05:58:20 UTC 2017 - jengelh@inai.de + +- Trim description, rectify errors. + +------------------------------------------------------------------- +Mon Jun 26 16:26:48 UTC 2017 - mimi.vx@gmail.com + +- use simpler macros to build C parts and run tests + +------------------------------------------------------------------- +Sun Jun 25 09:00:13 UTC 2017 - mimi.vx@gmail.com + +- update to 0.9.2 +- move to singlespec +* Fix strace.py when tracing multiple processes: use the correct process. + +------------------------------------------------------------------- +Thu Oct 27 10:05:42 UTC 2016 - mimi.vx@gmail.com + +- initial packaging diff --git a/python-python-ptrace.spec b/python-python-ptrace.spec new file mode 100644 index 0000000..b79e17b --- /dev/null +++ b/python-python-ptrace.spec @@ -0,0 +1,128 @@ +# +# spec file for package python-python-ptrace +# +# Copyright (c) 2025 SUSE LLC and contributors +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%define pyversion 0.9.9 +%define cversion 0.6.1 +%if "%{flavor}" == "" +%define pkgname python-ptrace +%define pkgversion %{pyversion} +%bcond_with test +%endif +%if "%{flavor}" == "cptrace" +%define pkgname cptrace +%define pkgversion %{cversion} +%bcond_with test +%endif +%if "%{flavor}" == "test" +%define pkgname python-ptrace-test +%define pkgversion %{pyversion}+%{cversion} +%bcond_without test +ExcludeArch: %arm +%endif + +Name: python-%{pkgname} +Version: %{pkgversion} +Release: 0 +Summary: Python binding for ptrace +License: GPL-2.0-only +URL: https://github.com/vstinner/python-ptrace +Source: https://github.com/haypo/python-ptrace/archive/%{pyversion}.tar.gz#/python-ptrace-%{pyversion}.tar.gz +%if "%{flavor}" == "cptrace" +BuildRequires: %{python_module devel} +%else +BuildArch: noarch +Recommends: python-cptrace = %{cversion} +%endif +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun): update-alternatives +%if %{with test} +BuildRequires: %{python_module cptrace = %{cversion}} +BuildRequires: %{python_module python-ptrace = %{pyversion}} +%endif +%python_subpackages + +%description +python-ptrace is a debugger using ptrace written in Python. + +%prep +%autosetup -p1 -n python-ptrace-%{pyversion} +sed -i 's/\x0D$//' doc/*.rst +chmod 0644 examples/*.py + +%build +%if !%{with test} +%if "%{flavor}" == "cptrace" +mv setup.py setup_python-ptrace.py +mv setup_cptrace.py setup.py +%endif +%pyproject_wheel +%endif + +%install +%if !%{with test} +%pyproject_install +%if "%{flavor}" == "cptrace" +%python_expand %fdupes %{buildroot}%{$python_sitearch} +%else +%python_clone -a %{buildroot}%{_bindir}/gdb.py +%python_clone -a %{buildroot}%{_bindir}/strace.py +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif +%endif + +%if %{with test} +%check +%python_exec runtests.py -v +%endif + +%if !%{with test} +%if "%{flavor}" == "" +%post +%python_install_alternative strace.py +%python_install_alternative gdb.py + +%postun +%python_uninstall_alternative strace.py +%python_uninstall_alternative gdb.py + +%files %{python_files} +%license COPYING +%doc README.rst +%doc doc/* examples +%python_alternative %{_bindir}/gdb.py +%python_alternative %{_bindir}/strace.py +%{python_sitelib}/ptrace/ +%{python_sitelib}/python_ptrace-%{pkgversion}.dist-info +%endif + +%if "%{flavor}" == "cptrace" +%files %{python_files} +%license COPYING +%doc README.rst +%{python_sitearch}/cptrace*.so +%{python_sitearch}/cptrace-%{pkgversion}.dist-info +%endif +%endif + +%changelog From b2f258da7d7f350e6ea5ae3c2881e6cac09421c776fd1773b2291b25e7b3fc80 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Thu, 11 Dec 2025 06:01:27 +0000 Subject: [PATCH 2/2] - Add patch support-python314.patch: * Support new Python 3.14 linkat. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-ptrace?expand=0&rev=22 --- python-python-ptrace.changes | 4 +++- python-python-ptrace.spec | 2 ++ support-python314.patch | 28 ++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 support-python314.patch diff --git a/python-python-ptrace.changes b/python-python-ptrace.changes index 434dbcf..ddd54f8 100644 --- a/python-python-ptrace.changes +++ b/python-python-ptrace.changes @@ -1,5 +1,5 @@ ------------------------------------------------------------------- -Thu Dec 11 05:53:43 UTC 2025 - Steve Kowalik +Thu Dec 11 06:00:41 UTC 2025 - Steve Kowalik - Update to 0.9.9: * Fix PROC_MAP_REGEX for three digit minor device id by @fab1ano in #73 @@ -11,6 +11,8 @@ Thu Dec 11 05:53:43 UTC 2025 - Steve Kowalik - Drop patches, included upstream: * python-ptrace-pr81-importlib.patch * python-ptrace-pr83-importlib.patch +- Add patch support-python314.patch: + * Support new Python 3.14 linkat. ------------------------------------------------------------------- Sun Mar 3 19:17:50 UTC 2024 - Ben Greiner diff --git a/python-python-ptrace.spec b/python-python-ptrace.spec index b79e17b..101869c 100644 --- a/python-python-ptrace.spec +++ b/python-python-ptrace.spec @@ -43,6 +43,8 @@ Summary: Python binding for ptrace License: GPL-2.0-only URL: https://github.com/vstinner/python-ptrace Source: https://github.com/haypo/python-ptrace/archive/%{pyversion}.tar.gz#/python-ptrace-%{pyversion}.tar.gz +# PATCH-FIX-UPSTREAM gh#vstinner/python-ptrace#91 +Patch0: support-python314.patch %if "%{flavor}" == "cptrace" BuildRequires: %{python_module devel} %else diff --git a/support-python314.patch b/support-python314.patch new file mode 100644 index 0000000..c15fb87 --- /dev/null +++ b/support-python314.patch @@ -0,0 +1,28 @@ +From 324404a3d7ca7d329f1595f2520e779412d6fa98 Mon Sep 17 00:00:00 2001 +From: Stefano Rivera +Date: Sat, 11 Oct 2025 15:36:41 +0200 +Subject: [PATCH] Add support for Python 3.14 + +Python 3.14 now uses linkat() if it's available +https://github.com/python/cpython/issues/81793 + +I'm not quite sure why the ARM64 and RISC-V versions were using +linkat() there, previously, but that doesn't seem relevant to this +change :) +--- + tests/test_strace.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_strace.py b/tests/test_strace.py +index 2020a3b..89f77b6 100755 +--- a/tests/test_strace.py ++++ b/tests/test_strace.py +@@ -86,7 +86,7 @@ def test_rename(self): + + def test_link(self): + pattern = br"^link\('oldpath', 'newpath'\)" +- if AARCH64 or RISCV: ++ if AARCH64 or RISCV or sys.version_info >= (3, 14): + pattern = br"^linkat\(.*'oldpath'.*'newpath'.*\)" + self.assert_syscall("import os; os.link('oldpath', 'newpath')", + pattern)