Open abargale opened 10 months ago
I tried cloning the repo locally and trying to build - here is what I get again.
Summary: Creating library build\temp.win-amd64-cpython-312\Release\pkcs11_pkcs11.cp312-win_amd64.lib and object build\temp.win-amd64-cpython-312\Release\pkcs 11_pkcs11.cp312-win_amd64.exp _pkcs11.obj : error LNK2001: unresolved external symbol PyUnicode_AsUnicode _pkcs11.obj : error LNK2001: unresolved external symbol PyUnicode_FromUnicode build\lib.win-amd64-cpython-312\pkcs11_pkcs11.cp312-win_amd64.pyd : fatal error LNK1120: 2 unresolved externals error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\link.exe' failed with exit code 1120
Detailed log:
python -m pip install --use-pep517 --no-clean E:\xx\xxx\python-pkcs11 --user Processing e:\xx\xxx\python-pkcs11 Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: asn1crypto>=1.0.0 in e:\xx\xxx\xxxxx\python-win64-3.12.0\lib\site-packages (from python-pkcs11==0.7.1.dev40+gff20b84) (1 .5.1) Requirement already satisfied: cached-property in e:\xx\xxx\xxxxx\tools\python-win64-3.12.0\lib\site-packages (from python-pkcs11==0.7.1.dev40+gff20b84) (1.5 .2) Building wheels for collected packages: python-pkcs11 Building wheel for python-pkcs11 (pyproject.toml) ... error error: subprocess-exited-with-error
× Building wheel for python-pkcs11 (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [375 lines of output] WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section' running bdist_wheel running build running build_py running egg_info writing python_pkcs11.egg-info\PKG-INFO writing dependency_links to python_pkcs11.egg-info\dependency_links.txt writing requirements to python_pkcs11.egg-info\requires.txt writing top-level names to python_pkcs11.egg-info\top_level.txt WARNING setuptools_scm._file_finders.git toplevel mismatch computed e:\workdir\software\python-pkcs11 vs resolved E:\workdir\software\python-pkcs11 adding license file 'LICENSE' writing manifest file 'python_pkcs11.egg-info\SOURCES.txt' running build_ext warning: pkcs11_pkcs11.pyx:17:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310 warning: pkcs11_errors.pyx:86:44: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: pkcs11_pkcs11.pyx:1443:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions o r C macros instead. See https://github.com/cython/cython/issues/4310 warning: pkcs11_pkcs11.pyx:1467:8: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions o r C macros instead. See https://github.com/cython/cython/issues/4310 warning: pkcs11_pkcs11.pyx:1498:8: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions o r C macros instead. See https://github.com/cython/cython/issues/4310 performance hint: pkcs11_errors.pyx:86:6: Exception check on 'assertRV' will always require the GIL to be acquired. Possible solutions:
Use an 'int' return type on the function to allow an error code to be returned. Compiling pkcs11/_pkcs11.pyx because it changed. [1/1] Cythonizing pkcs11/_pkcs11.pyx building 'pkcs11._pkcs11' extension "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -I E:\workdir\saiga\tools\python-win64-3.12.0\include -IE:\workdir\saiga\tools\python-win64-3.12.0\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022 \BuildTools\VC\Tools\MSVC\14.37.32822\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\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\1 0\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" /Tcpkcs11/pkcs11.c /Fobuild\temp.win-amd64-cpython-312\Release\pkcs11/ pkcs11.obj _pkcs11.c pkcs11/_pkcs11.c(21005): warning C4013: 'PyUnicode_FromUnicode' undefined; assuming extern returning int pkcs11/_pkcs11.c(21005): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int' pkcs11/_pkcs11.c(24021): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(24164): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(26410): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(32821): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(33430): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(34305): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(38375): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(39362): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(40106): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(40170): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(41074): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(41334): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(42077): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(42141): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(42917): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(43177): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(43850): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(43870): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(44402): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(44616): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(46368): warning C4244: '=': conversion from 'Py_ssize_t' to 'CK_ULONG', possible loss of data pkcs11/_pkcs11.c(47692): warning C4013: 'PyUnicode_AsUnicode' undefined; assuming extern returning int pkcs11/_pkcs11.c(47692): warning C4047: '=': 'LPCWSTR' differs in levels of indirection from 'int' pkcs11/_pkcs11.c(62687): warning C4244: '=': conversion from 'Py_ssize_t' to 'long', possible loss of data pkcs11/_pkcs11.c(62974): warning C4244: '=': conversion from 'Py_ssize_t' to 'long', possible loss of data "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL / MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:E:\workdir\saiga\tools\python-win64-3.12.0\libs /LIBPATH:E:\workdir\saiga\tools\python-win64-3.12.0 /LIBPATH:E:\w orkdir\saiga\tools\python-win64-3.12.0\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\lib\x6 4" "/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" "/LIBPAT H:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64" user32.lib /EXPORT:PyInit__pkcs11 build\temp.win-amd64-cpython-312\Release\pkcs11/_pkcs11. obj /OUT:build\lib.win-amd64-cpython-312\pkcs11_pkcs11.cp312-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-312\Release\pkcs11_pkcs11.cp312-win_amd64.li b Creating library build\temp.win-amd64-cpython-312\Release\pkcs11_pkcs11.cp312-win_amd64.lib and object build\temp.win-amd64-cpython-312\Release\pkcs 11_pkcs11.cp312-win_amd64.exp _pkcs11.obj : error LNK2001: unresolved external symbol PyUnicode_AsUnicode _pkcs11.obj : error LNK2001: unresolved external symbol PyUnicode_FromUnicode build\lib.win-amd64-cpython-312\pkcs11_pkcs11.cp312-win_amd64.pyd : fatal error LNK1120: 2 unresolved externals error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\link.exe' failed with exit code 1120 [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for python-pkcs11 Failed to build python-pkcs11 ERROR: Could not build wheels for python-pkcs11, which is required to install pyproject.toml-based projects
I had the same issue. Then I did it through conda on python 3.11 and it worked.
IIRC I solved the problem by updating pip to version 24.1.2
IIRC I solved the problem by updating pip to version 24.1.2
I tried by updating pip to 24.1.2. Still the same issue. Did you use a different version of python? I'm currently on python 3.12.
I tried to install python-pkcs11 using pip 23.2.1 and python 3.12 Here is what I keep encountering, Need help!
Summary: pkcs11/_pkcs11.c(46416): warning C4013: 'PyUnicode_AsUnicode' undefined; assuming extern returning int pkcs11/_pkcs11.c(46416): warning C4047: '=': 'LPCWSTR' differs in levels of indirection from 'int' pkcs11/_pkcs11.c(46416): warning C4013: 'PyUnicode_AsUnicode' undefined; assuming extern returning int
I have tried getting the latest version of Cython - 3.0.4 which was released 10/17/23 and still have no luck.
Detailed log: python -m pip install --use-pep517 python-pkcs11 --user Collecting python-pkcs11 Using cached python-pkcs11-0.7.0.tar.gz (106 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: asn1crypto in e:\workdir\saiga\tools\python-win64-3.12.0\lib\site-packages (from python-pkcs11) (1.5.1) Requirement already satisfied: cached-property in e:\workdir\saiga\tools\python-win64-3.12.0\lib\site-packages (from python-pkcs11) (1.5.2) Building wheels for collected packages: python-pkcs11 Building wheel for python-pkcs11 (pyproject.toml) ... error error: subprocess-exited-with-error
× Building wheel for python-pkcs11 (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [431 lines of output] WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section' running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-312 creating build\lib.win-amd64-cpython-312\pkcs11 copying pkcs11\constants.py -> build\lib.win-amd64-cpython-312\pkcs11 copying pkcs11\defaults.py -> build\lib.win-amd64-cpython-312\pkcs11 copying pkcs11\exceptions.py -> build\lib.win-amd64-cpython-312\pkcs11 copying pkcs11\mechanisms.py -> build\lib.win-amd64-cpython-312\pkcs11 copying pkcs11\types.py -> build\lib.win-amd64-cpython-312\pkcs11 copying pkcs11__init.py -> build\lib.win-amd64-cpython-312\pkcs11 creating build\lib.win-amd64-cpython-312\pkcs11\util copying pkcs11\util\dh.py -> build\lib.win-amd64-cpython-312\pkcs11\util copying pkcs11\util\dsa.py -> build\lib.win-amd64-cpython-312\pkcs11\util copying pkcs11\util\ec.py -> build\lib.win-amd64-cpython-312\pkcs11\util copying pkcs11\util\rsa.py -> build\lib.win-amd64-cpython-312\pkcs11\util copying pkcs11\util\x509.py -> build\lib.win-amd64-cpython-312\pkcs11\util copying pkcs11\util\init__.py -> build\lib.win-amd64-cpython-312\pkcs11\util running egg_info writing python_pkcs11.egg-info\PKG-INFO writing dependency_links to python_pkcs11.egg-info\dependency_links.txt writing requirements to python_pkcs11.egg-info\requires.txt writing top-level names to python_pkcs11.egg-info\top_level.txt ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any reading manifest file 'python_pkcs11.egg-info\SOURCES.txt' writing manifest file 'python_pkcs11.egg-info\SOURCES.txt' copying pkcs11_errors.pyx -> build\lib.win-amd64-cpython-312\pkcs11 copying pkcs11_mswin.pxd -> build\lib.win-amd64-cpython-312\pkcs11 copying pkcs11_pkcs11.pyx -> build\lib.win-amd64-cpython-312\pkcs11 copying pkcs11_pkcs11_defn.pxd -> build\lib.win-amd64-cpython-312\pkcs11 copying pkcs11_utils.pyx -> build\lib.win-amd64-cpython-312\pkcs11 running build_ext warning: pkcs11_pkcs11.pyx:17:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310 warning: pkcs11_errors.pyx:85:44: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: pkcs11_pkcs11.pyx:1366:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions o r C macros instead. See https://github.com/cython/cython/issues/4310 warning: pkcs11_pkcs11.pyx:1390:8: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions o r C macros instead. See https://github.com/cython/cython/issues/4310 warning: pkcs11_pkcs11.pyx:1421:8: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions o r C macros instead. See https://github.com/cython/cython/issues/4310 performance hint: pkcs11_errors.pyx:85:6: Exception check on 'assertRV' will always require the GIL to be acquired. Possible solutions: