Closed nb-programmer closed 1 month ago
https://stackoverflow.com/a/56170034/12887350 This is the issue when using MSYS2 and CMAKE
Closing, as the Python API is now deprecated in favor of the newer Lua API. Python is planned as an expansion to the new scripting system eventually (#3048).
Sadly, I don't see this being resolved here: the GitHub issue tracker is more intended for bugs/feature requests and often not well-suited to support-type issues; the Discord server can often work better.
Scratching my head over this for over a week now, seems to be related to CFFI trying to parse MinGW headers. In particular, I'm trying to build Python bindings for use in a different project. I tried building on MSYS2 with mingw64 environment (after installing all packages), but gave the same results as the below attempt on an Arch Linux machine with MinGW-w64 cross compiler.
Here's what I've done till now: CMake command (in directory
buildwin
inside the source code):Note: The huge number of flags is because I was trying to reduce as many unnecessary modules as possible. It produces the same issue even with the other flags removed.
Then I ran
make
in "python" directory:It failed because the _builder.py uses "cc -E" by default, which is native GCC's preprocessor, not MinGW's preprocessor.
Try again with correct MinGW C preprocessor with CPP variable:
Here is where I got stuck. CFFI's pycparser module fails to determine GCC's built-in symbol "__builtin_va_list", and more (if I manually define it, it fails again with more symbols). This is because the _builder.h file loads, which, in MinGW loads "_mingw.h" which has loads of MinGW related typedefs using compiler built-in symbols.
I tried to use pycparser's fake libc headers, but still more things remain to be patched to compile completely
Environment details:
Let me know if any other detail is needed