I am trying to automate builds of python from source on all platforms with cmake. I have Linux and macOS working. I am using bash as the terminal on all platfforms (on Windows, through Msys2 after calling vcvars32.bat on MSVC2019).
Windows is giving me a headache and I cannot find documentation for it. I am able to build python on Windows with no problems using PCbuild/build.bat. However, I don’t know how to install it. I am running the following command for installing:
python.bat -m ensurepip && python.bat -m pip install . --prefix ${CMAKE_INSTALL_PREFIX}
and I get this error:
Running Release|x64 interpreter...
Looking in links: c:\Users\User-PC\AppData\Local\Temp\tmp38gznv73
Requirement already satisfied: setuptools in d:\code\applications\mrv2\build-msys-amd64\release\python-prefix\src\python\lib\site-packages (63.2.0)
Requirement already satisfied: pip in d:\code\applications\mrv2\build-msys-amd64\release\python-prefix\src\python\lib\site-packages (23.0.1)
Running Release|x64 interpreter...
Processing d:\code\applications\mrv2\build-msys-amd64\release\python-prefix\src\python
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
[10 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "D:\code\applications\mrv2\BUILD-Msys-amd64\Release\Python-prefix\src\Python\setup.py", line 2758, in <module>
main()
File "D:\code\applications\mrv2\BUILD-Msys-amd64\Release\Python-prefix\src\Python\setup.py", line 2714, in main
set_compiler_flags('CFLAGS', 'PY_CFLAGS_NODIST')
File "D:\code\applications\mrv2\BUILD-Msys-amd64\Release\Python-prefix\src\Python\setup.py", line 134, in set_compiler_flags
sysconfig.get_config_vars()[compiler_flags] = flags + ' ' + py_flags_nodist
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.