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
Imaging.h: confusion with system #4923
Conversation
The file `libImaging/Imaging.h` gets installed flat on Ubuntus into the public Python includes. When building a newer version of Pillow from source and hinting the Python includes "too early" in includes, e.g. in package managers, this can confuse the two files and pick up the external file over the internal one. With different versions, this mismatch can lead to build errors, e.g. undefined macros. The most robust way to avoid this is to pre-fix the internal include accordingly, so that the relative path to the including file has to match as well.
c36290c
to
f79379e
Compare
I've created ax3l#1 as a suggestion to expand on this - prefixing more header includes. |
I think this is a bug in the debian packaging. Following the debian rules for splitting and naming packages, if the header is actually required (e.g, for other debian packages), it should be in a package named python-pillow-dev, not in the primary python-pillow package. (e.g, libfoo and libfoo-dev for compilation). |
If it's not a problem though, is it worth doing just because it makes it clearer to the reader where the header file is located? |
Prefix other header includes
That's also what I was thinking. Even if it were in a An alternative solution that we considered would be to change the order in which Another question is if those headers should be installed in the install prefix without further directory namespace around it or at all. Is this a vendored third-party library? Considering all of the above and aiming for a small change set as an outside contributor, the proposed diff was the least invasive and most stable approach I could come up with. |
Thank you for the update, LGTM. |
I tried to remove the #include <raqm.h> to #include "libImaging/raqm.h" so I'm not sure it is worth it. Thoughts? ax3l/Pillow@fix-imagingHinclude...nulano:fix-imagingHinclude |
Oh, but that means instead of the internally shipped |
Co-authored-by: nulano <nulano@nulano.eu>
Merged in |
The file
libImaging/Imaging.h
gets installed on Ubuntu flat into the public Python includes.When building a newer version of Pillow from source and hinting the Python includes "too early" in includes, e.g. in package managers, this can confuse the two files and pick up the external file over the internal one. With different versions, this mismatch can lead to build errors, e.g. undefined macros.
The most robust way to avoid this is to prefix the internal include accordingly, so that the relative path to the including file has to match as well.