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

Two test failures in Cygwin #269

Closed
jaraco opened this issue Jul 10, 2024 · 3 comments · Fixed by #270
Closed

Two test failures in Cygwin #269

jaraco opened this issue Jul 10, 2024 · 3 comments · Fixed by #270

Comments

@jaraco
Copy link
Member

jaraco commented Jul 10, 2024

In 1bcd839, I restored the running of cygwin tests for distutils after I realized that the "rust compiler" limitation only needed to affect the "pytest-ruff" dependency, now excluded upstream.

However, re-enabling the tests revealed we've had a couple of regressions since tests were disabled.

________ TestMingw32CCompiler.test_customize_compiler_with_msvc_python _________

self = <distutils.tests.test_mingwccompiler.TestMingw32CCompiler object at 0x6ffffe1d04c0>

    def test_customize_compiler_with_msvc_python(self):
        from distutils.cygwinccompiler import Mingw32CCompiler
    
        # In case we have an MSVC Python build, but still want to use
        # Mingw32CCompiler, then customize_compiler() shouldn't fail at least.
        # https://github.com/pypa/setuptools/issues/4456
>       compiler = Mingw32CCompiler()

distutils/tests/test_mingwccompiler.py:54: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <distutils.cygwinccompiler.Mingw32CCompiler object at 0x6ffffde848b0>
verbose = False, dry_run = False, force = False

    def __init__(self, verbose=False, dry_run=False, force=False):
        super().__init__(verbose, dry_run, force)
    
        shared_option = "-shared"
    
        if is_cygwincc(self.cc):
>           raise CCompilerError('Cygwin gcc cannot be used with --compiler=mingw32')
E           distutils.errors.CCompilerError: Cygwin gcc cannot be used with --compiler=mingw32

distutils/cygwinccompiler.py:274: CCompilerError
______ [doctest] distutils.unixccompiler.UnixCCompiler.find_library_file _______
371         data to go on: GCC seems to prefer the shared library, so
372         assume that *all* Unix C compilers do,
373         ignoring even GCC's "-static" option.
374 
375         >>> compiler = UnixCCompiler()
376         >>> compiler._library_root = lambda dir: dir
377         >>> monkeypatch = getfixture('monkeypatch')
378         >>> monkeypatch.setattr(os.path, 'exists', lambda d: 'existing' in d)
379         >>> dirs = ('/foo/bar/missing', '/foo/bar/existing')
380         >>> compiler.find_library_file(dirs, 'abc').replace('\\', '/')
Expected:
    '/foo/bar/existing/libabc.dylib'
Got:
    '/foo/bar/existing/cygabc.dll'

/cygdrive/d/a/distutils/distutils/distutils/unixccompiler.py:380: DocTestFailure

@lazka Can you take a look and suggest fixes?

@lazka
Copy link
Contributor

lazka commented Jul 11, 2024

sure, I'll have a look

edit: I can reproduce both issues locally

@DWesl
Copy link
Contributor

DWesl commented Jul 12, 2024

I added the second in #209, if you want the context

@lazka
Copy link
Contributor

lazka commented Jul 12, 2024

Sorry for the delay, I created #270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants