Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIG-1434: Update htsget to Python 3.12 #582

Merged
merged 1 commit into from
May 10, 2024
Merged

Conversation

daisieh
Copy link
Member

@daisieh daisieh commented May 10, 2024

Adding the environment variable as suggested here fixes the issue and now we can update python to 3.12.

@daisieh daisieh requested a review from mshadbolt May 10, 2024 03:51
@daisieh daisieh changed the title Update htsget to Python 3.12 DIG-1434: Update htsget to Python 3.12 May 10, 2024
@mshadbolt
Copy link
Contributor

mshadbolt commented May 10, 2024

I get errors when I try to build uwsgi and pysam

There are a lot of errors but tried to search through logs to find things relevant:
uwsgi:

#9 50.62   Building wheel for uwsgi (setup.py): finished with status 'error'
#9 50.64   error: subprocess-exited-with-error
#9 50.64   
#9 50.64   × python setup.py bdist_wheel did not run successfully.
#9 50.64   │ exit code: 1
#9 50.64   ╰─> [299 lines of output]
#9 50.64       /usr/local/lib/python3.12/site-packages/setuptools/_distutils/dist.py:266: UserWarning: Unknown distribution option: 'descriptions'
#9 50.64         warnings.warn(msg)
#9 50.64       running bdist_wheel
#9 50.64       running build
#9 50.64       running build_py
#9 50.64       creating build
#9 50.64       creating build/lib
#9 50.64       copying uwsgidecorators.py -> build/lib
#9 50.64       /usr/local/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
#9 50.64       !!
#9 50.64       
#9 50.64               ********************************************************************************
#9 50.64               Please avoid running ``setup.py`` directly.
#9 50.64               Instead, use pypa/build, pypa/installer or other
#9 50.64               standards-based tools.
#9 50.64       
#9 50.64               See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
#9 50.64               ********************************************************************************
#9 50.64       
#9 50.64       !!
#9 50.64         self.initialize_options()
#9 50.64       installing to build/bdist.linux-aarch64/wheel
#9 50.64       running install
#9 50.64       using profile: buildconf/default.ini
#9 50.64       detected include path: ['/usr/lib/gcc/aarch64-linux-gnu/12/include', '/usr/local/include', '/usr/include/aarch64-linux-gnu', '/usr/include']
#9 50.64       Patching "bin_name" to properly install_scripts dir
...
[thread 2][gcc] core/cache.o
#9 50.64       core/lock.c: In function ‘uwsgi_lock_fast_init’:
#9 50.64       core/lock.c:114:17: warning: ‘pthread_mutexattr_setrobust_np’ is deprecated: pthread_mutexattr_setrobust_np is deprecated, use pthread_mutexattr_setrobust [-Wdeprecated-declarations]
#9 50.64         114 |                 if (pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST)) {
#9 50.64             |                 ^~
#9 50.64       In file included from /usr/include/features.h:489,
#9 50.64                        from /usr/include/aarch64-linux-gnu/bits/libc-header-start.h:33,
#9 50.64                        from /usr/include/stdio.h:27,
#9 50.64                        from ./uwsgi.h:165,
#9 50.64                        from core/lock.c:1:
#9 50.64       /usr/include/pthread.h:951:12: note: declared here
#9 50.64         951 | extern int __REDIRECT_NTH (pthread_mutexattr_setrobust_np,
#9 50.64             |            ^~~~~~~~~~~~~~
#9 50.64       core/lock.c: In function ‘uwsgi_lock_fast’:
#9 50.64       core/lock.c:176:17: warning: ‘pthread_mutex_consistent_np’ is deprecated: pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent [-Wdeprecated-declarations]
#9 50.64         176 |                 pthread_mutex_consistent((pthread_mutex_t *) uli->lock_ptr);
#9 50.64             |                 ^~~~~~~~~~~~~~~~~~~~~~~~
#9 50.64       /usr/include/pthread.h:859:12: note: declared here
#9 50.64         859 | extern int __REDIRECT_NTH (pthread_mutex_consistent_np, (pthread_mutex_t *),
#9 50.64             |            ^~~~~~~~~~~~~~
...
 50.64       [thread 2][gcc] plugins/python/wsgi_handlers.o
