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

Supporting MSYS2-MINGW python #34

Closed
naveen521kk opened this issue Mar 12, 2021 · 4 comments · Fixed by #184
Closed

Supporting MSYS2-MINGW python #34

naveen521kk opened this issue Mar 12, 2021 · 4 comments · Fixed by #184
Labels
help wanted Extra attention is needed

Comments

@naveen521kk
Copy link
Contributor

MSYS2 provides Python which is compiled with GCC on Windows and is widely used in projects like pygobject and anything related to Gtk, where compiling them for normal python is difficult. Their python works, I have used it many times, but I have seen a lot of patches to make things work. See a list here.

Currently, the following fails miserably because distutils always look for MSVC which isn't required in this version. Here, extensions should be compiled with GCC but support for that is missing in GCC, I think setuptools has them though, but doing something like this will fail.

$ export SETUPTOOLS_USE_DISTUTILS=local
$ python setup.py build
Traceback (most recent call last):
  File "setup.py", line 13, in <module>
    from setuptools import Extension, setup
  File "C:/msys64/mingw64/lib/python3.8/site-packages/setuptools/__init__.py", line 241, in <module>
    monkey.patch_all()
  File "C:/msys64/mingw64/lib/python3.8/site-packages/setuptools/monkey.py", line 99, in patch_all
    patch_for_msvc_specialized_compiler()
  File "C:/msys64/mingw64/lib/python3.8/site-packages/setuptools/monkey.py", line 162, in patch_for_msvc_specialized_compiler
    patch_func(*msvc9('find_vcvarsall'))
  File "C:/msys64/mingw64/lib/python3.8/site-packages/setuptools/monkey.py", line 149, in patch_params
    mod = import_module(mod_name)
  File "C:/msys64/mingw64/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/setuptools/_distutils/msvc9compiler.py", line 295, in <module>
    raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)
distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module

The authors can surely help on how to get those in.

Thanks.

@lazka
Copy link
Contributor

lazka commented May 15, 2021

Just wanted to add that we are willing to help maintaining any cygwin/msys/mingw related parts in distutils if wanted. Just ping me if needed.

@lazka
Copy link
Contributor

lazka commented Dec 19, 2021

A more general question:

Various of the platform specific differences would be fixed if distutils.sysconfig and similar would defer to stdlib sysconfig (which we patch and control). But I see that stdlib sysconfig is only used in tests.

Is there any rule against using sysconfig directly? Or could be it be done, either for mingw or windows as a special case, or in general?

I assume there is the worry that (older versions of) distros forgot to patch stdlib sysconfig like happened with the install schemes, but I think that could be checked on a case by case basis (?)

@lazka
Copy link
Contributor

lazka commented Dec 26, 2021

Various of the platform specific differences would be fixed if distutils.sysconfig and similar would defer to stdlib sysconfig (which we patch and control). But I see that stdlib sysconfig is only used in tests.

I've started this with some small changes: #91 and #92

@naveen521kk
Copy link
Contributor Author

@jaraco Is there any deadline before which this needs to be done? That is, is there a date when support for using stdlib distutils is removed in setuptools?

I've got a bit busy recently and kind of forgot about this. I'll get to this when I get some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
3 participants