From d9cb50b6ab4834ab87b5826d1c910fb9f6ed5e0a Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Wed, 9 Sep 2026 09:42:55 +0300 Subject: [PATCH 1/2] wheels-dependencies.sh: warn on deps missing from bundle The /dev/null redirection is required because cibuildwheel may build within a Docker container without the GITHUB_STEP_SUMMARY envvar set (and even if it was set, the GITHUB_STEP_SUMMARY file wouldn't escape the container). --- .github/workflows/wheels-dependencies.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index b3a5782091b..e2040836977 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -89,6 +89,20 @@ if [[ -z "$IS_MACOS" ]]; then fi ARCHIVE_SDIR=pillow-depends-main +MISSING_DEPENDS_FILE=$(mktemp) + +# Redeclare fetch_unpack as multibuild_fetch_unpack so we can still call it +eval "$(declare -f fetch_unpack | sed '1s/^fetch_unpack/multibuild_fetch_unpack/')" + +function fetch_unpack { + local url=$1 + local archive_fname=${2:-$(basename $url)} + if [[ ! -f "${ARCHIVE_SDIR}/${archive_fname}" ]]; then + echo "::warning title=Dependency missing from pillow-depends::$archive_fname is not in pillow-depends; downloading it from $url" >&2 + echo " $archive_fname (from $url)" >> "$MISSING_DEPENDS_FILE" + fi + multibuild_fetch_unpack "$@" +} VERSIONS_FILE="$PROJECTDIR/.github/dependencies.json" _get_ver() { python3 -c "import json; print(json.load(open('$VERSIONS_FILE'))['$1'])"; } @@ -398,6 +412,15 @@ fi wrap_wheel_builder build +if [[ -f $MISSING_DEPENDS_FILE ]]; then + ( + echo "# The following archives were not found in pillow-depends and were downloaded from upstream instead:" + echo '```' + cat "$MISSING_DEPENDS_FILE" + echo '```' + ) >> "${GITHUB_STEP_SUMMARY:-/dev/null}" +fi + # A safety catch for iOS. iOS can't use dynamic libraries, but clang will prefer # to link dynamic libraries to static libraries. The only way to reliably # prevent this is to not have dynamic libraries available in the first place. From 6ba903ece2c01071d277e5a87d62c30ef08e7947 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Wed, 9 Sep 2026 13:21:20 +0300 Subject: [PATCH 2/2] Override builders for zlib-ng and openjpeg so they use cached files --- .github/workflows/wheels-dependencies.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index e2040836977..5acd3683f55 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -158,7 +158,11 @@ function build_zlib_ng { ORIGINAL_HOST_CONFIGURE_FLAGS=$HOST_CONFIGURE_FLAGS unset HOST_CONFIGURE_FLAGS - build_github zlib-ng/zlib-ng $ZLIB_NG_VERSION --installnamedir=$BUILD_PREFIX/lib --zlib-compat + local out_dir=$(fetch_unpack https://github.com/zlib-ng/zlib-ng/archive/$ZLIB_NG_VERSION.tar.gz zlib-ng-$ZLIB_NG_VERSION.tar.gz) + (cd $out_dir \ + && ./configure --prefix=$BUILD_PREFIX $HOST_CONFIGURE_FLAGS --installnamedir=$BUILD_PREFIX/lib --zlib-compat \ + && make -j4 \ + && make install) HOST_CONFIGURE_FLAGS=$ORIGINAL_HOST_CONFIGURE_FLAGS touch zlib-stamp @@ -262,6 +266,20 @@ function build_zstd { touch zstd-stamp } +function build_openjpeg { + if [ -e openjpeg-stamp ]; then return; fi + build_zlib + build_libpng + build_tiff + build_lcms2 + local cmake=$(get_modern_cmake) + local out_dir=$(fetch_unpack https://github.com/uclouvain/openjpeg/archive/v$OPENJPEG_VERSION.tar.gz openjpeg-$OPENJPEG_VERSION.tar.gz) + (cd $out_dir \ + && $cmake -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_INSTALL_LIBDIR=$BUILD_PREFIX/lib -DCMAKE_INSTALL_NAME_DIR=$BUILD_PREFIX/lib $HOST_CMAKE_FLAGS . \ + && make -j4 install) + touch openjpeg-stamp +} + function build { build_xz if [ -z "$IS_ALPINE" ] && [ -z "$SANITIZER" ] && [ -z "$IS_MACOS" ]; then