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

[Windows] Pypy build failing #2325

Closed
JP-Ellis opened this issue Oct 30, 2023 · 7 comments
Closed

[Windows] Pypy build failing #2325

JP-Ellis opened this issue Oct 30, 2023 · 7 comments

Comments

@JP-Ellis
Copy link

Summary

  • OS: GitHub runner windows-latest

  • Architecture: 64-bit

  • Psutil version: built from psutil-5.9.6.tar.gz

  • Python version:

    $ python --version
    Python 3.8.16 (a9dbdca6fc3286b0addd2240f11d97d8e8de187a, Dec 29 2022, 11:45:54)
    [PyPy 7.3.11 with MSC v.1929 64 bit (AMD64)]
  • Type: installation

Description

Currently trying to install psutil (as a required dependency) on GitHub's Windows runners. Unfortunately, it fails with the following error:

        psutil/arch/windows\disk.c(93): warning C4013: 'PyErr_SetExcFromWindowsErrWithFilenameObject' undefined; assuming extern returning int
        psutil/arch/windows\disk.c(93): warning C4047: 'return': 'PyObject *' differs in levels of indirection from 'int'
[...]
        Creating library build\temp.win-amd64-pypy38\Release\psutil\_psutil_windows.pypy38-pp73-win_amd64.lib and object build\temp.win-amd64-pypy38\Release\psutil\_psutil_windows.pypy38-pp73-win_amd64.exp
        disk.obj : error LNK2001: unresolved external symbol PyErr_SetExcFromWindowsErrWithFilenameObject
        build\lib.win-amd64-pypy38\psutil\_psutil_windows.pypy38-pp73-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
        error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.35.32215\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120

It would appear the error might be a result from using CPython-specific symbols.

