diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-10-11 17:18:26 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-10-11 17:43:32 -0700 |
commit | 8ac152e9e8de65de5857b95560c12b60fd19d7a3 (patch) | |
tree | 25da94d258c9cebbd9633f4efabbc92ab0806523 | |
parent | 354608cb88042a7255aaf5c792b7638cb37a3979 (diff) | |
download | meta-openembedded-8ac152e9e8de65de5857b95560c12b60fd19d7a3.tar.gz |
python3-gevent: Upgrade to 22.8.0
This has the python 3.11 fix in it so drop the patch
Add a patch to avoid adding native include paths to compiler cmdline
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Alexander Kanavin <alex@linutronix.de>
-rw-r--r-- | meta-python/recipes-devtools/python/python3-gevent/0001-_setuputils.py-Do-not-add-sys_inc_dir.patch | 40 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch | 170 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-gevent_22.8.0.bb (renamed from meta-python/recipes-devtools/python/python3-gevent_21.12.0.bb) | 6 |
3 files changed, 43 insertions, 173 deletions
diff --git a/meta-python/recipes-devtools/python/python3-gevent/0001-_setuputils.py-Do-not-add-sys_inc_dir.patch b/meta-python/recipes-devtools/python/python3-gevent/0001-_setuputils.py-Do-not-add-sys_inc_dir.patch new file mode 100644 index 000000000..ac8b031cf --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-gevent/0001-_setuputils.py-Do-not-add-sys_inc_dir.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From f3267ad7994a4b66e6bcf72cb0e418105f77bd52 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 11 Oct 2022 17:37:01 -0700 | ||
4 | Subject: [PATCH] _setuputils.py: Do not add sys_inc_dir | ||
5 | |||
6 | sys_inc_dir computes to ignore sysroot and ends with paths into host | ||
7 | system include area, which is then flagged by OE gcc since it finds | ||
8 | the host include path poisoning. Since we are adding the syroot anyway | ||
9 | we really do not need setuptools to deduce it for us. | ||
10 | |||
11 | Upstream-Status: Inappropriate [ Cross-compile specific ] | ||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | _setuputils.py | 3 +-- | ||
15 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/_setuputils.py b/_setuputils.py | ||
18 | index d98f716..31134a4 100644 | ||
19 | --- a/_setuputils.py | ||
20 | +++ b/_setuputils.py | ||
21 | @@ -161,7 +161,6 @@ def get_include_dirs(*extra_paths): | ||
22 | # Neither sysconfig dir is not enough if we're in a virtualenv; the greenlet.h | ||
23 | # header goes into a site/ subdir. See https://github.com/pypa/pip/issues/4610 | ||
24 | dist_inc_dir = os.path.abspath(dist_sysconfig.get_python_inc()) # 1 | ||
25 | - sys_inc_dir = os.path.abspath(sysconfig.get_path("include")) # 2 | ||
26 | venv_include_dir = os.path.join( | ||
27 | sys.prefix, 'include', 'site', | ||
28 | 'python' + sysconfig.get_python_version() | ||
29 | @@ -175,7 +174,7 @@ def get_include_dirs(*extra_paths): | ||
30 | |||
31 | return [ | ||
32 | p | ||
33 | - for p in (dist_inc_dir, sys_inc_dir, dep_inc_dir) + extra_paths | ||
34 | + for p in (dist_inc_dir, dep_inc_dir) + extra_paths | ||
35 | if os.path.exists(p) | ||
36 | ] | ||
37 | |||
38 | -- | ||
39 | 2.38.0 | ||
40 | |||
diff --git a/meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch b/meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch deleted file mode 100644 index 6750c1a3c..000000000 --- a/meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch +++ /dev/null | |||
@@ -1,170 +0,0 @@ | |||
1 | From 90e9169c915a640739880b55ed95f88ce21fa7b0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Victor Stinner <vstinner@python.org> | ||
3 | Date: Tue, 1 Mar 2022 22:28:40 +0100 | ||
4 | Subject: [PATCH] Add Python 3.11 alpha 6 support | ||
5 | |||
6 | * On Python 3.11a6 and newer, get the PyFrameObject structure from | ||
7 | the internal C API ("internal/pycore_frame.h"). | ||
8 | * On Python 3.9 and newer, use PyFrame_GetBack() and | ||
9 | PyFrame_GetCode(). | ||
10 | * Add frame getter and setter functions to greenlet: | ||
11 | |||
12 | * get_f_code(frame) | ||
13 | * set_f_lineno(frame, lineno) | ||
14 | * set_f_code(frame, code) | ||
15 | |||
16 | * greenlet.h: the CFrame type has been renamed to _PyCFrame. | ||
17 | |||
18 | Upstream-Status: Submitted [https://github.com/gevent/gevent/pull/1872] | ||
19 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
20 | --- | ||
21 | _setuputils.py | 4 +++ | ||
22 | deps/greenlet/greenlet.h | 6 +++- | ||
23 | src/gevent/_gevent_cgreenlet.pxd | 59 ++++++++++++++++++++++++-------- | ||
24 | src/gevent/greenlet.py | 7 ++-- | ||
25 | 4 files changed, 59 insertions(+), 17 deletions(-) | ||
26 | |||
27 | diff --git a/_setuputils.py b/_setuputils.py | ||
28 | index 7257b3eea..0b14ab1f0 100644 | ||
29 | --- a/_setuputils.py | ||
30 | +++ b/_setuputils.py | ||
31 | @@ -244,6 +244,10 @@ def cythonize1(ext): | ||
32 | 'infer_types': True, | ||
33 | 'nonecheck': False, | ||
34 | }, | ||
35 | + compile_time_env={ | ||
36 | + 'PY39B1': sys.hexversion >= 0x030900B1, | ||
37 | + 'PY311A6': sys.hexversion >= 0x030B00A6, | ||
38 | + }, | ||
39 | # The common_utility_include_dir (not well documented) | ||
40 | # causes Cython to emit separate files for much of the | ||
41 | # static support code. Each of the modules then includes | ||
42 | diff --git a/deps/greenlet/greenlet.h b/deps/greenlet/greenlet.h | ||
43 | index 830bef8dd..f07ce1833 100644 | ||
44 | --- a/deps/greenlet/greenlet.h | ||
45 | +++ b/deps/greenlet/greenlet.h | ||
46 | @@ -14,6 +14,10 @@ extern "C" { | ||
47 | /* This is deprecated and undocumented. It does not change. */ | ||
48 | #define GREENLET_VERSION "1.0.0" | ||
49 | |||
50 | +#if PY_VERSION_HEX < 0x30B00A6 | ||
51 | +# define _PyCFrame CFrame | ||
52 | +#endif | ||
53 | + | ||
54 | typedef struct _greenlet { | ||
55 | PyObject_HEAD | ||
56 | char* stack_start; | ||
57 | @@ -39,7 +43,7 @@ typedef struct _greenlet { | ||
58 | PyObject* context; | ||
59 | #endif | ||
60 | #if PY_VERSION_HEX >= 0x30A00B1 | ||
61 | - CFrame* cframe; | ||
62 | + _PyCFrame* cframe; | ||
63 | #endif | ||
64 | } PyGreenlet; | ||
65 | |||
66 | diff --git a/src/gevent/_gevent_cgreenlet.pxd b/src/gevent/_gevent_cgreenlet.pxd | ||
67 | index cbb81a638..246773e24 100644 | ||
68 | --- a/src/gevent/_gevent_cgreenlet.pxd | ||
69 | +++ b/src/gevent/_gevent_cgreenlet.pxd | ||
70 | @@ -57,30 +57,61 @@ cdef extern from "Python.h": | ||
71 | ctypedef class types.CodeType [object PyCodeObject]: | ||
72 | pass | ||
73 | |||
74 | -cdef extern from "frameobject.h": | ||
75 | - | ||
76 | - ctypedef class types.FrameType [object PyFrameObject]: | ||
77 | - cdef CodeType f_code | ||
78 | - # Accessing the f_lineno directly doesn't work. There is an accessor | ||
79 | - # function, PyFrame_GetLineNumber that is needed to turn the raw line number | ||
80 | - # into the executing line number. | ||
81 | - # cdef int f_lineno | ||
82 | - # We can't declare this in the object as an object, because it's | ||
83 | - # allowed to be NULL, and Cython can't handle that. | ||
84 | - # We have to go through the python machinery to get a | ||
85 | - # proper None instead, or use an inline function. | ||
86 | - cdef void* f_back | ||
87 | +IF PY311A6: | ||
88 | + cdef extern from "internal/pycore_frame.h": | ||
89 | + ctypedef class types._PyInterpreterFrame [object _PyInterpreterFrame]: | ||
90 | + cdef CodeType f_code | ||
91 | + | ||
92 | + ctypedef class types.FrameType [object PyFrameObject]: | ||
93 | + cdef _PyInterpreterFrame f_frame | ||
94 | + # Accessing the f_lineno directly doesn't work. There is an accessor | ||
95 | + # function, PyFrame_GetLineNumber that is needed to turn the raw line number | ||
96 | + # into the executing line number. | ||
97 | + # cdef int f_lineno | ||
98 | + # We can't declare this in the object as an object, because it's | ||
99 | + # allowed to be NULL, and Cython can't handle that. | ||
100 | + # We have to go through the python machinery to get a | ||
101 | + # proper None instead, or use an inline function. | ||
102 | + cdef void* f_back | ||
103 | +ELSE: | ||
104 | + cdef extern from "frameobject.h": | ||
105 | + ctypedef class types.FrameType [object PyFrameObject]: | ||
106 | + cdef CodeType f_code | ||
107 | + cdef void* f_back | ||
108 | |||
109 | +cdef extern from "frameobject.h": | ||
110 | int PyFrame_GetLineNumber(FrameType frame) | ||
111 | + IF PY39B1: | ||
112 | + CodeType PyFrame_GetCode(FrameType frame) | ||
113 | + void* PyFrame_GetBack(FrameType frame) | ||
114 | |||
115 | @cython.nonecheck(False) | ||
116 | cdef inline FrameType get_f_back(FrameType frame): | ||
117 | + IF PY39B1: | ||
118 | + f_back = PyFrame_GetBack(frame) | ||
119 | + ELSE: | ||
120 | + f_back = frame.f_back | ||
121 | if frame.f_back != NULL: | ||
122 | - return <FrameType>frame.f_back | ||
123 | + return <FrameType>f_back | ||
124 | |||
125 | cdef inline int get_f_lineno(FrameType frame): | ||
126 | return PyFrame_GetLineNumber(frame) | ||
127 | |||
128 | +cdef inline void set_f_lineno(FrameType frame, int lineno): | ||
129 | + frame.f_lineno = lineno | ||
130 | + | ||
131 | +cdef inline CodeType get_f_code(FrameType frame): | ||
132 | + IF PY39B1: | ||
133 | + return PyFrame_GetCode(frame) | ||
134 | + ELSE: | ||
135 | + return frame.f_code | ||
136 | + | ||
137 | +cdef inline void set_f_code(FrameType frame, CodeType code): | ||
138 | + IF PY311A6: | ||
139 | + frame.f_frame.f_code = code | ||
140 | + ELSE: | ||
141 | + frame.f_code = code | ||
142 | + | ||
143 | cdef void _init() | ||
144 | |||
145 | cdef class SpawnedLink: | ||
146 | diff --git a/src/gevent/greenlet.py b/src/gevent/greenlet.py | ||
147 | index bed12ed44..f925770bb 100644 | ||
148 | --- a/src/gevent/greenlet.py | ||
149 | +++ b/src/gevent/greenlet.py | ||
150 | @@ -58,6 +58,9 @@ | ||
151 | # Frame access | ||
152 | locals()['get_f_back'] = lambda frame: frame.f_back | ||
153 | locals()['get_f_lineno'] = lambda frame: frame.f_lineno | ||
154 | +locals()['set_f_lineno'] = lambda frame, lineno: setattr(frame, 'f_lineno', lineno) | ||
155 | +locals()['get_f_code'] = lambda frame: frame.f_code | ||
156 | +locals()['set_f_code'] = lambda frame, code: setattr(frame, 'f_code', code) | ||
157 | |||
158 | if _PYPY: | ||
159 | import _continuation # pylint:disable=import-error | ||
160 | @@ -157,8 +160,8 @@ def _extract_stack(limit): | ||
161 | # Arguments are always passed to the constructor as Python objects, | ||
162 | # meaning we wind up boxing the f_lineno just to unbox it if we pass it. | ||
163 | # It's faster to simply assign once the object is created. | ||
164 | - older_Frame.f_code = frame.f_code | ||
165 | - older_Frame.f_lineno = get_f_lineno(frame) # pylint:disable=undefined-variable | ||
166 | + set_f_code(older_Frame.f_code, get_f_code(frame)) | ||
167 | + set_f_lineno(older_Frame.f_lineno, get_f_lineno(frame)) # pylint:disable=undefined-variable | ||
168 | if newer_Frame is not None: | ||
169 | newer_Frame.f_back = older_Frame | ||
170 | newer_Frame = older_Frame | ||
diff --git a/meta-python/recipes-devtools/python/python3-gevent_21.12.0.bb b/meta-python/recipes-devtools/python/python3-gevent_22.8.0.bb index f891c2eea..96a0cb78e 100644 --- a/meta-python/recipes-devtools/python/python3-gevent_21.12.0.bb +++ b/meta-python/recipes-devtools/python/python3-gevent_22.8.0.bb | |||
@@ -11,7 +11,9 @@ RDEPENDS:${PN} = "${PYTHON_PN}-greenlet \ | |||
11 | ${PYTHON_PN}-pprint \ | 11 | ${PYTHON_PN}-pprint \ |
12 | " | 12 | " |
13 | 13 | ||
14 | SRC_URI[sha256sum] = "f48b64578c367b91fa793bf8eaaaf4995cb93c8bc45860e473bf868070ad094e" | 14 | SRC_URI += "file://0001-_setuputils.py-Do-not-add-sys_inc_dir.patch" |
15 | |||
16 | SRC_URI[sha256sum] = "868d500fe2b7f9750eadc07ada8ab32360c0e71976be2bf5919482f14a6477c7" | ||
15 | 17 | ||
16 | inherit pypi setuptools3 | 18 | inherit pypi setuptools3 |
17 | 19 | ||
@@ -31,5 +33,3 @@ do_configure:append() { | |||
31 | do_compile:append() { | 33 | do_compile:append() { |
32 | sed -i -e 's#${WORKDIR}##g' ${S}/src/gevent/*.c ${S}/src/gevent/libev/*.c ${S}/src/gevent/resolver/*.c | 34 | sed -i -e 's#${WORKDIR}##g' ${S}/src/gevent/*.c ${S}/src/gevent/libev/*.c ${S}/src/gevent/resolver/*.c |
33 | } | 35 | } |
34 | |||
35 | SRC_URI += "file://py-3.11.patch" | ||