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

distutils too picky about cygwin ld's version number #48422

Closed
zooko mannequin opened this issue Oct 22, 2008 · 2 comments
Closed

distutils too picky about cygwin ld's version number #48422

zooko mannequin opened this issue Oct 22, 2008 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@zooko
Copy link
Mannequin

zooko mannequin commented Oct 22, 2008

BPO 4172
Nosy @amauryfa
Superseder
  • bpo-2234: cygwinccompiler.py fails for latest MinGW releases.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2008-10-22.16:40:07.978>
    created_at = <Date 2008-10-22.13:17:54.911>
    labels = ['type-bug', 'library']
    title = "distutils too picky about cygwin ld's version number"
    updated_at = <Date 2008-10-22.16:40:07.976>
    user = 'https://bugs.python.org/zooko'

    bugs.python.org fields:

    activity = <Date 2008-10-22.16:40:07.976>
    actor = 'amaury.forgeotdarc'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-10-22.16:40:07.978>
    closer = 'amaury.forgeotdarc'
    components = ['Distutils']
    creation = <Date 2008-10-22.13:17:54.911>
    creator = 'zooko'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 4172
    keywords = []
    message_count = 2.0
    messages = ['75079', '75088']
    nosy_count = 2.0
    nosy_names = ['zooko', 'amaury.forgeotdarc']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '2234'
    type = 'behavior'
    url = 'https://bugs.python.org/issue4172'
    versions = ['Python 2.5']

    @zooko
    Copy link
    Mannequin Author

    zooko mannequin commented Oct 22, 2008

    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

    @zooko zooko mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 22, 2008
    @amauryfa
    Copy link
    Member

    This is a duplicate of bpo-2234, with an identical correction; it will
    be part of the next 2.5 release.
    Thanks anyway for the report.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant