Open iherasymenko opened 1 month ago
@iherasymenko thank you for the report! We're still addressing 3.13 support for the library. For the time being, I think it is safe to treat 3.13 as unsupported by ddtrace
. At the current time we do not have a precise timeline (sorry about that).
I don't really have a specific workaround to suggest here, since we have a lot of native code that needs to be made away of changes to the runtime API in 3.13.
Oops, just realized I mischaracterized this as a profiler issue, but I see that the compilation site is actually coming from a different component. Re-routing this issue, but unfortunately I think my overall message is still accurate.
@emmettbutler directing to you in case you have anything more optimistic to say on the topic of 3.13 support.
Hi, do you have any updates on this issue?! I really want to use ddtrace with Python 3.13.
I was reading through the Python 3.13 API changes and the necessary changes to make ddtrace aware of Python 3.13 and I see some important changes.
_Py_IsFinalizing
is part of the Stable ABI and now its Py_IsFinalizing
, so, the following code (we can optimize, of course) can keep backward compatibility (https://github.com/DataDog/dd-trace-py/blob/main/ddtrace/internal/_threads.cpp) and add support for Python 3.13
#if PY_VERSION_HEX < 0x30d0000
if (!_Py_IsFinalizing()) {
#else
if (!Py_IsFinalizing()) {
#endif
Accessing some internal headers now requires defining Py_BUILD_CORE
. However, if I'm not reading wrong, this define is only meant to be used when building CPython itself. So, I think adding Py_BUILD_CORE
define (+ python version check) on top of the file https://github.com/DataDog/dd-trace-py/blob/b849a2a1197265a43a4960f49d302f4eccaa3470/ddtrace/appsec/_iast/_stacktrace.c can fix the problem.
I see some errors like fatal error: 'internal/pycore_opcode.h' file not found
, but I don't know if this is a problem when cmake is linking the headers or not. I'm still debugging.
I see some other debugs when compiling it locally, but I don't know if that's my environment or not. I can't find in the repository any guidance to set up my local environment correctly.
Please let me know if I can help in any other way to add this support in a timely manner.
@leandrodamascena thanks for your interest in getting ddtrace
to work with CPython 3.13. We are currently working towards this, and you have already identified many of the places where support needs to be extended. Besides that, we also need a new release of the bytecode library, which is on its way. We currently don't have a timescale for when all the work will be done, but we are confident we can get there within a few weeks 🤞
@leandrodamascena thanks for your interest in getting
ddtrace
to work with CPython 3.13. We are currently working towards this, and you have already identified many of the places where support needs to be extended. Besides that, we also need a new release of the bytecode library, which is on its way. We currently don't have a timescale for when all the work will be done, but we are confident we can get there within a few weeks 🤞
Thanks for letting me know @P403n1x87! Feel free to reach out if you need someone to do some testing with Python 3.13
@P403n1x87, Nice updated shared.
Besides that, we also need a new release of the bytecode library, which is https://github.com/MatthieuDartiailh/bytecode/pull/146.
It looks like bytecode
is now cleared for Python 3.13 🎉
Looking forward for the python 3.13 support :)
When trying to install
ddtrace-py
with the latest Python 3.13 RC builds, the installation fails with the following error.