Compare commits

..

No commits in common. "master" and "f22" have entirely different histories.
master ... f22

5 changed files with 181 additions and 162 deletions

5
.gitignore vendored
View File

@ -4,8 +4,3 @@ greenlet-0.3.1.tar.gz
/greenlet-0.4.2.zip
/greenlet-0.4.5.zip
/greenlet-0.4.7.zip
/greenlet-0.4.9.zip
/0.4.11.tar.gz
/greenlet-0.4.12.tar.gz
/greenlet-0.4.13.tar.gz
/greenlet-0.4.14.tar.gz

View File

@ -1,48 +0,0 @@
From d05b62bb75e6a3e217435a1fe0f15a53e692898c Mon Sep 17 00:00:00 2001
From: Victor Stinner <vstinner@python.org>
Date: Wed, 18 Mar 2020 15:09:33 +0100
Subject: [PATCH] Port to Python 3.9
On Python 3.9, define _Py_DEC_REFTOTAL which has been removed by:
https://github.com/python/cpython/commit/49932fec62c616ec88da52642339d83ae719e924
Replace also PyEval_CallObjectWithKeywords() with PyObject_Call(),
since PyEval_CallObjectWithKeywords() has been deprecated in
Python 3.9 and PyObject_Call() has the same behavior. The only
difference is that PyEval_CallObjectWithKeywords() can be called with
args=NULL, but g_initialstub() ensures that args is not NULL.
---
greenlet.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/greenlet.c b/greenlet.c
index ec738b9..d37fc97 100644
--- a/greenlet.c
+++ b/greenlet.c
@@ -109,6 +109,16 @@ extern PyTypeObject PyGreenlet_Type;
#define GREENLET_USE_TRACING 1
#endif
+#ifndef _Py_DEC_REFTOTAL
+ /* _Py_DEC_REFTOTAL macro has been removed from Python 3.9 by:
+ https://github.com/python/cpython/commit/49932fec62c616ec88da52642339d83ae719e924 */
+# ifdef Py_REF_DEBUG
+# define _Py_DEC_REFTOTAL _Py_RefTotal--
+# else
+# define _Py_DEC_REFTOTAL
+# endif
+#endif
+
/* Weak reference to the switching-to greenlet during the slp switch */
static PyGreenlet* volatile ts_target = NULL;
/* Strong reference to the switching from greenlet after the switch */
@@ -820,8 +830,7 @@ static int GREENLET_NOINLINE(g_initialstub)(void* mark)
result = NULL;
} else {
/* call g.run(*args, **kwargs) */
- result = PyEval_CallObjectWithKeywords(
- run, args, kwargs);
+ result = PyObject_Call(run, args, kwargs);
Py_DECREF(args);
Py_XDECREF(kwargs);
}

View File

