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

Build fails under Cygwin with Python 3.9.16 and false "jpeg not found" message #7158

Closed
ipa-bak opened this issue May 11, 2023 · 11 comments · Fixed by #7175
Closed

Build fails under Cygwin with Python 3.9.16 and false "jpeg not found" message #7158

ipa-bak opened this issue May 11, 2023 · 11 comments · Fixed by #7175

Comments

@ipa-bak
Copy link

ipa-bak commented May 11, 2023

What did you do?

Tried to install Pillow via pip pip install Pillow

Then tried to git clone and install via pip install -e . from latest source in a fresh and clean virtual environment

What did you expect to happen?

Clean download, compile and install

What actually happened?

install errored out:

The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

Potentially related issues:

What are your OS, Python and Pillow versions?

  • OS: windows 10, Cygwin (latest update from today, 2023-05-11)
  • Python: 3.9.16
  • Pillow: 1.7.6-14728-g8874549a9

Full Python version:

$ Python
Python 3.9.16 (main, Mar  8 2023, 22:47:22)
[GCC 11.3.0] on cygwin

Potentially relevant Cygwin package versions:

cygwin    3.4.6-1
cygwin-devel    3.4.6-1
base-cygwin    3.8-2
gcc-g++    11.3.0-1
python-pip-wheel    19.2.3-1
python-setuptools-wheel    0.37.1-1
python3    3.9.10-1
python3-devel    3.9.10-1
python39    3.9.16-1
python39-cython    0.29.33-1
python39-devel    3.9.16-1
python39-packaging    21.3-1
python39-pkgconfig    1.5.5.-1
python39-setuptools    67.6.0-1
python39-virtualenv    20.21.0-1
python39-wheel    0.38.4-1
python39-imaging    8.4.0-1
pkg-config    1.9.5-1
pkgconf    1.9.5-1
jpeg    2.1.5.1-1
libjpeg-devel    2.1.5.1-1
libjpeg8    2.1.5.1-1
libopenjpeg-devel    1.5.2-3
libopenjpeg1    1.5.2-3
openjpeg    1.5.2-3
openjpeg2    2.5.0-1
zlib-devel    1.2.13-1
zlib0    1.2.13-1
libtiff6    4.4.0-1
libtiff7    4.5.0-1
libfreetype6    2.13.0-1
liblcms2_2    2.15-1
libwebp7    1.3.0-1
libimagequant0    2.10.0-1
libraqm0    0.7.0-1

Steps to reproduce

See also script below.

  • Setup a minimal Cygwin environment with packages as listed above.
  • Create a virtual python environment virtualenv-3.9 pillow-tst
  • Activate virtual environment. Within run pip install pillow

Script try-build-pillow.sh:

#! /bin/bash

stamp="$(date +%Y-%m-%d_%H%M%S)"
base="pillow-tmp"
full="${base}_${stamp}"

virtualenv-3.9 "${full}"
pushd "${full}" || exit 1
. bin/activate
pip --version
python --version
pip install pillow
popd

Script output

 ./try-build-pillow.sh