#9 50.64       plugins/python/python_plugin.c:138:9: warning: ‘Py_NoSiteFlag’ is deprecated [-Wdeprecated-declarations]
#9 50.64         138 |         {"no-site", no_argument, 0, "do not import site module", uwsgi_opt_true, &Py_NoSiteFlag, 0},
#9 50.64             |         ^
#9 50.64       In file included from /usr/local/include/python3.12/Python.h:48,
#9 50.64                        from plugins/python/uwsgi_python.h:4,
#9 50.64                        from plugins/python/python_plugin.c:1:
#9 50.64       /usr/local/include/python3.12/cpython/pydebug.h:14:37: note: declared here
#9 50.64          14 | Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_NoSiteFlag;
#9 50.64             |                                     ^~~~~~~~~~~~~
#9 50.64       plugins/python/python_plugin.c: In function ‘uwsgi_python_init’:
#9 50.64       plugins/python/python_plugin.c:239:17: warning: ‘Py_SetPythonHome’ is deprecated [-Wdeprecated-declarations]
#9 50.64         239 |                 Py_SetPythonHome(wpyhome);
#9 50.64             |                 ^~~~~~~~~~~~~~~~
#9 50.64       In file included from /usr/local/include/python3.12/Python.h:94:
#9 50.64       /usr/local/include/python3.12/pylifecycle.h:40:38: note: declared here
#9 50.64          40 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
#9 50.64             |                                      ^~~~~~~~~~~~~~~~
#9 50.64       plugins/python/python_plugin.c:263:9: warning: ‘Py_SetProgramName’ is deprecated [-Wdeprecated-declarations]
#9 50.64         263 |         Py_SetProgramName(pname);
#9 50.64             |         ^~~~~~~~~~~~~~~~~
#9 50.64       /usr/local/include/python3.12/pylifecycle.h:37:38: note: declared here
#9 50.64          37 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
#9 50.64             |                                      ^~~~~~~~~~~~~~~~~
#9 50.64       plugins/python/python_plugin.c:269:9: warning: ‘Py_OptimizeFlag’ is deprecated [-Wdeprecated-declarations]
#9 50.64         269 |         Py_OptimizeFlag = up.optimize;
#9 50.64             |         ^~~~~~~~~~~~~~~
#9 50.64       /usr/local/include/python3.12/cpython/pydebug.h:13:37: note: declared here
#9 50.64          13 | Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_OptimizeFlag;
#9 50.64             |                                     ^~~~~~~~~~~~~~~
#9 50.64       plugins/python/python_plugin.c: In function ‘uwsgi_python_pre_uwsgi_fork’:
#9 50.64       plugins/python/python_plugin.c:1327:17: error: too few arguments to function ‘_PyImport_AcquireLock’
#9 50.64        1327 |                 _PyImport_AcquireLock();
#9 50.64             |                 ^~~~~~~~~~~~~~~~~~~~~
#9 50.64       In file included from /usr/local/include/python3.12/import.h:91,
#9 50.64                        from /usr/local/include/python3.12/Python.h:99:
#9 50.64       /usr/local/include/python3.12/cpython/import.h:13:18: note: declared here
#9 50.64          13 | PyAPI_FUNC(void) _PyImport_AcquireLock(PyInterpreterState *interp);
#9 50.64             |                  ^~~~~~~~~~~~~~~~~~~~~
#9 50.64       plugins/python/python_plugin.c: In function ‘uwsgi_python_post_uwsgi_fork’:
#9 50.64       plugins/python/python_plugin.c:1339:25: error: too few arguments to function ‘_PyImport_ReleaseLock’
#9 50.64        1339 |                         _PyImport_ReleaseLock();
#9 50.64             |                         ^~~~~~~~~~~~~~~~~~~~~
#9 50.64       /usr/local/include/python3.12/cpython/import.h:14:17: note: declared here
#9 50.64          14 | PyAPI_FUNC(int) _PyImport_ReleaseLock(PyInterpreterState *interp);
#9 50.64             |                 ^~~~~~~~~~~~~~~~~~~~~
#9 50.64       plugins/python/python_plugin.c: In function ‘uwsgi_python_suspend’:
#9 50.64       plugins/python/python_plugin.c:1596:78: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_remaining’; did you mean ‘c_recursion_remaining’?
#9 50.64        1596 |                 up.current_recursion_remaining[wsgi_req->async_id] = tstate->recursion_remaining;
#9 50.64             |                                                                              ^~~~~~~~~~~~~~~~~~~
#9 50.64             |                                                                              c_recursion_remaining
#9 50.64       plugins/python/python_plugin.c:1605:63: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_remaining’; did you mean ‘c_recursion_remaining’?
#9 50.64        1605 |                 up.current_main_recursion_remaining = tstate->recursion_remaining;
#9 50.64             |                                                               ^~~~~~~~~~~~~~~~~~~
#9 50.64             |                                                               c_recursion_remaining
#9 50.64       plugins/python/python_plugin.c: In function ‘uwsgi_python_resume’:
#9 50.64       plugins/python/python_plugin.c:1839:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_remaining’; did you mean ‘c_recursion_remaining’?
#9 50.64        1839 |                 tstate->recursion_remaining = up.current_recursion_remaining[wsgi_req->async_id];
#9 50.64             |                         ^~~~~~~~~~~~~~~~~~~
#9 50.64             |                         c_recursion_remaining
#9 50.64       plugins/python/python_plugin.c:1848:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_remaining’; did you mean ‘c_recursion_remaining’?
#9 50.64        1848 |                 tstate->recursion_remaining = up.current_main_recursion_remaining;
#9 50.64             |                         ^~~~~~~~~~~~~~~~~~~
#9 50.64             |                         c_recursion_remaining
#9 50.64       plugins/python/pyutils.c: In function ‘init_pyargv’:
#9 50.64       plugins/python/pyutils.c:391:9: warning: ‘PySys_SetArgv’ is deprecated [-Wdeprecated-declarations]
#9 50.64         391 |         PySys_SetArgv(up.argc, up.py_argv);
#9 50.64             |         ^~~~~~~~~~~~~
#9 50.64       In file included from /usr/local/include/python3.12/Python.h:96,
#9 50.64                        from plugins/python/uwsgi_python.h:4,
#9 50.64                        from plugins/python/pyutils.c:1:
#9 50.64       /usr/local/include/python3.12/sysmodule.h:13:38: note: declared here
#9 50.64          13 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **);
#9 50.64             |                                      ^~~~~~~~~~~~~
#9 50.64       [end of output]

