When I build an extension module with cygwin g++ and "compiler=mingw32"
in my distutils config file, the build fails with:
File
"c:\python25\lib\site-packages\setuptools-0.6c9.egg\setuptools\command\build_ext.py",
line 46, in run
_build_ext.run(self)
File "c:\Python25\lib\distutils\command\build_ext.py", line 264, in run
force=self.force)
File "c:\Python25\lib\distutils\ccompiler.py", line 1175, in new_compiler
return klass (None, dry_run, force)
File "c:\Python25\lib\distutils\cygwinccompiler.py", line 292, in __init__
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "c:\Python25\lib\distutils\cygwinccompiler.py", line 84, in __init__
get_versions()
File "c:\Python25\lib\distutils\cygwinccompiler.py", line 424, in
get_versions
ld_version = StrictVersion(result.group(1))
File "c:\Python25\lib\distutils\version.py", line 40, in __init__
self.parse(vstring)
File "c:\Python25\lib\distutils\version.py", line 107, in parse
raise ValueError, "invalid version number '%s'" % vstring
ValueError: invalid version number '2.18.50.20080625'
If I change "StrictVersion" to "LooseVersion" in cygwinccompiler.py,
then the build succeeds:
C:\playground\allmydata\tahoe\installtahoe\allmydata-tahoe-1.2.0-r3092-SUMO>diff
-u C:\Python25\Lib\distutils\cygwinccompiler.py
C:\Python25\Lib\distutils\cyg
winccompiler.py.new
--- C:\Python25\Lib\distutils\cygwinccompiler.py 2008-10-22
07:09:26.765625000 -0600
+++ C:\Python25\Lib\distutils\cygwinccompiler.py.new 2008-10-22
07:09:06.234375000 -0600
@@ -398,7 +398,7 @@
""" Try to find out the versions of gcc, ld and dllwrap.
If not possible it returns None for it.
"""
- from distutils.version import StrictVersion
+ from distutils.version import LooseVersion, StrictVersion
from distutils.spawn import find_executable
import re
@@ -421,7 +421,7 @@
out.close()
result = re.search('(\d+\.\d+(\.\d+)*)',out_string)
if result:
- ld_version = StrictVersion(result.group(1))
+ ld_version = LooseVersion(result.group(1))
else:
ld_version = None
else:
@@ -433,7 +433,7 @@
out.close()
result = re.search(' (\d+\.\d+(\.\d+)*)',out_string)
if result:
- dllwrap_version = StrictVersion(result.group(1))
+ dllwrap_version = LooseVersion(result.group(1))
else:
dllwrap_version = None
|