dfeneyrou / palanteer

Visual Python and C++ nanosecond profiler, logger, tests enabler
Other
2.1k stars 88 forks source link

palanteer\_cextension\pyPalanteerInstrumentation.cpp(180): error C2039: 'frame': is not a member of '_ts' #43

Closed cod3monk3y closed 2 months ago

cod3monk3y commented 5 months ago

Palanteer wheels do not build with Python 3.11 and above. The frame member was removed from the Python C API in 3.11.

Tried:

pip install palanteer

and:

pip install palanteer@git+https://github.com/dfeneyrou/palanteer#subdirectory=python

Result (truncated)

     palanteer\_cextension\pyPalanteerInstrumentation.cpp(180): error C2039: 'frame': is not a member of '_ts'
      C:\Program Files\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts'

See pystate.h on cpython github:

Version 3.11: https://github.com/python/cpython/blob/3.11/Include/cpython/pystate.h

struct _ts {
    /* See Python/ceval.c for comments explaining most fields */

    PyThreadState *prev;
    PyThreadState *next;
    PyInterpreterState *interp;

    /* Has been initialized to a safe state.

       In order to be effective, this must be set to 0 during or right
       after allocation. */
    int _initialized;

    /* Was this thread state statically allocated? */
    int _static;

    int recursion_remaining;
    int recursion_limit;
    int recursion_headroom; /* Allow 50 more calls to handle any errors. */

And version 3.10: https://github.com/python/cpython/blob/3.10/Include/cpython/pystate.h

struct _ts {
    /* See Python/ceval.c for comments explaining most fields */

    struct _ts *prev;
    struct _ts *next;
    PyInterpreterState *interp;

    /* Borrowed reference to the current frame (it can be NULL) */
    PyFrameObject *frame;
    int recursion_depth;
    int recursion_headroom; /* Allow 50 more calls to handle any errors. */
    int stackcheck_counter;