-
Notifications
You must be signed in to change notification settings - Fork 68
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
Support Cygwin patches #73
Comments
@mkoeppe Do you have a contact for Cygwin? Do you know what the Cygwin patches are? Setuptools released two versions, 48 and 50, which twice attempted to adopt distutils into Setuptools, but there were emergent issues. I attempted to capture those emergent issues, but did not see anything reported from cygwin. I'd really like to get this feature rolled out, as the longer it takes to get distutils adoption as the default, the more risk there is that changes to distutils will break use-cases that aren't being exercised. Cygwin users will have the option to opt out by using Please do let us know more about what patches are present and how distutils might be able to incorporate that behavior. |
I don't have a cygwin contact, but the patches can be found at https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/python38.git;a=tree |
In particular https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/python38.git;a=blob;f=3.1-enable-new-dtags.patch;h=716af3b14d3483e5a4cdb65d0ec45ba92bd03ceb;hb=HEAD corresponds to the issue that I ran into that I mentioned in #60 (comment) |
I've reached out on the mailing list to raise awareness of the issue. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Let’s track msys2 project separately, even if some of the solutions may be similar. |
In email, Marco Atzeri responded: Hi Jason, currently we are not using any patch on SetupTools https://cygwin.com/packages/summary/python-setuptools-src.html there are several patches on Python source that include the distutil portion I just updated the patches used on last binaries on : http://cygwin.com/git/cygwin-packages/python39.git they are almost identical General information on our python packages are also on: https://cygwin.com/packages/summary/python38-src.html It also included an attachment --- origsrc/Python-3.8.0a4/Lib/distutils/cygwinccompiler.py 2019-05-06 14:30:25.000000000 -0400
+++ src/Python-3.8.0a4/Lib/distutils/cygwinccompiler.py 2019-05-19 14:35:55.872267300 -0400
@@ -92,9 +92,7 @@ class CygwinCCompiler(UnixCCompiler):
compiler_type = 'cygwin'
obj_extension = ".o"
static_lib_extension = ".a"
- shared_lib_extension = ".dll"
- static_lib_format = "lib%s%s"
- shared_lib_format = "%s%s"
+ shared_lib_extension = ".dll.a"
exe_extension = ".exe"
def __init__(self, verbose=0, dry_run=0, force=0):
--- origsrc/Python-3.8.0a4/Lib/distutils/unixccompiler.py 2019-05-19 14:24:27.779442200 -0400
+++ src/Python-3.8.0a4/Lib/distutils/unixccompiler.py 2019-05-19 14:35:55.872267300 -0400
@@ -81,6 +81,7 @@ class UnixCCompiler(CCompiler):
xcode_stub_lib_format = dylib_lib_format
if sys.platform == "cygwin":
exe_extension = ".exe"
+ dylib_lib_extension = ".dll.a"
def preprocess(self, source, output_file=None, macros=None,
include_dirs=None, extra_preargs=None, extra_postargs=None):
--- origsrc/Python-3.8.0b2/Misc/python.pc.in 2019-07-04 06:50:19.000000000 -0400
+++ src/Python-3.8.0b2/Misc/python.pc.in 2019-07-21 15:33:35.374399700 -0400
@@ -9,5 +9,5 @@ Description: Build a C extension for Pyt
Requires:
Version: @VERSION@
Libs.private: @LIBS@
-Libs:
+Libs: @LIBPYTHON@
Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@ |
I've added a CI job in #82 for starters |
So I think this can be closed. |
Ah, I missed 3.1-enable-new-dtags.patch, I'll have a look |
I've created #150, as always, feedback welcome. |
I think this can be closed now |
I suspect pypa/setuptools#3257 is about this patch no longer being applied on an rpm-based platform. |
I just ran into this on Cygwin; pip decided to compile numpy, and failed with INFO: gcc -shared -Wl,--enable-auto-image-base [whole bunch of input files] -L/usr/lib -Lbuild/temp.cygwin-3.3.5-x86_64-3.8 -Wl,--enable-new-dtags,-R/usr/lib -lnpymath -lblas -lblas -lpython3.8 -o build/lib.cygwin-3.3.5-x86_64-3.8/numpy/core/_multiarray_umath.cpython-38-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 There's a chance this is because I set |
Last of the patches from pypa#73 Might close pypa/setuptools#3257 Dual purposes here: - On platforms like Cygwin that don't have `rpath`, try to avoid adding things to `rpath` - Some distribution binary package makers require that no shared library list a system library directory (`/lib`, `/lib64`, `/usr/lib`, `/usr/lib64`) in its `rpath`; this patch simplifies the code to ensure the shared library can find its dependencies at runtime.
Last of the patches from pypa#73 Might close pypa/setuptools#3257 Dual purposes here: - On platforms like Cygwin that don't have `rpath`, try to avoid adding things to `rpath` - Some distribution binary package makers require that no shared library list a system library directory (`/lib`, `/lib64`, `/usr/lib`, `/usr/lib64`) in its `rpath`; this patch simplifies the code to ensure the shared library can find its dependencies at runtime.
Also need to incorporate mingw/cygwin distutil patches - see #60 (comment), #60 (comment);
pypa/setuptools#2909 adds a CI for Cygwin
Originally posted by @mkoeppe in pypa/setuptools#2896 (comment)
The text was updated successfully, but these errors were encountered: