Skip to content

Commit 1a9ea90

Browse files
committed
Strip host /usr/ include/lib paths from Pillow cross-compilation
The build Python's sysconfig leaks /usr/include into compiler dirs via crossenv, causing glibc headers to shadow NDK sysroot headers on Linux CI runners.
1 parent 3feee10 commit 1a9ea90

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

recipes/pillow/patches/setup-11.x.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,16 @@ diff --git a/setup.py b/setup.py
2525

2626
#
2727
# add platform directories
28+
@@ -684,6 +684,12 @@ class pil_build_ext(build_ext):
29+
self.compiler.include_dirs = include_dirs + self.compiler.include_dirs
30+
31+
#
32+
+ # When cross-compiling, remove host system include/lib paths that
33+
+ # leak in from the build Python's sysconfig (e.g. /usr/include).
34+
+ if self.disable_platform_guessing:
35+
+ self.compiler.include_dirs = [d for d in self.compiler.include_dirs if not d.startswith("/usr/")]
36+
+ self.compiler.library_dirs = [d for d in self.compiler.library_dirs if not d.startswith("/usr/")]
37+
+ #
38+
# look for available libraries
39+
40+
feature = self.feature

0 commit comments

Comments
 (0)