cp316 drops required macro for Pillow to compile
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- build-system
Línea de trabajo
Start with src/libImaging/ImPlatform.h and inspect the HAVE_PROTOTYPES check alongside Pillow’s supported Python versions and C requirements. Reproduce the build failure using the reported CPython main branch and GCC or Clang, then check compatibility across the support window. Done when Pillow builds on CPython main without breaking its supported older Python versions.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What did you do?
Tried to compile from source with cpython main branch
What did you expect to happen?
It to compile.
What actually happened?
Failed to compile.
What are your OS, Python and Pillow versions?
- OS: arch, gcc (gcc (GCC) 16.2.1 20260810) or clang (clang version 23.1.4)
- Python: main branch (v3.16.0a1-393-ga9049ee4fb6)
- Pillow: main branch (1.7.6-21484-g5e898683d)
In file included from src/libImaging/Imaging.h:13,
from src/libImaging/Effects.c:18:
src/libImaging/ImPlatform.h:15:2: error: #error Sorry, this library requires support for ANSI prototypes.
15 | #error Sorry, this library requires support for ANSI prototypes.
| ^~~~~
In file included from src/libImaging/Imaging.h:13,
from src/libImaging/Draw.c:35:
src/libImaging/ImPlatform.h:15:2: error: #error Sorry, this library requires support for ANSI prototypes.
15 | #error Sorry, this library requires support for ANSI prototypes.
| ^~~~~
error: Command ['gcc', '-DCYTHON_FAST_THREAD_STATE=0', '-fPIC', '-DHAVE_LIBTIFF', '-DHAVE_LIBJPEG', '-DHAVE_OPENJPEG', '-DHAVE_LIBZ', '-DHAVE_LIBIMAGEQUANT', '-DHAVE_XCB', '-DPILLOW_VERSION="13.1.0.dev0"', '-I/usr/include/freetype2', '-I/usr/include/openjpeg-2.5', '-I/usr/include', '-I/usr/include/webp', '-I/usr/include/libpng16', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/glib-2.0/include', '-I/usr/include/sysprof-6', '-I/usr/include/fribidi', '-I/home/tcaswell/.virtualenvs/cp316/include', '-I/usr/local/include', '-I/home/tcaswell/.virtualenvs/cp316/include', '-I/home/tcaswell/.pybuild/cp316/include/python3.16', '-c', 'src/libImaging/ColorLUT.c', '-o', 'build/temp.linux-x86_64-cpython-316/src/libImaging/ColorLUT.o'] returned non-zero exit status 1.
[end of output]
error: Command ['clang', '-DCYTHON_FAST_THREAD_STATE=0', '-fPIC', '-DHAVE_LIBTIFF', '-DHAVE_LIBJPEG', '-DHAVE_OPENJPEG', '-DHAVE_LIBZ', '-DHAVE_LIBIMAGEQUANT', '-DHAVE_XCB', '-DPILLOW_VERSION="13.1.0.dev0"', '-I/usr/include/freetype2', '-I/usr/include/openjpeg-2.5', '-I/usr/include', '-I/usr/include/webp', '-I/usr/include/libpng16', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/glib-2.0/include', '-I/usr/include/sysprof-6', '-I/usr/include/fribidi', '-I/home/tcaswell/.virtualenvs/cp316-clang/include', '-I/usr/local/include', '-I/home/tcaswell/.virtualenvs/cp316-clang/include', '-I/home/tcaswell/.pybuild/cp316-clang/include/python3.16', '-c', 'src/libImaging/Arrow.c', '-o', 'build/temp.linux-x86_64-cpython-316/src/libImaging/Arrow.o'] returned non-zero exit status 1.
src/_imaging.c:1324:84: warning: implicit conversion from enumeration type 'const ModeID' to different enumeration type 'RawModeID' [-Wimplicit-enum-enum-cast]
1324 | const RawModeID rawmode = rawmode_name != NULL ? findRawModeID(rawmode_name) : mode;
| ~~~~~~~ ^~~~
1 error generated.
In file included from src/libImaging/ColorLUT.c:1:
In file included from src/libImaging/Imaging.h:13:
src/libImaging/ImPlatform.h:15:2: error: Sorry, this library requires support for ANSI prototypes.
15 | #error Sorry, this library requires support for ANSI prototypes.
| ^
1 error generated.
1 error generated.
1 warning and 1 error generated.
In file included from src/libImaging/Draw.c:35:
In file included from src/libImaging/Imaging.h:13:
src/libImaging/ImPlatform.h:15:2: error: Sorry, this library requires support for ANSI prototypes.
15 | #error Sorry, this library requires support for ANSI prototypes.
| ^
1 error generated.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
The source of the problem is that upstream removed the HAVE_PROTOTYPES macro in https://github.com/python/cpython/pull/159513 .
This minimal fix is:
diff --git a/src/libImaging/ImPlatform.h b/src/libImaging/ImPlatform.h
index a800d8278..29c4425e4 100644
--- a/src/libImaging/ImPlatform.h
+++ b/src/libImaging/ImPlatform.h
@@ -11,9 +11,6 @@
#include <Python.h>
/* Check that we have an ANSI compliant compiler */
-#ifndef HAVE_PROTOTYPES
-#error Sorry, this library requires support for ANSI prototypes.
-#endif
#ifndef STDC_HEADERS
#error Sorry, this library requires ANSI header files.
#endif
but I am not sure the exact intersection of when Python's minimum C is high enough that this is unneeded and and the support window of old Python for Pillow intersect to make this safe to just drop or if it requires some version gating on CPython version.
I also leave to @hugovk if there is a case to be made to revert this upstream or just deal with it here.
- Lenguaje dominante
- Python
- Estrellas
- 13.9k
- Forks
- 2.6k
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 172
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python-pillow/Pillow
-
TIFF without XResolution/YResolution reports dpi (1, 1)Posiblemente ocupada @brettdavies la tomó hace 1 día. Abierto🤖-assisted TIFF
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
python-pillow/Pillow#10332 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Warn that pre-applying arabic_reshaper + python-bidi corrupts text on a Raqm buildPosiblemente ocupada @Syamjith-NK la tomó hace 59 días. AbiertoDocumentation Font Rendering PNG Third Party Framework
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
python-pillow/Pillow#9907 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Image.putpixel incorrectly labels supported arguments in type annotationsPosiblemente ocupada @radarhere la tomó hace 187 días. AbiertoPNG
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
python-pillow/Pillow#9584 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
JPEG dpi read from EXIF uses XResolution for both axesPosiblemente ocupada @unvisible789 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 20/100
python-pillow/Pillow#10331 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
python-pillow/Pillow#10330 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de python-pillow/Pillow
Issues similares
-
backlog
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
EchoTools/nevr-runtime#1108 ·
Los mantenedores suelen responder en 1 día
-
parse names a key after a top-level multi() threshold Bitcoin Core v31.1 refuses as not validAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
btclib-org/btclib-wallet#587 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Judgment-Pack/judgment-pack-spec#275 ·
Los mantenedores suelen responder en 1 día