created virtual environment CPython3.9.16.final.0-64 in 2512ms
  creator CPython3Posix(dest=/home/bak/pillow-tmp_2023-05-11_155517, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/bak/.local/share/virtualenv)
    added seed packages: pip==23.0.1, setuptools==67.6.1, wheel==0.40.0
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
~/pillow-tmp_2023-05-11_155517 ~
pip 23.0.1 from /home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/pip (python 3.9)
Python 3.9.16
Collecting pillow
  Using cached Pillow-9.5.0.tar.gz (50.5 MB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pillow
  Building wheel for pillow (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [189 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.cygwin-3.4.6-x86_64-cpython-39
      creating build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/BdfFontFile.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/BlpImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/BmpImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/BufrStubImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ContainerIO.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/CurImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/DcxImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/DdsImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/EpsImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ExifTags.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/features.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/FitsImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/FitsStubImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/FliImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/FontFile.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/FpxImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/FtexImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/GbrImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/GdImageFile.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/GifImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/GimpGradientFile.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/GimpPaletteFile.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/GribStubImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/IcnsImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/IcoImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/Image.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageChops.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageCms.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageColor.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageDraw.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageDraw2.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageEnhance.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageFile.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageFilter.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageFont.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageGrab.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageMath.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageMode.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageMorph.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageOps.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImagePalette.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImagePath.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageQt.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageSequence.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageShow.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageStat.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageTk.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageTransform.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImageWin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/ImtImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/IptcImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/JpegImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/JpegPresets.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/McIdasImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/MicImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/MpegImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/MpoImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/MspImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PaletteFile.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PalmImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PcdImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PcfFontFile.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PcxImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PdfImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PdfParser.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PixarImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PngImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PpmImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PsdImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PSDraw.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/PyAccess.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/QoiImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/SgiImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/SpiderImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/SunImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/TarIO.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/TgaImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/TiffImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/TiffTags.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/WalImageFile.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/WebPImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/WmfImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/XbmImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/XpmImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/XVThumbImagePlugin.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/_binary.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/_deprecate.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/_tkinter_finder.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/_util.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/_version.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/__init__.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      copying src/PIL/__main__.py -> build/lib.cygwin-3.4.6-x86_64-cpython-39/PIL
      running egg_info
      writing src/Pillow.egg-info/PKG-INFO
      writing dependency_links to src/Pillow.egg-info/dependency_links.txt
      writing requirements to src/Pillow.egg-info/requires.txt
      writing top-level names to src/Pillow.egg-info/top_level.txt
      reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*.c'
      warning: no files found matching '*.h'
      warning: no files found matching '*.sh'
      warning: no files found matching '*.txt'
      warning: no previously-included files found matching '.appveyor.yml'
      warning: no previously-included files found matching '.clang-format'
      warning: no previously-included files found matching '.coveragerc'
      warning: no previously-included files found matching '.editorconfig'
      warning: no previously-included files found matching '.readthedocs.yml'
      warning: no previously-included files found matching 'codecov.yml'
      warning: no previously-included files found matching 'renovate.json'
      warning: no previously-included files matching '.git*' found anywhere in distribution
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files matching '*.so' found anywhere in distribution
      no previously-included directories found matching '.ci'
      adding license file 'LICENSE'
      writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
      running build_ext


      The headers or library files could not be found for jpeg,
      a required dependency when compiling Pillow from source.

      Please see the install instructions at:
         https://pillow.readthedocs.io/en/latest/installation.html

      Traceback (most recent call last):
        File "/tmp/pip-install-2bvhmusu/pillow_2fb74b21c9a04782b3dade7d8d874d33/setup.py", line 993, in <module>
          setup(
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/__init__.py", line 108, in setup
          return distutils.core.setup(**attrs)
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/dist.py", line 1221, in run_command
          super().run_command(command)
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/dist.py", line 1221, in run_command
          super().run_command(command)
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/dist.py", line 1221, in run_command
          super().run_command(command)
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/home/bak/pillow-tmp_2023-05-11_155517/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/tmp/pip-install-2bvhmusu/pillow_2fb74b21c9a04782b3dade7d8d874d33/setup.py", line 809, in build_extensions
          raise RequiredDependencyException(f)
      __main__.RequiredDependencyException: jpeg

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-2bvhmusu/pillow_2fb74b21c9a04782b3dade7d8d874d33/setup.py", line 1010, in <module>
          raise RequiredDependencyException(msg)
      __main__.RequiredDependencyException:

      The headers or library files could not be found for jpeg,
      a required dependency when compiling Pillow from source.

      Please see the install instructions at:
         https://pillow.readthedocs.io/en/latest/installation.html


      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pillow
  Running setup.py clean for pillow
Failed to build pillow
Installing collected packages: pillow
  Running setup.py install for pillow ... error
  error: subprocess-exited-with-error

 [ similar output from setup install step cut ]

Actual available libraries:

$ find /usr/lib /lib -name '*jpeg*'
/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/cygpixbufloader-jpeg.dll
/usr/lib/libjpeg.dll.a
/usr/lib/libopenjpeg.dll.a
/usr/lib/openjpeg-1.5
/usr/lib/pkgconfig/libjpeg.pc
/usr/lib/pkgconfig/libopenjpeg.pc
/usr/lib/qt5/plugins/imageformats/cygqjpeg.dll
/lib/gdk-pixbuf-2.0/2.10.0/loaders/cygpixbufloader-jpeg.dll
/lib/libjpeg.dll.a
/lib/libopenjpeg.dll.a
/lib/openjpeg-1.5
/lib/pkgconfig/libjpeg.pc
/lib/pkgconfig/libopenjpeg.pc
/lib/pkgconfig/libopenjpeg1.pc
/lib/qt5/plugins/imageformats/cygqjpeg.dll

$ find /usr /lib -name jpeglib.h
/usr/include/jpeglib.h

Feel free to contact me (@ mention) if you need further information.

@aclark4life
Copy link
Member

@ipa-bak Cygwin may be tough, because I'm not sure if it ever worked well enough to rely on, but maybe. I may be able to test on Windows 11 if that would help. WSL may be worth checking out too.

@radarhere
Copy link
Member

We currently test Cygwin as one of our CI jobs - https://github.com/python-pillow/Pillow/blob/main/.github/workflows/test-cygwin.yml

#6216 (comment)

pypa/distutils#139 has merged a fix into upstream of setuptools, so that fix should be propagating into setuptools in time.

For anyone who needs a fix before then and cannot downgrade to setuptools<60, setting an environment variable SETUPTOOLS_USE_DISTUTILS=stdlib should allow the patches in the Cygwin python packages to handle this case, and I think that environment variable will stick around until setuptools upgrades its bundled distutils.

If I remove SETUPTOOLS_USE_DISTUTILS=stdlib from our CI job, I get your error, so I would try prefixing your install command with that.

@ipa-bak
Copy link
Author

ipa-bak commented May 12, 2023

I can confirm that adding SETUPTOOLS_USE_DISTUTILS=stdlib solved the problem and I could successfully install Pillow. Thanks @radarhere for the suggestion!

You can close the issue or keep it for reference until setuptools work again without that setting.

@aclark4life
Copy link
Member

Thanks @radarhere ! Regularly testing Cygwin on GH Actions since 2021™, awesome. https://github.com/python-pillow/Pillow/actions/workflows/test-cygwin.yml

@radarhere
Copy link
Member

@DWesl I would have thought that pypa/distutils#139 became pypa/setuptools@c6f28fc, and so would have been included in setuptools 62.4.0.

Do you have any idea why SETUPTOOLS_USE_DISTUTILS=stdlib is still needed?

@DWesl
Copy link
Contributor

DWesl commented May 13, 2023

I don't need that when building locally, so my guess is that virtualenv installs an old version of setuptools. Does this script work better?

stamp="$(date +%Y-%m-%d_%H%M%S)"
base="pillow-tmp"
full="${base}_${stamp}"

virtualenv-3.9 "${full}"
pushd "${full}" || exit 1
. bin/activate
pip --version
python --version
pip install 'setuptools>=62.4.0'
pip install pillow
popd

@radarhere
Copy link
Member

If I stop using SETUPTOOLS_USE_DISTUTILS=stdlib on GitHub Actions, it fails.

If I print the setuptools version, I get 67.6.0. Interestingly, I also find that it uses UnixCCompiler, which might actually be correct, but your changes in pypa/distutils#139 were to the Cygwin compiler?

DWesl added a commit to DWesl/distutils that referenced this issue May 14, 2023
python-pillow/Pillow#7158 (comment)
suggests that Cygwin uses UnixCCompiler rather than CygwinCCompiler by default, so UnixCCompiler would need to know how to find shared libraries, import libraries, and static libraries on Cygwin.
@DWesl
Copy link
Contributor

DWesl commented May 14, 2023

I made pypa/distutils#209 to make the same changes in UnixCCompiler that pypa/distutils#139 made to CygwinCCompiler; hopefully that fixes this problem.

@radarhere
Copy link
Member

Testing, I find that it does! Thanks very much.

@ipa-bak
Copy link
Author

ipa-bak commented May 19, 2023

@DWesl although I don't know much about the distutils (not to say: nothing 😄 ) , it seems strange that under Cygwin the rules from UnixCCompiler are used and not those from CygwinCCompiler. Maybe there is something else wrong?

@aclark4life
Copy link
Member

DimitriPapadopoulos pushed a commit to DimitriPapadopoulos/distutils that referenced this issue Jun 29, 2024
python-pillow/Pillow#7158 (comment)
suggests that Cygwin uses UnixCCompiler rather than CygwinCCompiler by default, so UnixCCompiler would need to know how to find shared libraries, import libraries, and static libraries on Cygwin.
DimitriPapadopoulos pushed a commit to DimitriPapadopoulos/distutils that referenced this issue Jun 29, 2024
python-pillow/Pillow#7158 (comment)
suggests that Cygwin uses UnixCCompiler rather than CygwinCCompiler by default, so UnixCCompiler would need to know how to find shared libraries, import libraries, and static libraries on Cygwin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants