distutils adoption means cygwin-specific patches will be lost

Marco Atzeri marco.atzeri@gmail.com
Sat Dec 11 16:55:30 GMT 2021


On 11.12.2021 17:19, Jason R. Coombs wrote:
> The Setuptools project is adopting distutils from the Python standard library. It’s doing this to unify the implementation and allow it to evolve again.
> 
> In Setuptools 48 and Setuptools 50, Setuptools made the adopted distutils the default (causing “import distutils” to resolve to `setuptools._distutils` and thus bypass any patches that may have been applied to distutils as found in the stdlib) with an escape hatch: by setting SETUPTOOLS_USE_DISTUTILS=stdlib. Due to incompatibilities identified with this ereleases, the behavior of using the local distutils by default was rolled back.
> 
> In about a week’s time, Setuptools will make the local distutils the default again. Users can preview the behavior on existing releases by setting SETUPTOOLS_USE_DISTUTILS=local and opt out with the escape hatch.
> 
> Until recently, no one from the Cygwin project has reached out, but recently, mkoeppe did mention the concern leading to the filing of https://github.com/pypa/distutils/issues/73.
> 
> The Setuptools/distutils project would be happy to facilitate supporting Cygwin in the new environment without monkey patching, either through direct support of the platform or through hooks that allow the platform to customize the behavior (and probably a mix). Please reach out on the issue to uncover any emergent issues and to devise a design for long term support.
> 
> Regards,
> Jason R. Coombs
> 

Hi Jason,

currently we are not using any patch on SetupTools
Last I packaged is 59.5.0 for python 3.6 to 3.9

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
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
https://cygwin.com/packages/summary/python39-src.html
-------------- next part --------------
--- 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@


More information about the Cygwin mailing list