
Op 25-04-2024 om 16:58 schreef Stefan Behnel:> If it's a somewhat straightforward change that doesn't need tons of
back-and-forth testing and debugging, and you have a github account, you could also use their CI service (Github Actions), either on your own account or in lxml's account via a pull request.
That would be an interesting approach (I do have a github account). I have looked at the actions to see if they would help me figure out how to build lxml, but what it does is beyond me, I'm afraid. If I could fork lxml, experiment, and have an action build it for me, I'd be very happy. 🙂 I'm not sure how to go about that, though.
It might help to see the command line.
For completeness, I've included everything I did below (it isn't actually that much). It wraps, which doesn't help readability, but I don't know how to stop Thunderbird doing that. (Is attaching a text file allowed on the list? Perhaps that would work better.) As you can see below, compiling seems to work fine, but linking fails. At least the first two symbols _xmlStrchr and _xmlIOParseDTD, can be found within libxml2_a.lib, but without the underscore. Does this mean the libraries are perhaps compiled with differerent flags? Thanks for your help, kind regards, Gertjan. ========== C:\Temp>git clone https://github.com/lxml/lxml.git [...] C:\Temp>cd lxml C:\Temp\lxml>py -m venv .venv C:\Temp\lxml>.venv\Scripts\activate (.venv) C:\Temp\lxml>call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" [...] (.venv) C:\Temp\lxml>pip install cython Using cached Cython-3.0.10-cp312-cp312-win_amd64.whl (2.8 MB) (.venv) C:\Temp\lxml>pip install setuptools Using cached setuptools-69.5.1-py3-none-any.whl (894 kB) (.venv) C:\Temp\lxml>python setup.py build_ext -i --with-cython --static-deps Building lxml version 5.2.1. C:\Temp\lxml\setup.py:67: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources Latest version of libxml2 is 2.11.7 Latest version of libxslt is 1.1.39 Latest version of zlib is 1.2.12 Latest version of iconv is 1.15 Retrieving "https://github.com/lxml/libxml2-win-binaries/releases/download/2024.03.26/li..." to "libs\libxml2-2.11.7.win64.zip" Unpacking libxml2-2.11.7.win64.zip into libs Retrieving "https://github.com/lxml/libxml2-win-binaries/releases/download/2024.03.26/li..." to "libs\libxslt-1.1.39.win64.zip" Unpacking libxslt-1.1.39.win64.zip into libs Retrieving "https://github.com/lxml/libxml2-win-binaries/releases/download/2024.03.26/zl..." to "libs\zlib-1.2.12.win64.zip" Unpacking zlib-1.2.12.win64.zip into libs Retrieving "https://github.com/lxml/libxml2-win-binaries/releases/download/2024.03.26/ic..." to "libs\iconv-1.15.win64.zip" Unpacking iconv-1.15.win64.zip into libs Building with Cython 3.0.10. Building against pre-built libxml2 andl libxslt libraries Building against libxml2/libxslt in one of the following directories: libs\libxml2-2.11.7.win64\lib libs\libxslt-1.1.39.win64\lib libs\zlib-1.2.12.win64\lib libs\iconv-1.15.win64\lib Compiling src\lxml\etree.pyx because it changed. Compiling src\lxml\objectify.pyx because it changed. Compiling src\lxml\builder.py because it changed. Compiling src\lxml\_elementpath.py because it changed. Compiling src\lxml\html\diff.py because it changed. Compiling src\lxml\sax.py because it changed. [1/6] Cythonizing src\lxml\_elementpath.py [2/6] Cythonizing src\lxml\builder.py [3/6] Cythonizing src\lxml\etree.pyx warning: src\lxml\xmlerror.pxi:660:22: local variable 'args' referenced before assignment warning: src\lxml\xmlerror.pxi:661:69: local variable 'args' referenced before assignment warning: src\lxml\xmlerror.pxi:662:20: local variable 'args' referenced before assignment warning: src\lxml\xmlerror.pxi:667:22: local variable 'args' referenced before assignment warning: src\lxml\xmlerror.pxi:668:73: local variable 'args' referenced before assignment warning: src\lxml\xmlerror.pxi:669:20: local variable 'args' referenced before assignment warning: src\lxml\xmlerror.pxi:674:22: local variable 'args' referenced before assignment warning: src\lxml\xmlerror.pxi:675:73: local variable 'args' referenced before assignment warning: src\lxml\xmlerror.pxi:676:20: local variable 'args' referenced before assignment [4/6] Cythonizing src\lxml\html\diff.py [5/6] Cythonizing src\lxml\objectify.pyx [6/6] Cythonizing src\lxml\sax.py running build_ext building 'lxml.etree' extension creating build creating build\temp.win32-cpython-312 creating build\temp.win32-cpython-312\Release creating build\temp.win32-cpython-312\Release\src creating build\temp.win32-cpython-312\Release\src\lxml "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc\lxml -Isrc\lxml\includes -Ilibs\libxml2-2.11.7.win64\include -Ilibs\libxslt-1.1.39.win64\include -Ilibs\zlib-1.2.12.win64\include -Ilibs\iconv-1.15.win64\include -Isrc -IC:\Temp\lxml\.venv\include -IC:\dev\Python\Python312\include -IC:\dev\Python\Python312\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc\lxml\etree.c /Fobuild\temp.win32-cpython-312\Release\src\lxml\etree.obj -w cl : Command line warning D9025 : overriding '/W3' with '/w' etree.c creating C:\Temp\lxml\build\lib.win32-cpython-312 creating C:\Temp\lxml\build\lib.win32-cpython-312\lxml "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:libs\libxml2-2.11.7.win64\lib /LIBPATH:libs\libxslt-1.1.39.win64\lib /LIBPATH:libs\zlib-1.2.12.win64\lib /LIBPATH:libs\iconv-1.15.win64\lib /LIBPATH:C:\Temp\lxml\.venv\libs /LIBPATH:C:\dev\Python\Python312\libs /LIBPATH:C:\dev\Python\Python312 /LIBPATH:C:\Temp\lxml\.venv\PCbuild\win32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\lib\x86" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.19041.0\\um\x86" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\lib\x86" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x86" libxslt_a.lib libexslt_a.lib libxml2_a.lib iconv_a.lib zlib.lib WS2_32.lib /EXPORT:PyInit_etree build\temp.win32-cpython-312\Release\src\lxml\etree.obj /OUT:build\lib.win32-cpython-312\lxml\etree.cp312-win_amd64.pyd /IMPLIB:build\temp.win32-cpython-312\Release\src\lxml\etree.cp312-win_amd64.lib Creating library build\temp.win32-cpython-312\Release\src\lxml\etree.cp312-win_amd64.lib and object build\temp.win32-cpython-312\Release\src\lxml\etree.cp312-win_amd64.exp etree.obj : error LNK2001: unresolved external symbol _xmlStrchr etree.obj : error LNK2001: unresolved external symbol _xmlIOParseDTD etree.obj : error LNK2001: unresolved external symbol _xmlMemShow etree.obj : error LNK2001: unresolved external symbol __imp__PyUnicode_AsEncodedString [...] etree.obj : error LNK2001: unresolved external symbol __imp__PyExc_ModuleNotFoundError etree.obj : error LNK2001: unresolved external symbol __imp___PyObject_GetDictPtr build\lib.win32-cpython-312\lxml\etree.cp312-win_amd64.pyd : fatal error LNK1120: 503 unresolved externals error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\link.exe' failed with exit code 1120