@ -0,0 +1,83 @@
From 9ad99fb5b9db916ca81bd3f5717c67e20384f7e0 Mon Sep 17 00:00:00 2001
From: Ulrich Weigand <uweigand@de.ibm.com>
Date: Fri, 17 Jul 2015 14:03:17 -0500
Subject: [PATCH 1/2] Add suuport for ppc64 in LE mode running ABIv2
Signed-off-by: Ulrich Weigand <uweigand@de.ibm.com>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
platform/switch_ppc64_linux.h | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/platform/switch_ppc64_linux.h b/platform/switch_ppc64_linux.h
index ee40f67..0f20756 100644
--- a/platform/switch_ppc64_linux.h
+++ b/platform/switch_ppc64_linux.h
@@ -2,6 +2,8 @@
* this is the internal transfer function.
*
* HISTORY
+ * 10-Dec-13 Ulrich Weigand <uweigand@de.ibm.com>
+ * Support ELFv2 ABI. Save float/vector registers.
* 09-Mar-12 Michael Ellerman <michael@ellerman.id.au>
* 64-bit implementation, copied from 32-bit.
* 07-Sep-05 (py-dev mailing list discussion)
@@ -40,14 +42,28 @@
#ifdef SLP_EVAL
+#if _CALL_ELF == 2
+#define STACK_MAGIC 4
+#else
#define STACK_MAGIC 6
+#endif
+
+#if defined(__ALTIVEC__)
+#define ALTIVEC_REGS \
+ "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", \
+ "v28", "v29", "v30", "v31",
+#else
+#define ALTIVEC_REGS
+#endif
-/* !!!!WARNING!!!! need to add "r31" in the next line if this header file
- * is meant to be compiled non-dynamically!
- */
#define REGS_TO_SAVE "r2", "r14", "r15", "r16", "r17", "r18", "r19", "r20", \
"r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r31", \
+ "fr14", "fr15", "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", \
+ "fr22", "fr23", "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", \
+ "fr30", "fr31", \
+ ALTIVEC_REGS \
"cr2", "cr3", "cr4"
+
static int
slp_switch(void)
{
From 4d0c450852a2b0cf6307cf6ca53dcdeea357cd48 Mon Sep 17 00:00:00 2001
From: Tony Breeds <tony@bakeyournoodle.com>
Date: Fri, 17 Jul 2015 14:05:04 -0500
Subject: [PATCH 2/2] Force -fno-tree-dominator-opts for ppc64 in LE mode
Disable the optimisations that are most likely to break the fragile
C/asm logic.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
setup.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/setup.py b/setup.py
index ab02d93..acf9fec 100755
--- a/setup.py
+++ b/setup.py
@@ -50,6 +50,8 @@ def _find_platform_headers():
if sys.platform == 'win32' and os.environ.get('GREENLET_STATIC_RUNTIME') in ('1', 'yes'):
extra_compile_args = ['/MT']
+ elif os.uname()[4] in ['ppc64el', 'ppc64le']:
+ extra_compile_args = ['-fno-tree-dominator-opts']
else:
extra_compile_args = []

View File

@ -1,133 +1,122 @@
%global modname greenlet
%global with_python3 1
Name: python-%{modname}
Version: 0.4.14
Release: 8%{?dist}
Name: python-greenlet
Version: 0.4.7
Release: 2%{?dist}
Summary: Lightweight in-process concurrent programming
Group: Development/Libraries
License: MIT
URL: https://github.com/python-greenlet/greenlet
Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz
BuildRequires: gcc-c++
Patch1: %{url}/commit/c644ca6823994b958e004b3e00b587723181b58e.patch
%global _description \
The greenlet package is a spin-off of Stackless, a version of CPython\
that supports micro-threads called "tasklets". Tasklets run\
pseudo-concurrently (typically in a single or a few OS-level threads)\
and are synchronized with data exchanges on "channels".
%description %{_description}
%package -n python3-%{modname}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{modname}}
URL: http://pypi.python.org/pypi/greenlet
Source0: http://pypi.python.org/packages/source/g/greenlet/greenlet-%{version}.zip
#
# already upstreamed, should be in next release.
# https://github.com/python-greenlet/greenlet/pull/89
Patch0: python-greenlet-0.4.7-ppc64le.patch
BuildRequires: python2-devel
BuildRequires: python-setuptools
%if 0%{?with_python3}
BuildRequires: python-tools
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif # if with_python3
%description -n python3-%{modname} %{_description}
%description
The greenlet package is a spin-off of Stackless, a version of CPython
that supports micro-threads called "tasklets". Tasklets run
pseudo-concurrently (typically in a single or a few OS-level threads)
and are synchronized with data exchanges on "channels".
Python 3 version.
%package devel
Summary: C development headers for python-greenlet
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
This package contains header files required for C modules development.
%package -n python3-%{modname}-devel
Summary: C development headers for python3-%{modname}
%{?python_provide:%python_provide python3-%{modname}-devel}
Requires: python3-%{modname}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%if 0%{?with_python3}
%package -n python3-greenlet
Summary: C development headers for python-greenlet
Group: Development/Libraries
%description -n python3-%{modname}-devel
%{summary}.
%description -n python3-greenlet
The greenlet package is a spin-off of Stackless, a version of CPython
that supports micro-threads called "tasklets". Tasklets run
pseudo-concurrently (typically in a single or a few OS-level threads)
and are synchronized with data exchanges on "channels".
Python 3 version.
This is the Python 3 version of greenlet.
%package -n python3-greenlet-devel
Summary: C development headers for python3-greenlet
Group: Development/Libraries
Requires: python3-greenlet = %{version}-%{release}
%description -n python3-greenlet-devel
This package contains header files required for C modules development.
%endif # if with_python3
%prep
%autosetup -n %{modname}-%{version} -p1
%setup -q -n greenlet-%{version}
%patch0 -p1
chmod 644 benchmarks/*.py
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # if with_python3
%build
%py3_build
CFLAGS="%{optflags}" %{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="%{optflags}" %{__python3} setup.py build
popd
%endif # if with_python3
%install
%py3_install
# Install python 3 first, so that python 2 gets precedence:
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif # if with_python3
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
%check
%{__python3} setup.py test
# Run the upstream test suite and benchmarking suite to further exercise the code
%{__python2} setup.py test
PYTHONPATH=$(pwd) %{__python2} benchmarks/chain.py
%if 0%{?with_python3}
PYTHONPATH=
pushd %{py3dir}
%{__python3} setup.py test || :
2to3 -w --no-diffs -n benchmarks/chain.py
PYTHONPATH=$(pwd) %{__python3} benchmarks/chain.py
%endif # if with_python3
%files -n python3-%{modname}
%license LICENSE LICENSE.PSF
%doc AUTHORS NEWS README.rst
%{python3_sitearch}/%{modname}-*.egg-info
%{python3_sitearch}/%{modname}*.so
%files
%doc AUTHORS NEWS README.rst LICENSE LICENSE.PSF NEWS
%doc doc/greenlet.txt README.rst benchmarks
%{python_sitearch}/greenlet.so
%{python_sitearch}/greenlet*.egg-info
%files devel
%doc AUTHORS NEWS README.rst LICENSE LICENSE.PSF NEWS
%{_includedir}/python2*/greenlet
%if 0%{?with_python3}
%files -n python3-greenlet
%doc AUTHORS NEWS README.rst LICENSE LICENSE.PSF NEWS
%doc doc/greenlet.txt README.rst benchmarks
%{python3_sitearch}/greenlet.cpython-*.so
%{python3_sitearch}/greenlet*.egg-info
%files -n python3-greenlet-devel
%{_includedir}/python%{python3_version}*/%{modname}/
%doc AUTHORS NEWS README.rst LICENSE LICENSE.PSF NEWS
%{_includedir}/python3*/greenlet
%endif # if with_python3
%changelog
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 0.4.14-8
- Rebuilt for Python 3.9
* Thu May 21 2020 Miro Hrončok <mhroncok@redhat.com> - 0.4.14-7
- Fix Python 3.9 build
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.14-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Sep 26 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4.14-5
- Subpackages python2-greenlet, python2-greenlet-devel have been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4.14-4
- Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.14-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jul 18 2018 Kevin Fenzi <kevin@scrye.com> - 0.4.14-1
- Update to 0.4.14.
- Drop upstreamed/no longer needed patches.
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.13-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jul 03 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.13-4
- Add fix for Python 3.7
* Sat Jun 16 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.13-3
- Rebuilt for Python 3.7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.4.13-1
- Update to 0.4.13
* Fri Jan 12 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.4.12-1
- Update to 0.4.12
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.11-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.11-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Dec 20 2016 Miro Hrončok <mhroncok@redhat.com> - 0.4.11-2
- Rebuild for Python 3.6
* Sun Dec 11 2016 Kevin Fenzi <kevin@scrye.com> - 0.4.11-1
- Update to 0.4.11. Fixes bug #1403514
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.9-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Sun Oct 25 2015 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.4.9-1
- Update to 0.4.9
- Use %license macro
- Follow new RPM Packaging guidelines
- Cleanups in spec
* Fri Aug 21 2015 Kevin Fenzi <kevin@scrye.com> 0.4.7-2
- Re-enable tests on secondary arches. Fixes #1252899
- Applied patch to build on ppc64le. Fixes #1252900
@ -138,7 +127,7 @@ Python 3 version.
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sun Mar 29 2015 Terje Røsten <terje.rosten@ntnu.no> - 0.4.5-1
* Sun Mar 29 2015 Terje Røsten <terje.rosten@ntnu.no> - 0.4.5-1
- 0.4.5
- Add python3 subpackage
- Ship license files

View File

@ -1 +1 @@
SHA512 (greenlet-0.4.14.tar.gz) = c86802a0df56b78482b029a0eaf624ca8f14d0e704480b30a8a35e343b3e4a16e80b6f169a970a39935b39d56aafc25bada0738199818b5892ca398a809d54ef
c2333a8ff30fa75c5d5ec0e67b461086 greenlet-0.4.7.zip