-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] Recent release introduced a breaking change on MingW #3450
Comments
Does your package build with MSVC? Can you link to the source? |
Hi @AlmogBaku , thank you very much for reporting this. Could you please improve the "how to reproduce" section? Ideally what we are looking for is a self-contained minimal example. You can find some tips on how to do that on https://stackoverflow.com/help/minimal-reproducible-example. |
The maintainers asked for a minimal example, that is, an example As a starting point: from setuptools import setup
from Cython.Build import cythonize
setup(ext_modules=cythonize(["hello.pyx"]))
def hello():
print("Hello") On Cygwin, that patch should be giving me a warning (not an error) if I am running into the same problem. If I run If I add the code from the test from the patch you marked as a problem in from distutils.cygwinccompiler import CygwinCCompiler
compiler = CygwinCCompiler()
compiler.runtime_library_dir_option('/foo') then I get the warning that you would see as an error. If I install The maintainers asking for a self-contained minimal example are basically asking what else you have to add to this code so that it:
because I suspect the problem is closer to Including the version of A bit of background on that patch: I think |
With from setuptools import setup, Extension
from Cython.Build import cythonize
setup(
ext_modules=cythonize(
Extension("hello", sources=["hello.pyx"], runtime_library_dirs=["/spam"])
)
) I get $ python setup.py build_ext --force
running build_ext
building 'hello' extension
INFO: C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
INFO: compile options: '-I/usr/include/python3.9 -c'
INFO: gcc: hello.c
INFO: gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-3.3.5-x86_64-3.9/hello.o -L/usr/lib/python3.9/config -L/usr/lib -Wl,--enable-new-dtags,-R/spam -lpython3.9 -o build/lib.cygwin-3.3.5-x86_64-3.9/hello.cpython-39-x86_64-cygwin.dll
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: unrecognized option '--enable-new-dtags'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
error: Command "gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-3.3.5-x86_64-3.9/hello.o -L/usr/lib/python3.9/config -L/usr/lib -Wl,--enable-new-dtags,-R/spam -lpython3.9 -o build/lib.cygwin-3.3.5-x86_64-3.9/hello.cpython-39-x86_64-cygwin.dll" failed with exit status 1 which is the messy compiler error message the new exception is designed to hide and clarify. @AlmogBaku, what do you get with this Alternately, does your original issue still occur with |
Alternate framing of this issue: pypa/distutils#150 should have gone with the Cygwin patch that inspired it for consistency with Darwin/OSX rather than raising a @AlmogBaku, do you agree with this framing of your complaint? |
Extend the error message for attempting to call `runtime_library_dir_option` on Windows with the most likely way I have found to trigger the call, creating an `Extension` that specifies `runtime_library_dirs`. Hopefully this will give users something to search for in their `setup.py` and a starting point for what to change. Inspired by pypa/setuptools#3450.
May want a closer match to the exception message to make it easier to search, but this should help. Inspired by pypa#3450.
setuptools version
Python version
OS
Windows
Additional environment information
No response
Description
7134521#diff-33b1124f858029240f7b1bce31b093b3e054100b2450ac8b3c067cfe9e464670R343
This line introduced a breaking change. Although theoretically removing the dynamic library should behave as the same, it threw an error that was really hard to find (since it's the error is new and google not indexing it).
Expected behavior
How to Reproduce
Output
don't know how to set runtime library search path on Windows
The text was updated successfully, but these errors were encountered: