This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: distutils too picky about cygwin ld's version number
Type: behavior Stage:
Components: Distutils Versions: Python 2.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: cygwinccompiler.py fails for latest MinGW releases.
View: 2234
Assigned To: Nosy List: amaury.forgeotdarc, zooko
Priority: normal Keywords:

Created on 2008-10-22 13:17 by zooko, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg75079 - (view) Author: Zooko O'Whielacronx (zooko) Date: 2008-10-22 13:17
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
msg75088 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-10-22 16:40
This is a duplicate of issue2234, with an identical correction; it will
be part of the next 2.5 release.
Thanks anyway for the report.
History
Date User Action Args
2022-04-11 14:56:40adminsetgithub: 48422
2008-10-22 16:40:07amaury.forgeotdarcsetstatus: open -> closed
resolution: duplicate
superseder: cygwinccompiler.py fails for latest MinGW releases.
messages: + msg75088
nosy: + amaury.forgeotdarc
2008-10-22 13:17:54zookocreate