Since there were so many errors with uwsgi, I can only see the end of the pysam logs
pysam:

#9 42.02       pysam/libchtslib.c: In function ‘__Pyx_PyInt_As_long’:
#9 42.02       pysam/libchtslib.c:19943:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
#9 42.02       19943 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
#9 42.02             |                                                     ^~
#9 42.02       pysam/libchtslib.c:19998:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
#9 42.02       19998 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
#9 42.02             |                                                     ^~
#9 42.02       pysam/libchtslib.c: In function ‘__Pyx_PyIndex_AsSsize_t’:
#9 42.02       pysam/libchtslib.c:20503:45: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
#9 42.02       20503 |     const digit* digits = ((PyLongObject*)b)->ob_digit;
#9 42.02             |                                             ^~
#9 42.02       error: command '/usr/bin/gcc' failed with exit code 1
#9 42.02       [end of output]
#9 42.02   
#9 42.02   note: This error originates from a subprocess, and is likely not a problem with pip.
#9 42.03   Running setup.py clean for pysam
#9 42.03   ERROR: Failed building wheel for pysam

seems like maybe a lot of things related to c compiler?

Copy link
Contributor

@mshadbolt mshadbolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build worked after properly updating and rebuilding

@daisieh daisieh merged commit f0be36c into develop May 10, 2024
2 checks passed
@daisieh daisieh deleted the daisieh/htsget-pysam branch May 10, 2024 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants