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
Use The CygwinCCompiler Under Cygwin #46697
Comments
I was having an issue building extension with a fresh checkout of
|
The patch contains lots of unrelated changes. Can you please provide a |
As Christian suggested I removed the unrelated svn:ignore changes. |
The following will also let environment variables be passed to the --- orig/sysconfig.py 2008-05-19 00:26:03.953125000 -0700
+++ copy/sysconfig.py 2008-05-19 00:14:51.609375000 -0700
@@ -145,7 +145,7 @@
Mainly needed on Unix, so we can plug in the information that
varies across Unices and is stored in Python's Makefile.
"""
- if compiler.compiler_type == "unix":
+ if compiler.compiler_type in ("unix", "cygwin"):
(cc, cxx, opt, cflags, ccshared, ldshared, so_ext) = \
get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
'CCSHARED', 'LDSHARED', 'SO') |
# I found this infomation via "svn blame" According to bpo-403947, cygwin once used CygwinCCompiler, and problem If this issue is not solved yet, maybe it's not good to go back to |
May be check for compiler.compiler_type (from sysconfig.py ) has to be Also CygwinCCompiler __init__ has to be reviewed too. As example : I thin that proposed modification in sysconfig.py with removing(or As example I will remove a hack in the setup.py: @@ -196,8 +196,26 @@
if compiler is not None:
(ccshared,cflags) =
sysconfig.get_config_vars('CCSHARED','CFLAGS')
args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
+
+ # FIXME: Is next correct ?
+ # To link modules we need LDSHARED passed to setup.py otherwise
+ # distutils will use linker from build system if cross-compiling.
+ linker_so = os.environ.get('LDSHARED')
+ if linker_so is not None:
+ args['linker_so'] = linker_so
+
self.compiler.set_executables(**args) Thanks to Hirokazu who point me, in an another thread, that cygwin build |
P.S. : about: static_lib_extension = ".dll.a" - it is suffix for import |
I forgot an another issue in CygwinCCompiler __init__: |
I don't think the patch, cygwin-smaller.diff, is correct. The value of AFAICT, Cygwin needs a concept that is not currently supported by |
Shouldn't the import library name end with .lib? I've run up against this building PyLucene with MinGW. There seems to be code to figure this out already in CygwinCCompiler, but it's commented out (and arguably incomplete). |
Hi, A separate bpo-18634 "find import library" address .dll.a suffix based on existing distutil functionality. Also bpo-18633 "Mingw32CCompiler as default compiler for mingw* build" adds same fixes from unix compiler class into Cygwin one - ref '# Chop off the drive' So with above I think that cygwin compiler could be switched back from unix to own. |
CygwinCCompiler seems legacy code. Other big issues and patches for build on Cygwin: |
I have confirmed Masayuki's patch (3.4-distutils-shlibext.patch) fixes a few build issues on Cygwin. At its core, what it's fixing is allowing UnixCCompiler.find_library_file to find import libraries on Cygwin. That in turn is necessary for --with-system-ffi to work, which is currently needed; on Cygwin64 at least the ffi compile as part of _ctypes fails (a separate issue to be addressed separately). But in the meantime making --with-system-ffi work again goes a long way. It should be noted there is a patch at bpo-18654 to make the CygwinCCompiler class work again, and switch to using it to handle Cygwin-specific build issues as origially intended. I intend to review that ticket and spend some time on it, but it's more complex and not necessarily the simplest way forward. In the meantime this one-line patch accomplishes a fair bit. |
Distutils is now deprecated (see PEP-632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils. If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: