dfeneyrou / palanteer

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

Python 3.12 support (nmake fails at "Generating python_instrumental_install" on Windows 10) #42

Open SenhorGrisalho opened 8 months ago

SenhorGrisalho commented 8 months ago

Hello,

I have installed Visual Studio 2022 along with Python 3.12. When I use nmake, I get the following output, and I don't know what else I can configure:

[ 92%] Built target palanteer [ 97%] Built target testprogram [ 98%] Generating python_instrumentation_install running bdist_wheel running build running build_py copying C:\Users\zoekm\Documents\palanteer\python\palanteer__init__.py -> build\lib.win32-cpython-312\palanteer copying C:\Users\zoekm\Documents\palanteer\python\palanteer__main__.py -> build\lib.win32-cpython-312\palanteer running build_ext building 'palanteer._cextension' extension "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-IC:\Program Files\Python312\include" "-IC:\Program Files\Python312\Include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /TpC:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp /Fobuild\temp.win32-cpython-312\Release\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.obj -I C:\Users\zoekm\Documents\palanteer\c++ -std=c++11 /wd4996 cl : Befehlszeile warning D9002 : Unbekannte Option "-std=c++11" wird ignoriert. pyPalanteerInstrumentation.cpp C:\Users\zoekm\Documents\palanteer\c++\palanteer.h(381): warning C4068: Unbekanntes Pragma "GCC". C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(180): error C2039: "frame" ist kein Member von "_ts". C:\Program Files\Python312\include\cpython/pystate.h(115): note: Siehe Deklaration von "_ts" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(183): error C2039: "frame" ist kein Member von "_ts". C:\Program Files\Python312\include\cpython/pystate.h(115): note: Siehe Deklaration von "_ts" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(187): error C2039: "frame" ist kein Member von "_ts". C:\Program Files\Python312\include\cpython/pystate.h(115): note: Siehe Deklaration von "_ts" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(261): error C2027: Verwendung des undefinierten Typs "_frame" C:\Program Files\Python312\include\pytypedefs.h(22): note: Siehe Deklaration von "_frame" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(263): error C2027: Verwendung des undefinierten Typs "_frame" C:\Program Files\Python312\include\pytypedefs.h(22): note: Siehe Deklaration von "_frame" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(263): error C2065: "FRAME_SUSPENDED": nichtdeklarierter Bezeichner C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(381): error C2027: Verwendung des undefinierten Typs "_frame" C:\Program Files\Python312\include\pytypedefs.h(22): note: Siehe Deklaration von "_frame" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(401): error C2039: "co_varnames" ist kein Member von "PyCodeObject". C:\Program Files\Python312\include\cpython/code.h(175): note: Siehe Deklaration von "PyCodeObject" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(402): error C2027: Verwendung des undefinierten Typs "_frame" C:\Program Files\Python312\include\pytypedefs.h(22): note: Siehe Deklaration von "_frame" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(629): error C2027: Verwendung des undefinierten Typs "_frame" C:\Program Files\Python312\include\pytypedefs.h(22): note: Siehe Deklaration von "_frame" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(629): warning C4477: "snprintf": Die Formatzeichenfolge "%s" erfordert ein Argument vom Typ "char ", das variadic-Argument "1" weist aber den Typ "int" auf. C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(629): warning C4477: "snprintf": Die Formatzeichenfolge "%d" erfordert ein Argument vom Typ "int", das variadic-Argument "2" weist aber den Typ "const char " auf. C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(629): warning C4473: "snprintf": nicht genügend Argumente für Formatzeichenfolge übergeben C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(629): note: Platzhalter und deren Parameter erwarten 3 variadic-Argumente, es wurden aber 2 variadic-Argumente bereitgestellt. C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(629): note: Das fehlende variadic-Argument "3" ist für die Zeichenfolge "%s" erforderlich. C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(642): error C2027: Verwendung des undefinierten Typs "_frame" C:\Program Files\Python312\include\pytypedefs.h(22): note: Siehe Deklaration von "_frame" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(964): error C2039: "use_tracing" ist kein Member von "_PyCFrame". C:\Program Files\Python312\include\cpython/pystate.h(67): note: Siehe Deklaration von "_PyCFrame" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(1219): error C2039: "use_tracing" ist kein Member von "_PyCFrame". C:\Program Files\Python312\include\cpython/pystate.h(67): note: Siehe Deklaration von "_PyCFrame" C:\Users\zoekm\Documents\palanteer\python\palanteer_cextension\pyPalanteerInstrumentation.cpp(1241): error C2039: "use_tracing" ist kein Member von "_PyCFrame". C:\Program Files\Python312\include\cpython/pystate.h(67): note: Siehe Deklaration von "_PyCFrame" error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX86\x86\cl.exe' failed with exit code 2 NMAKE : fatal error U1077: "echo >nul && "C:\Program Files\Python312\python.exe" C:/Users/zoekm/Documents/palanteer/build/python/setup.py bdist_wheel": Rückgabe-Code "0x1" Stop. NMAKE : fatal error U1077: ""C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX86\x86\nmake.exe" -s -f python\CMakeFiles\python_instrumentation.dir\build.make /nologo -SL python\CMakeFiles\python_instrumentation.dir\build": Rückgabe-Code "0x2" Stop. NMAKE : fatal error U1077: ""C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX86\x86\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -S all": Rückgabe-Code "0x2" Stop.

dfeneyrou commented 1 week ago

Sorry, Python 3.12 is not supported at the moment. The profiling requires the usage of some internal API which are not stable across Python versions, so until this internal interface of Python is not stabilized, supporting a new Python version implies some rework... I cannot provide any date at the moment.