jpy can not be compiled with python3.11
Alex-Izquierdo opened this issue · 0 comments
Alex-Izquierdo commented
jpy can not be compiled with python3.11, as a consequence ansible-rulebook installation fails.
@benthomasson @mkanoor
PIP_NO_BINARY=jpy pip install jpy
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Collecting jpy
Using cached jpy-0.12.0.tar.gz (171 kB)
Preparing metadata (setup.py) ... done
Installing collected packages: jpy
DEPRECATION: jpy is being installed using the legacy 'setup.py install' method, because the '--no-binary' option was enabled for it and this currently disables local wheel building for projects that don't have a 'pyproject.toml' file. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/11451
Running setup.py install for jpy ... error
error: subprocess-exited-with-error
× Running setup.py install for jpy did not run successfully.
│ exit code: 1
╰─> [198 lines of output]
/usr/local/lib/python3.11/site-packages/setuptools/dist.py:771: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running install
/usr/local/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-311
copying jpyutil.py -> build/lib.linux-x86_64-cpython-311
running build_ext
building 'jpy' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/src
creating build/temp.linux-x86_64-cpython-311/src/main
creating build/temp.linux-x86_64-cpython-311/src/main/c
creating build/temp.linux-x86_64-cpython-311/src/main/c/jni
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Isrc/main/c -I/usr/lib/jvm/java-17-openjdk-amd64/include -I/usr/lib/jvm/java-17-openjdk-amd64/include/linux -I/usr/local/include/python3.11 -c src/main/c/jni/org_jpy_PyLib.c -o build/temp.linux-x86_64-cpython-311/src/main/c/jni/org_jpy_PyLib.o
src/main/c/jni/org_jpy_PyLib.c: In function ‘Java_org_jpy_PyLib_setPythonHome’:
src/main/c/jni/org_jpy_PyLib.c:170:31: warning: passing argument 1 of ‘PyMem_RawFree’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
170 | PyMem_RawFree(pythonHome);
| ^~~~~~~~~~
In file included from /usr/local/include/python3.11/pymem.h:96,
from /usr/local/include/python3.11/Python.h:41,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/cpython/pymem.h:8:38: note: expected ‘void *’ but argument is of type ‘const wchar_t *’ {aka ‘const int *’}
8 | PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
| ~~~~~~^~~
src/main/c/jni/org_jpy_PyLib.c:184:13: warning: ‘Py_SetPythonHome’ is deprecated [-Wdeprecated-declarations]
184 | Py_SetPythonHome(staticPythonHome);
| ^~~~~~~~~~~~~~~~
In file included from /usr/local/include/python3.11/Python.h:94,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/pylifecycle.h:40:38: note: declared here
40 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
| ^~~~~~~~~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:187:27: warning: passing argument 1 of ‘PyMem_RawFree’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
187 | PyMem_RawFree(pythonHome);
| ^~~~~~~~~~
In file included from /usr/local/include/python3.11/pymem.h:96,
from /usr/local/include/python3.11/Python.h:41,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/cpython/pymem.h:8:38: note: expected ‘void *’ but argument is of type ‘const wchar_t *’ {aka ‘const int *’}
8 | PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
| ~~~~~~^~~
src/main/c/jni/org_jpy_PyLib.c: In function ‘Java_org_jpy_PyLib_setProgramName’:
src/main/c/jni/org_jpy_PyLib.c:237:31: warning: passing argument 1 of ‘PyMem_RawFree’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
237 | PyMem_RawFree(programName);
| ^~~~~~~~~~~
In file included from /usr/local/include/python3.11/pymem.h:96,
from /usr/local/include/python3.11/Python.h:41,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/cpython/pymem.h:8:38: note: expected ‘void *’ but argument is of type ‘const wchar_t *’ {aka ‘const int *’}
8 | PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
| ~~~~~~^~~
src/main/c/jni/org_jpy_PyLib.c:251:13: warning: ‘Py_SetProgramName’ is deprecated [-Wdeprecated-declarations]
251 | Py_SetProgramName(staticProgramName);
| ^~~~~~~~~~~~~~~~~
In file included from /usr/local/include/python3.11/Python.h:94,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/pylifecycle.h:37:38: note: declared here
37 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
| ^~~~~~~~~~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:254:27: warning: passing argument 1 of ‘PyMem_RawFree’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
254 | PyMem_RawFree(programName);
| ^~~~~~~~~~~
In file included from /usr/local/include/python3.11/pymem.h:96,
from /usr/local/include/python3.11/Python.h:41,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/cpython/pymem.h:8:38: note: expected ‘void *’ but argument is of type ‘const wchar_t *’ {aka ‘const int *’}
8 | PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
| ~~~~~~^~~
src/main/c/jni/org_jpy_PyLib.c: In function ‘Java_org_jpy_PyLib_startPython0’:
src/main/c/jni/org_jpy_PyLib.c:280:9: warning: ‘PySys_SetArgvEx’ is deprecated [-Wdeprecated-declarations]
280 | PySys_SetArgvEx(0, NULL, 0);
| ^~~~~~~~~~~~~~~
In file included from /usr/local/include/python3.11/Python.h:96,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/sysmodule.h:14:38: note: declared here
14 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int);
| ^~~~~~~~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:284:9: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
284 | PyEval_InitThreads();
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/python3.11/Python.h:95,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/ceval.h:132:37: note: declared here
132 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
| ^~~~~~~~~~~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c: In function ‘Java_org_jpy_PyLib_executeCode’:
src/main/c/jni/org_jpy_PyLib.c:1024:16: warning: returning ‘void *’ from a function with return type ‘jlong’ {aka ‘long int’} makes integer from pointer without a cast [-Wint-conversion]
1024 | return NULL;
| ^~~~
src/main/c/jni/org_jpy_PyLib.c:1029:101: warning: passing argument 7 of ‘executeInternal’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
1029 | result = executeInternal(jenv, jLibClass, jStart, jGlobals, jLocals, (DoRun)pyRunStringWrapper, codeChars);
| ^~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:890:128: note: expected ‘void *’ but argument is of type ‘const char *’
890 | jlong executeInternal(JNIEnv* jenv, jclass jLibClass, jint jStart, jobject jGlobals, jobject jLocals, DoRun runFunction, void *runArg) {
| ~~~~~~^~~~~~
src/main/c/jni/org_jpy_PyLib.c: In function ‘Java_org_jpy_PyLib_getType’:
src/main/c/jni/org_jpy_PyLib.c:1364:14: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from incompatible pointer type ‘PyTypeObject *’ {aka ‘struct _typeobject *’} [-Wincompatible-pointer-types]
1364 | pyObject = ((PyObject*) objId)->ob_type;
| ^
src/main/c/jni/org_jpy_PyLib.c: In function ‘PyLib_CallAndReturnObject’:
src/main/c/jni/org_jpy_PyLib.c:2350:68: warning: passing argument 4 of ‘PyLib_FromJObjectForTuple’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
2350 | pyArg = PyLib_FromJObjectForTuple(jenv, jArg, jParamClass, nameChars, i);
| ^~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:2270:91: note: expected ‘char *’ but argument is of type ‘const char *’
2270 | PyObject* PyLib_FromJObjectForTuple(JNIEnv *jenv, jobject jArg, jclass jParamClass, char* nameChars, jint index) {
| ~~~~~~^~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:2319:16: warning: unused variable ‘jArgParamType’ [-Wunused-variable]
2319 | JPy_JType* jArgParamType;
| ^~~~~~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:2318:16: warning: unused variable ‘explicitParamType’ [-Wunused-variable]
2318 | JPy_JType* explicitParamType = NULL;
| ^~~~~~~~~~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c: In function ‘PyLib_HandlePythonException’:
src/main/c/jni/org_jpy_PyLib.c:2466:36: warning: passing argument 3 of ‘PyErr_Fetch’ from incompatible pointer type [-Wincompatible-pointer-types]
2466 | PyErr_Fetch(&pyType, &pyValue, &pyTraceback);
| ^~~~~~~~~~~~
| |
| PyTracebackObject ** {aka struct _traceback **}
In file included from /usr/local/include/python3.11/Python.h:88,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/pyerrors.h:19:56: note: expected ‘PyObject **’ {aka ‘struct _object **’} but argument is of type ‘PyTracebackObject **’ {aka ‘struct _traceback **’}
19 | PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
| ^~~~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:2469:49: warning: passing argument 3 of ‘PyErr_NormalizeException’ from incompatible pointer type [-Wincompatible-pointer-types]
2469 | PyErr_NormalizeException(&pyType, &pyValue, &pyTraceback);
| ^~~~~~~~~~~~
| |
| PyTracebackObject ** {aka struct _traceback **}
In file included from /usr/local/include/python3.11/Python.h:88,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/pyerrors.h:40:67: note: expected ‘PyObject **’ {aka ‘struct _object **’} but argument is of type ‘PyTracebackObject **’ {aka ‘struct _traceback **’}
40 | PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
| ^~~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:2490:63: warning: passing argument 1 of ‘PyObject_GetAttrString’ from incompatible pointer type [-Wincompatible-pointer-types]
2490 | linenoChars = PyLib_ObjToChars(PyObject_GetAttrString(pyTraceback, "tb_lineno"), &pyLinenoUtf8);
| ^~~~~~~~~~~
| |
| PyTracebackObject * {aka struct _traceback *}
In file included from /usr/local/include/python3.11/Python.h:44,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/object.h:289:47: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘PyTracebackObject *’ {aka ‘struct _traceback *’}
289 | PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *);
| ^~~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:2491:42: warning: passing argument 1 of ‘PyObject_GetAttrString’ from incompatible pointer type [-Wincompatible-pointer-types]
2491 | pyFrame = PyObject_GetAttrString(pyTraceback, "tb_frame");
| ^~~~~~~~~~~
| |
| PyTracebackObject * {aka struct _traceback *}
In file included from /usr/local/include/python3.11/Python.h:44,
from src/main/c/jni/org_jpy_PyLib.c:21:
/usr/local/include/python3.11/object.h:289:47: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘PyTracebackObject *’ {aka ‘struct _traceback *’}
289 | PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *);
| ^~~~~~~~~~
src/main/c/jni/org_jpy_PyLib.c:2530:47: warning: passing argument 1 of ‘python_traceback_report’ from incompatible pointer type [-Wincompatible-pointer-types]
2530 | int err = python_traceback_report(pyTraceback, &javaMessage, &bufLen);
| ^~~~~~~~~~~
| |
| PyTracebackObject * {aka struct _traceback *}
src/main/c/jni/org_jpy_PyLib.c:48:46: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘PyTracebackObject *’ {aka ‘struct _traceback *’}
48 | static int python_traceback_report(PyObject *tb, char **buf, int* bufLen);
| ~~~~~~~~~~^~
src/main/c/jni/org_jpy_PyLib.c: In function ‘append_to_java_message’:
src/main/c/jni/org_jpy_PyLib.c:2702:35: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
2702 | if (strlen(*buf) + msgLen + 1 >= *bufLen) {
| ^~
src/main/c/jni/org_jpy_PyLib.c: In function ‘format_python_traceback’:
src/main/c/jni/org_jpy_PyLib.c:2743:25: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
2743 | tb->tb_frame->f_code->co_filename != last_file ||
| ^~
src/main/c/jni/org_jpy_PyLib.c:2745:46: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
2745 | last_name == NULL || tb->tb_frame->f_code->co_name != last_name) {
| ^~
src/main/c/jni/org_jpy_PyLib.c:2752:37: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
2752 | last_file = tb->tb_frame->f_code->co_filename;
| ^~
src/main/c/jni/org_jpy_PyLib.c:2754:37: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
2754 | last_name = tb->tb_frame->f_code->co_name;
| ^~
src/main/c/jni/org_jpy_PyLib.c:2760:46: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
2760 | tb->tb_frame->f_code->co_filename,
| ^~
src/main/c/jni/org_jpy_PyLib.c:2762:46: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
2762 | tb->tb_frame->f_code->co_name);
| ^~
src/main/c/jni/org_jpy_PyLib.c: In function ‘python_traceback_report’:
src/main/c/jni/org_jpy_PyLib.c:2781:36: warning: passing argument 1 of ‘format_python_traceback’ from incompatible pointer type [-Wincompatible-pointer-types]
2781 | return format_python_traceback(tb, buf, bufLen);
| ^~
| |
| PyObject * {aka struct _object *}
src/main/c/jni/org_jpy_PyLib.c:2721:55: note: expected ‘PyTracebackObject *’ {aka ‘struct _traceback *’} but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
2721 | static int format_python_traceback(PyTracebackObject *tb, char **buf, int *bufLen)
| ~~~~~~~~~~~~~~~~~~~^~
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> jpy
Depends on jpy-consortium/jpy#95