Closed tristanlatr closed 5 months ago
It started failing at 3.13.0-alpha.6, everything works on 3.13.0-alpha.5.
I suspect that the unicode deprecation warning does not fail the build, it is just a warning.
But that is an error:
In file included from /opt/hostedtoolcache/Python/3.13.0-alpha.6/x64/include/python3.13/internal/pycore_code.h:461,
from /opt/hostedtoolcache/Python/3.13.0-alpha.6/x64/include/python3.13/internal/pycore_frame.h:13,
from msgpack/_cmsgpack.cpp:22559:
/opt/hostedtoolcache/Python/3.13.0-alpha.6/x64/include/python3.13/internal/pycore_backoff.h: In function ‘_Py_BackoffCounter make_backoff_counter(uint16_t, uint16_t)’:
/opt/hostedtoolcache/Python/3.13.0-alpha.6/x64/include/python3.13/internal/pycore_backoff.h:47:44: warning: narrowing conversion of ‘backoff’ from ‘uint16_t’ {aka ‘short unsigned int’} to ‘unsigned char:4’ [-Wnarrowing]
47 | return (_Py_BackoffCounter){.backoff = backoff, .value = value};
| ^~~~~~~
/opt/hostedtoolcache/Python/3.13.0-alpha.6/x64/include/python3.13/internal/pycore_backoff.h:47:67: error: too many initializers for ‘_Py_BackoffCounter’
47 | return (_Py_BackoffCounter){.backoff = backoff, .value = value};
| ^
error: command '/usr/bin/gcc' failed with exit code 1
Considering this is built from Cython source (.pyx), maybe the Cython version used to cythonize that does not yet support that Python version.
This is not relating to Cython. Maybe, default g++ in ubuntu-20.04 Action Runner doesn't support compiling this header file.
Uh, this is relating to Cython, because Cython depending on Python internal too much. Cython imports pycore_frame for traceback support.
/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
#ifndef Py_BUILD_CORE
#define Py_BUILD_CORE 1
#endif
#include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
PyObject *firstlineno, PyObject *name) {
PyObject *replace = NULL;
...
It cause compile error on old g++.
inada-n@ubuntu20:~$ cat foo.cpp
#define Py_BUILD_CORE 1
#include <Python.h>
#include "frameobject.h"
#include "internal/pycore_frame.h"
int main() {}
inada-n@ubuntu20:~$ g++-10 -std=c++17 -I include/python3.13 foo.cpp
In file included from include/python3.13/internal/pycore_code.h:461,
from include/python3.13/internal/pycore_frame.h:13,
from foo.cpp:5:
include/python3.13/internal/pycore_backoff.h: In function ‘_Py_BackoffCounter make_backoff_counter(uint16_t, uint16_t)’:
include/python3.13/internal/pycore_backoff.h:47:44: warning: narrowing conversion of ‘backoff’ from ‘uint16_t’ {aka ‘short unsigned int’} to ‘unsigned char:4’ [-Wnarrowing]
47 | return (_Py_BackoffCounter){.backoff = backoff, .value = value};
| ^~~~~~~
include/python3.13/internal/pycore_backoff.h:47:67: error: too many initializers for ‘_Py_BackoffCounter’
47 | return (_Py_BackoffCounter){.backoff = backoff, .value = value};
| ^
On Ubuntu 22.04, this error doesn't happen. Ubuntu 22.04 uses gcc 13.
There is nothing we can do here. You can:
Impossible to build msgpack on python 3.13 because of what looks like an deprecation warning