Full log (link)

    Building wheel for psutil (pyproject.toml): finished with status 'error'
    error: subprocess-exited-with-error
    
    × Building wheel for psutil (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [81 lines of output]
        running bdist_wheel
        running build
        running build_py
        creating build
        creating build\lib.win-amd64-pypy38
        creating build\lib.win-amd64-pypy38\psutil
        copying psutil\_common.py -> build\lib.win-amd64-pypy38\psutil
        copying psutil\_compat.py -> build\lib.win-amd64-pypy38\psutil
        copying psutil\_psaix.py -> build\lib.win-amd64-pypy38\psutil
        copying psutil\_psbsd.py -> build\lib.win-amd64-pypy38\psutil
        copying psutil\_pslinux.py -> build\lib.win-amd64-pypy38\psutil
        copying psutil\_psosx.py -> build\lib.win-amd64-pypy38\psutil
        copying psutil\_psposix.py -> build\lib.win-amd64-pypy38\psutil
        copying psutil\_pssunos.py -> build\lib.win-amd64-pypy38\psutil
        copying psutil\_pswindows.py -> build\lib.win-amd64-pypy38\psutil
        copying psutil\__init__.py -> build\lib.win-amd64-pypy38\psutil
        creating build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\runner.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_aix.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_bsd.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_connections.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_contracts.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_linux.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_memleaks.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_misc.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_osx.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_posix.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_process.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_sunos.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_system.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_testutils.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_unicode.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\test_windows.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\__init__.py -> build\lib.win-amd64-pypy38\psutil\tests
        copying psutil\tests\__main__.py -> build\lib.win-amd64-pypy38\psutil\tests
        running build_ext
        building 'psutil._psutil_windows' extension
        creating build\temp.win-amd64-pypy38
        creating build\temp.win-amd64-pypy38\Release
        creating build\temp.win-amd64-pypy38\Release\psutil
        creating build\temp.win-amd64-pypy38\Release\psutil\arch
        creating build\temp.win-amd64-pypy38\Release\psutil\arch\windows
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/_psutil_common.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/_psutil_common.obj
        _psutil_common.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/_psutil_windows.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/_psutil_windows.obj
        _psutil_windows.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\cpu.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\cpu.obj
        cpu.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\disk.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\disk.obj
        disk.c
        psutil/arch/windows\disk.c(93): warning C4013: 'PyErr_SetExcFromWindowsErrWithFilenameObject' undefined; assuming extern returning int
        psutil/arch/windows\disk.c(93): warning C4047: 'return': 'PyObject *' differs in levels of indirection from 'int'
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\mem.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\mem.obj
        mem.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\net.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\net.obj
        net.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\proc.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\proc.obj
        proc.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\proc_handles.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\proc_handles.obj
        proc_handles.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\proc_info.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\proc_info.obj
        proc_info.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\proc_utils.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\proc_utils.obj
        proc_utils.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\security.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\security.obj
        security.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\sensors.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\sensors.obj
        sensors.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\services.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\services.obj
        services.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\socks.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\socks.obj
        socks.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\sys.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\sys.obj
        sys.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\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" /Tcpsutil/arch/windows\wmi.c /Fobuild\temp.win-amd64-pypy38\Release\psutil/arch/windows\wmi.obj
        wmi.c
        "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\libs /LIBPATH:C:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64\libs /LIBPATH:C:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\pypy3.8-v7.3.11-win64 /LIBPATH:C:\Users\runneradmin\AppData\Local\Temp\cibw-run-say0brzd\pp38-win_amd64\venv-test\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" psapi.lib kernel32.lib advapi32.lib shell32.lib netapi32.lib ws2_32.lib PowrProf.lib pdh.lib /EXPORT:PyInit__psutil_windows build\temp.win-amd64-pypy38\Release\psutil/_psutil_common.obj build\temp.win-amd64-pypy38\Release\psutil/_psutil_windows.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\cpu.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\disk.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\mem.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\net.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\proc.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\proc_handles.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\proc_info.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\proc_utils.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\security.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\sensors.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\services.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\socks.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\sys.obj build\temp.win-amd64-pypy38\Release\psutil/arch/windows\wmi.obj /OUT:build\lib.win-amd64-pypy38\psutil\_psutil_windows.pypy38-pp73-win_amd64.pyd /IMPLIB:build\temp.win-amd64-pypy38\Release\psutil\_psutil_windows.pypy38-pp73-win_amd64.lib
           Creating library build\temp.win-amd64-pypy38\Release\psutil\_psutil_windows.pypy38-pp73-win_amd64.lib and object build\temp.win-amd64-pypy38\Release\psutil\_psutil_windows.pypy38-pp73-win_amd64.exp
        disk.obj : error LNK2001: unresolved external symbol PyErr_SetExcFromWindowsErrWithFilenameObject
        build\lib.win-amd64-pypy38\psutil\_psutil_windows.pypy38-pp73-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
        error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.35.32215\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
@giampaolo
Copy link
Owner

giampaolo commented Oct 30, 2023

PyErr_SetExcFromWindowsErrWithFilenameObject usage was introduced in fc85c02c (CC @mayeut). It appears this broke PyPy on Windows (we don't have CI for PyPy).

PyErr_SetExcFromWindowsErrWithFilenameObject exists since Python 2.3 (https://docs.python.org/2/c-
api/exceptions.html#c.PyErr_SetExcFromWindowsErrWithFilenameObject) but apparently it's not included in PyPy for some reason.

It must be noted that this is not a first, since we already have workarounds for missing PyErr_SetFromWindowsErr and PyErr_SetFromWindowsErrWithFilename on PyPy:

// PyPy on Windows
#if defined(PSUTIL_WINDOWS) && defined(PYPY_VERSION)
#if !defined(PyErr_SetFromWindowsErrWithFilename)
PyObject *
PyErr_SetFromWindowsErrWithFilename(int winerr, const char *filename) {
PyObject *py_exc = NULL;
PyObject *py_winerr = NULL;
if (winerr == 0)
winerr = GetLastError();
if (filename == NULL) {
py_exc = PyObject_CallFunction(PyExc_OSError, "(is)", winerr,
strerror(winerr));
}
else {
py_exc = PyObject_CallFunction(PyExc_OSError, "(iss)", winerr,
strerror(winerr), filename);
}
if (py_exc == NULL)
return NULL;
py_winerr = Py_BuildValue("i", winerr);
if (py_winerr == NULL)
goto error;
if (PyObject_SetAttrString(py_exc, "winerror", py_winerr) != 0)
goto error;
PyErr_SetObject(PyExc_OSError, py_exc);
Py_XDECREF(py_exc);
return NULL;
error:
Py_XDECREF(py_exc);
Py_XDECREF(py_winerr);
return NULL;
}
#endif // !defined(PyErr_SetFromWindowsErrWithFilename)
// PyPy 2.7
#if !defined(PyErr_SetFromWindowsErr)
PyObject *
PyErr_SetFromWindowsErr(int winerr) {
return PyErr_SetFromWindowsErrWithFilename(winerr, "");
}
#endif // !defined(PyErr_SetFromWindowsErr)
#endif // defined(PSUTIL_WINDOWS) && defined(PYPY_VERSION)

We should add another workaround for PyErr_SetExcFromWindowsErrWithFilenameObject. I just wonder why PyPy does not expose these APIs...

renatahodovan pushed a commit to renatahodovan/picireny that referenced this issue Nov 4, 2023
@mattip
Copy link

mattip commented Nov 20, 2023

The whole python C-API is an additional layer tacked on top of PyPy, which is implemented in Python and does not expose a C-API. There are hundreds (thousands?) of functions PyPy has implemented: ones needed for the scientific python stack, for Cython, and in CPython's own test suite (which passes on PyPy). But some are still missing. PyErr_SetFromWindowsErr was added in Nov 2019. I have opened https://foss.heptapod.net/pypy/pypy/-/issues/4035 to add the other two mentioned here. Please ping me on further problems with PyPy

@giampaolo
Copy link
Owner

To be fair, running tests for PYPY on windows show some failures which seem to indicate bugs in how PYPY implements some C python APIs.

@mattip
Copy link

mattip commented Nov 20, 2023

Sorry, I didn't mean to suggest that PyPy does not have bugs. The opposite: there are definitely bugs and missing API functions. If possible, I would like to fix them. Please let me know. This package is one of the most popular and installed very often, so it is in a good place to let the PyPy devs know where we have problems.

@giampaolo
Copy link
Owner

giampaolo commented Nov 20, 2023

Sure. I don't have a laptop with with at the moment (I'm on vacation), but when I'm back I'll try to provide a report. If you want to start getting a glimpse, you can just run psutil test suite with PYPY on Windows. Last time I did that (some weeks ago, when I closed this issue) I bumped into some weird failures which seemed related to cPython APIs. E.g. I remember a SystemError being raised by PyUnicode_FromWideChar or something, but I can't be more precise right now. I will get back to you.

@mattip
Copy link

mattip commented Dec 8, 2023

I implemented the known missing PyErr interfaces, they will be in the next release of PyPy and will be available tomorrow on the nightly builds.

@giampaolo
Copy link
Owner

psutil 5.9.7 which fixes this ticket was released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants