Added fallback for finding ld on MinGW Cygwin

This commit is contained in:
Andrew Murray 2019-08-11 07:23:08 +10:00
parent 845377d83f
commit 3fbea03026
2 changed files with 18 additions and 2 deletions

View File

@ -118,6 +118,18 @@ class RequiredDependencyException(Exception):
PLATFORM_MINGW = "mingw" in ccompiler.get_default_compiler()
PLATFORM_PYPY = hasattr(sys, "pypy_version_info")
if sys.platform == "win32" and PLATFORM_MINGW:
from distutils import cygwinccompiler
cygwin_versions = cygwinccompiler.get_versions()
if cygwin_versions[1] is None:
# ld version is None
# distutils cygwinccompiler might fetch the ld path from gcc
# Try the normal path instead
cygwin_versions = list(cygwin_versions)
cygwin_versions[1] = cygwinccompiler._find_exe_version("ld -v")
cygwinccompiler.get_versions = lambda: tuple(cygwin_versions)
def _dbg(s, tp=None):
if DEBUG:

View File

@ -3,12 +3,16 @@
mkdir /var/cache/pacman/pkg
pacman -S --noconfirm mingw32/mingw-w64-i686-python3-pip \
mingw32/mingw-w64-i686-python3-setuptools \
mingw32/mingw-w64-i686-python3-pytest \
mingw32/mingw-w64-i686-python3-pytest-cov \
mingw32/mingw-w64-i686-python2-pip \
mingw32/mingw-w64-i686-python2-setuptools \
mingw32/mingw-w64-i686-python2-pytest \
mingw32/mingw-w64-i686-python2-pytest-cov \
mingw-w64-i686-libjpeg-turbo \
mingw-w64-i686-libimagequant
C:/msys64/mingw32/bin/python3 -m pip install --upgrade pip
/mingw32/bin/pip install pytest pytest-cov olefile
/mingw32/bin/pip3 install pytest pytest-cov olefile
/mingw32/bin/pip install olefile
/mingw32/bin/pip3 install olefile