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

Error installing pyvips on Mac OS #459

Closed
agforte opened this issue Mar 30, 2024 · 15 comments · Fixed by #461 or #464
Closed

Error installing pyvips on Mac OS #459

agforte opened this issue Mar 30, 2024 · 15 comments · Fixed by #461 or #464

Comments

@agforte
Copy link

agforte commented Mar 30, 2024

I could not find this issue listed in current issues. Apologies if I missed it.

I have followed the instructions for MacOS (MacOS Sonoma version 14 - MacBook Air M1) and ran:

  1. brew install vips python pkg-config which installed: vips 8.15.2, [email protected] 3.12.2_1, pkg-config 0.29.2_3
  2. pip3 install pyvips gives a bunch of errors (see below):
Defaulting to user installation because normal site-packages is not writeable
Collecting pyvips
  Using cached pyvips-2.2.2.tar.gz (51 kB)
Requirement already satisfied: cffi>=1.0.0 in /Users/andrea/Library/Python/3.9/lib/python/site-packages (from pyvips) (1.16.0)
Requirement already satisfied: pkgconfig in /Users/andrea/Library/Python/3.9/lib/python/site-packages (from pyvips) (1.5.5)
Requirement already satisfied: pycparser in /Users/andrea/Library/Python/3.9/lib/python/site-packages (from cffi>=1.0.0->pyvips) (2.21)
Building wheels for collected packages: pyvips
  Building wheel for pyvips (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-install-ibjgb58x/pyvips_feab40013bfd403ebc1c24a7452c644c/setup.py'"'"'; __file__='"'"'/private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-install-ibjgb58x/pyvips_feab40013bfd403ebc1c24a7452c644c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-wheel-z8bh6zsi
       cwd: /private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-install-ibjgb58x/pyvips_feab40013bfd403ebc1c24a7452c644c/
  Complete output (73 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-universal2-3.9
  creating build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/vinterpolate.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/enums.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/vsourcecustom.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/version.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/vobject.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/error.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/vtargetcustom.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/vregion.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/__init__.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/vimage.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/vdecls.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/gvalue.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/voperation.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/vtarget.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/pyvips_build.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/gobject.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/base.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/vsource.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  copying pyvips/vconnection.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
  running build_ext
  generating cffi module 'build/temp.macosx-10.9-universal2-3.9/_libvips.c'
  creating build/temp.macosx-10.9-universal2-3.9
  building '_libvips' extension
  creating build/temp.macosx-10.9-universal2-3.9/build
  creating build/temp.macosx-10.9-universal2-3.9/build/temp.macosx-10.9-universal2-3.9
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -Wno-error=unreachable-code -DHWY_SHARED_DEFINE -I/opt/homebrew/Cellar/libarchive/3.7.2/include -I/opt/homebrew/Cellar/vips/8.15.2/include -I/opt/homebrew/Cellar/fftw/3.3.10_1/include -I/opt/homebrew/Cellar/cfitsio/4.4.0/include -I/opt/homebrew/Cellar/libimagequant/4.3.0/include -I/opt/homebrew/Cellar/cgif/0.3.2/include -I/opt/homebrew/Cellar/libexif/0.6.24/include -I/opt/homebrew/Cellar/libspng/0.7.4/include -I/opt/homebrew/Cellar/webp/1.3.2/include -I/opt/homebrew/Cellar/webp/1.3.2/include/webp -I/opt/homebrew/Cellar/pango/1.52.1/include/pango-1.0 -I/opt/homebrew/Cellar/harfbuzz/8.3.1/include/harfbuzz -I/opt/homebrew/Cellar/pango/1.52.1/include/pango-1.0 -I/opt/homebrew/Cellar/fribidi/1.0.13/include/fribidi -I/opt/homebrew/Cellar/harfbuzz/8.3.1/include/harfbuzz -I/opt/homebrew/Cellar/graphite2/1.3.14/include -I/opt/homebrew/Cellar/librsvg/2.58.0/include/librsvg-2.0 -I/opt/homebrew/Cellar/gdk-pixbuf/2.42.10_1/include/gdk-pixbuf-2.0 -I/opt/homebrew/Cellar/libtiff/4.6.0/include -I/opt/homebrew/Cellar/zstd/1.5.5/include -I/opt/homebrew/Cellar/xz/5.6.1/include -I/opt/homebrew/Cellar/jpeg-turbo/3.0.2/include -I/opt/homebrew/Cellar/cairo/1.18.0/include/cairo -I/opt/homebrew/Cellar/fontconfig/2.15.0/include -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/opt/libpng/include/libpng16 -I/opt/homebrew/Cellar/libxext/1.3.6/include -I/opt/homebrew/Cellar/libxrender/0.9.11/include -I/opt/homebrew/Cellar/libx11/1.8.8/include -I/opt/homebrew/Cellar/libxcb/1.16.1/include -I/opt/homebrew/Cellar/libxau/1.0.11/include -I/opt/homebrew/Cellar/libxdmcp/1.1.5/include -I/opt/homebrew/Cellar/pixman/0.42.2/include/pixman-1 -I/opt/homebrew/Cellar/libmatio/1.5.26/include -I/opt/homebrew/opt/hdf5/include -I/opt/homebrew/Cellar/little-cms2/2.16/include -I/opt/homebrew/Cellar/openexr/3.2.4/include -I/opt/homebrew/Cellar/openexr/3.2.4/include/OpenEXR -I/opt/homebrew/Cellar/imath/3.1.11/include -I/opt/homebrew/Cellar/imath/3.1.11/include/Imath -I/opt/homebrew/Cellar/openjpeg/2.5.2/include/openjpeg-2.5 -I/opt/homebrew/Cellar/highway/1.1.0/include -I/opt/homebrew/Cellar/glib/2.80.0_2/include -I/opt/homebrew/Cellar/glib/2.80.0_2/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.80.0_2/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.43/include -I/opt/homebrew/Cellar/xorgproto/2024.1/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -c build/temp.macosx-10.9-universal2-3.9/_libvips.c -o build/temp.macosx-10.9-universal2-3.9/build/temp.macosx-10.9-universal2-3.9/_libvips.o
  build/temp.macosx-10.9-universal2-3.9/_libvips.c:5718:28: error: incompatible function pointer types passing 'void *(*)(uint64_t, void *, void *)' (aka 'void *(*)(unsigned long long, void *, void *)') to parameter of type 'VipsTypeMap2Fn' (aka 'void *(*)(unsigned long, void *, void *)') [-Wincompatible-function-pointer-types]
    return vips_type_map(x0, x1, x2, x3);
                             ^~
  /opt/homebrew/Cellar/vips/8.15.2/include/vips/object.h:676:48: note: passing argument to parameter 'fn' here
  void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b);
                                                 ^
  build/temp.macosx-10.9-universal2-3.9/_libvips.c:5768:32: error: incompatible function pointer types passing 'void *(*)(uint64_t, void *, void *)' (aka 'void *(*)(unsigned long long, void *, void *)') to parameter of type 'VipsTypeMap2Fn' (aka 'void *(*)(unsigned long, void *, void *)') [-Wincompatible-function-pointer-types]
    { result = vips_type_map(x0, x1, x2, x3); }
                                 ^~
  /opt/homebrew/Cellar/vips/8.15.2/include/vips/object.h:676:48: note: passing argument to parameter 'fn' here
  void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b);
                                                 ^
  build/temp.macosx-10.9-universal2-3.9/_libvips.c:6208:27: error: incompatible function pointer types passing 'void (*)(void *)' to parameter of type 'VipsCallbackFn' (aka 'int (*)(void *, void *)') [-Wincompatible-function-pointer-types]
    vips_value_set_blob(x0, x1, x2, x3);
                            ^~
  /opt/homebrew/Cellar/vips/8.15.2/include/vips/type.h:275:17: note: passing argument to parameter 'free_fn' here
          VipsCallbackFn free_fn, const void *data, size_t length);
                         ^
  build/temp.macosx-10.9-universal2-3.9/_libvips.c:6256:29: error: incompatible function pointer types passing 'void (*)(void *)' to parameter of type 'VipsCallbackFn' (aka 'int (*)(void *, void *)') [-Wincompatible-function-pointer-types]
    { vips_value_set_blob(x0, x1, x2, x3); }
                              ^~
  /opt/homebrew/Cellar/vips/8.15.2/include/vips/type.h:275:17: note: passing argument to parameter 'free_fn' here
          VipsCallbackFn free_fn, const void *data, size_t length);
                         ^
  build/temp.macosx-10.9-universal2-3.9/_libvips.c:6433:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
    { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
                    ^     ~~~~~~~~~~~~~~~~
  build/temp.macosx-10.9-universal2-3.9/_libvips.c:6457:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
    { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
                    ^     ~~~~~~~~~~~~~~~~
  build/temp.macosx-10.9-universal2-3.9/_libvips.c:6519:15: warning: incompatible pointer types initializing 'uint64_t (*)[2]' (aka 'unsigned long long (*)[2]') with an expression of type 'union (unnamed union at /opt/homebrew/Cellar/glib/2.80.0_2/include/glib-2.0/gobject/gvalue.h:119:3) (*)[2]' [-Wincompatible-pointer-types]
    { uint64_t(*tmp)[2] = &p->data; (void)tmp; }
                ^         ~~~~~~~~
  build/temp.macosx-10.9-universal2-3.9/_libvips.c:6589:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'VipsArgumentTable **' (aka 'struct _GHashTable **') [-Wincompatible-pointer-types]
    { void * *tmp = &p->argument_table; (void)tmp; }
              ^     ~~~~~~~~~~~~~~~~~~
  build/temp.macosx-10.9-universal2-3.9/_libvips.c:6619:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'GTimer **' (aka 'struct _GTimer **') [-Wincompatible-pointer-types]
    { void * *tmp = &p->start; (void)tmp; }
              ^     ~~~~~~~~~
  5 warnings and 4 errors generated.
  error: command '/usr/bin/clang' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pyvips
  Running setup.py clean for pyvips
Failed to build pyvips
Installing collected packages: pyvips
    Running setup.py install for pyvips ... error
    ERROR: Command errored out with exit status 1:
     command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-install-ibjgb58x/pyvips_feab40013bfd403ebc1c24a7452c644c/setup.py'"'"'; __file__='"'"'/private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-install-ibjgb58x/pyvips_feab40013bfd403ebc1c24a7452c644c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-record-5i0zqa4j/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/andrea/Library/Python/3.9/include/python3.9/pyvips
         cwd: /private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-install-ibjgb58x/pyvips_feab40013bfd403ebc1c24a7452c644c/
    Complete output (73 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-universal2-3.9
    creating build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/vinterpolate.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/enums.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/vsourcecustom.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/version.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/vobject.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/error.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/vtargetcustom.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/vregion.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/__init__.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/vimage.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/vdecls.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/gvalue.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/voperation.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/vtarget.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/pyvips_build.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/gobject.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/base.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/vsource.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    copying pyvips/vconnection.py -> build/lib.macosx-10.9-universal2-3.9/pyvips
    running build_ext
    generating cffi module 'build/temp.macosx-10.9-universal2-3.9/_libvips.c'
    creating build/temp.macosx-10.9-universal2-3.9
    building '_libvips' extension
    creating build/temp.macosx-10.9-universal2-3.9/build
    creating build/temp.macosx-10.9-universal2-3.9/build/temp.macosx-10.9-universal2-3.9
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -Wno-error=unreachable-code -DHWY_SHARED_DEFINE -I/opt/homebrew/Cellar/libarchive/3.7.2/include -I/opt/homebrew/Cellar/vips/8.15.2/include -I/opt/homebrew/Cellar/fftw/3.3.10_1/include -I/opt/homebrew/Cellar/cfitsio/4.4.0/include -I/opt/homebrew/Cellar/libimagequant/4.3.0/include -I/opt/homebrew/Cellar/cgif/0.3.2/include -I/opt/homebrew/Cellar/libexif/0.6.24/include -I/opt/homebrew/Cellar/libspng/0.7.4/include -I/opt/homebrew/Cellar/webp/1.3.2/include -I/opt/homebrew/Cellar/webp/1.3.2/include/webp -I/opt/homebrew/Cellar/pango/1.52.1/include/pango-1.0 -I/opt/homebrew/Cellar/harfbuzz/8.3.1/include/harfbuzz -I/opt/homebrew/Cellar/pango/1.52.1/include/pango-1.0 -I/opt/homebrew/Cellar/fribidi/1.0.13/include/fribidi -I/opt/homebrew/Cellar/harfbuzz/8.3.1/include/harfbuzz -I/opt/homebrew/Cellar/graphite2/1.3.14/include -I/opt/homebrew/Cellar/librsvg/2.58.0/include/librsvg-2.0 -I/opt/homebrew/Cellar/gdk-pixbuf/2.42.10_1/include/gdk-pixbuf-2.0 -I/opt/homebrew/Cellar/libtiff/4.6.0/include -I/opt/homebrew/Cellar/zstd/1.5.5/include -I/opt/homebrew/Cellar/xz/5.6.1/include -I/opt/homebrew/Cellar/jpeg-turbo/3.0.2/include -I/opt/homebrew/Cellar/cairo/1.18.0/include/cairo -I/opt/homebrew/Cellar/fontconfig/2.15.0/include -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/opt/libpng/include/libpng16 -I/opt/homebrew/Cellar/libxext/1.3.6/include -I/opt/homebrew/Cellar/libxrender/0.9.11/include -I/opt/homebrew/Cellar/libx11/1.8.8/include -I/opt/homebrew/Cellar/libxcb/1.16.1/include -I/opt/homebrew/Cellar/libxau/1.0.11/include -I/opt/homebrew/Cellar/libxdmcp/1.1.5/include -I/opt/homebrew/Cellar/pixman/0.42.2/include/pixman-1 -I/opt/homebrew/Cellar/libmatio/1.5.26/include -I/opt/homebrew/opt/hdf5/include -I/opt/homebrew/Cellar/little-cms2/2.16/include -I/opt/homebrew/Cellar/openexr/3.2.4/include -I/opt/homebrew/Cellar/openexr/3.2.4/include/OpenEXR -I/opt/homebrew/Cellar/imath/3.1.11/include -I/opt/homebrew/Cellar/imath/3.1.11/include/Imath -I/opt/homebrew/Cellar/openjpeg/2.5.2/include/openjpeg-2.5 -I/opt/homebrew/Cellar/highway/1.1.0/include -I/opt/homebrew/Cellar/glib/2.80.0_2/include -I/opt/homebrew/Cellar/glib/2.80.0_2/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.80.0_2/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.43/include -I/opt/homebrew/Cellar/xorgproto/2024.1/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -c build/temp.macosx-10.9-universal2-3.9/_libvips.c -o build/temp.macosx-10.9-universal2-3.9/build/temp.macosx-10.9-universal2-3.9/_libvips.o
    build/temp.macosx-10.9-universal2-3.9/_libvips.c:5718:28: error: incompatible function pointer types passing 'void *(*)(uint64_t, void *, void *)' (aka 'void *(*)(unsigned long long, void *, void *)') to parameter of type 'VipsTypeMap2Fn' (aka 'void *(*)(unsigned long, void *, void *)') [-Wincompatible-function-pointer-types]
      return vips_type_map(x0, x1, x2, x3);
                               ^~
    /opt/homebrew/Cellar/vips/8.15.2/include/vips/object.h:676:48: note: passing argument to parameter 'fn' here
    void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b);
                                                   ^
    build/temp.macosx-10.9-universal2-3.9/_libvips.c:5768:32: error: incompatible function pointer types passing 'void *(*)(uint64_t, void *, void *)' (aka 'void *(*)(unsigned long long, void *, void *)') to parameter of type 'VipsTypeMap2Fn' (aka 'void *(*)(unsigned long, void *, void *)') [-Wincompatible-function-pointer-types]
      { result = vips_type_map(x0, x1, x2, x3); }
                                   ^~
    /opt/homebrew/Cellar/vips/8.15.2/include/vips/object.h:676:48: note: passing argument to parameter 'fn' here
    void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b);
                                                   ^
    build/temp.macosx-10.9-universal2-3.9/_libvips.c:6208:27: error: incompatible function pointer types passing 'void (*)(void *)' to parameter of type 'VipsCallbackFn' (aka 'int (*)(void *, void *)') [-Wincompatible-function-pointer-types]
      vips_value_set_blob(x0, x1, x2, x3);
                              ^~
    /opt/homebrew/Cellar/vips/8.15.2/include/vips/type.h:275:17: note: passing argument to parameter 'free_fn' here
            VipsCallbackFn free_fn, const void *data, size_t length);
                           ^
    build/temp.macosx-10.9-universal2-3.9/_libvips.c:6256:29: error: incompatible function pointer types passing 'void (*)(void *)' to parameter of type 'VipsCallbackFn' (aka 'int (*)(void *, void *)') [-Wincompatible-function-pointer-types]
      { vips_value_set_blob(x0, x1, x2, x3); }
                                ^~
    /opt/homebrew/Cellar/vips/8.15.2/include/vips/type.h:275:17: note: passing argument to parameter 'free_fn' here
            VipsCallbackFn free_fn, const void *data, size_t length);
                           ^
    build/temp.macosx-10.9-universal2-3.9/_libvips.c:6433:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
      { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
                      ^     ~~~~~~~~~~~~~~~~
    build/temp.macosx-10.9-universal2-3.9/_libvips.c:6457:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
      { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
                      ^     ~~~~~~~~~~~~~~~~
    build/temp.macosx-10.9-universal2-3.9/_libvips.c:6519:15: warning: incompatible pointer types initializing 'uint64_t (*)[2]' (aka 'unsigned long long (*)[2]') with an expression of type 'union (unnamed union at /opt/homebrew/Cellar/glib/2.80.0_2/include/glib-2.0/gobject/gvalue.h:119:3) (*)[2]' [-Wincompatible-pointer-types]
      { uint64_t(*tmp)[2] = &p->data; (void)tmp; }
                  ^         ~~~~~~~~
    build/temp.macosx-10.9-universal2-3.9/_libvips.c:6589:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'VipsArgumentTable **' (aka 'struct _GHashTable **') [-Wincompatible-pointer-types]
      { void * *tmp = &p->argument_table; (void)tmp; }
                ^     ~~~~~~~~~~~~~~~~~~
    build/temp.macosx-10.9-universal2-3.9/_libvips.c:6619:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'GTimer **' (aka 'struct _GTimer **') [-Wincompatible-pointer-types]
      { void * *tmp = &p->start; (void)tmp; }
                ^     ~~~~~~~~~
    5 warnings and 4 errors generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-install-ibjgb58x/pyvips_feab40013bfd403ebc1c24a7452c644c/setup.py'"'"'; __file__='"'"'/private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-install-ibjgb58x/pyvips_feab40013bfd403ebc1c24a7452c644c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/v6/p_r0gtgx2b16tt6gbbzgf0sh0000gn/T/pip-record-5i0zqa4j/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/andrea/Library/Python/3.9/include/python3.9/pyvips Check the logs for full command output.
WARNING: You are using pip version 21.2.4; however, version 24.0 is available.
You should consider upgrading via the '/Applications/Xcode.app/Contents/Developer/usr/bin/python3 -m pip install --upgrade pip' command.
@kleisauke
Copy link
Member

I think PR #445 (specifically commit 66d0a66) fixes this.

@jcupitt I could make a separate PR for commit 911f922 and 66d0a66 if you want.

@jcupitt
Copy link
Member

jcupitt commented Mar 31, 2024

Do you think #445 is ready to merge?

It feels a bit tricky with homebrew, it's so unstable it could break again at any moment. Maybe we should just merge anyway, since your PR is great and it'll start to rot if we don't.

@kleisauke
Copy link
Member

I think PR #445 is ready to merge, but I'll make a separate PR for commit 911f922 and 66d0a66 to facilitate reviewing.

@pasqualesalza
Copy link

Hi there! I'm currently in the situation that pyvips breaks the installation of requirements on Mac. I assume that is because of incompatibility with vips version 8.15.2 installed through homebrew.

I tried to install with pip this version, which refers to the commit mentioned in the comments:

pyvips @ git+https://github.com/libvips/pyvips.git@f9e3c5ee3028eb75def1c77ec2d855bda61c88e7

However, I cannot go through installation. Any suggestion?

@jcupitt
Copy link
Member

jcupitt commented Apr 18, 2024

Hi @pasqualesalza, we have a fix in PR (thanks to Kleis), but it's not merged. That needs to go in, then we need to release pyvips 3.0, and the problem should be solved.

@pasqualesalza
Copy link

Just for reference, maybe this can help before proceeding, I'm trying to pip install . from local on a current copy of master. It gives the same error as mentioned. Am I missing something? I'm available to give more info if this can be any helpful.

@jcupitt
Copy link
Member

jcupitt commented Apr 18, 2024

You need master pyvips from 1h ago (I think).

@pasqualesalza
Copy link

You need master pyvips from 1h ago (I think).

I've just tried and yet same error. :(

@kleisauke
Copy link
Member

Please can you provide the error message. It seems to work fine for me:

$ CC=clang pip3 install "pyvips @ git+https://github.com/libvips/pyvips.git" -v --break-system-packages
[snip]
Successfully built pyvips
Installing collected packages: pyvips
Successfully installed pyvips-2.2.3

@danmackinlay
Copy link

I don't know if they are the same, but this is my error (sonoma 14.4.1, macintel)

longer error
$ CC=clang pip3 install "pyvi
ps @ git+https://github.com/libvips/pyvips.git" -v --break-system-packages
Using pip 23.2.1 from /Users/dan/.pyenv/versions/3.11.7/lib/python3.11/site-packages/pip (python 3.11)
Collecting pyvips@ git+https://github.com/libvips/pyvips.git
  Cloning https://github.com/libvips/pyvips.git to /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-install-fwl4w4_r/pyvips_8a1628e406b44d30846bd26676461ff7
  Running command git version
  git version 2.44.0
  Running command git clone --filter=blob:none https://github.com/libvips/pyvips.git /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-install-fwl4w4_r/pyvips_8a1628e406b44d30846bd26676461ff7
  Cloning into '/private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-install-fwl4w4_r/pyvips_8a1628e406b44d30846bd26676461ff7'...
  Running command git rev-parse HEAD
  9c7e151eafa20ed03041e5406e52eccb2c6815f1
  Resolved https://github.com/libvips/pyvips.git to commit 9c7e151eafa20ed03041e5406e52eccb2c6815f1
  Running command git rev-parse HEAD
  9c7e151eafa20ed03041e5406e52eccb2c6815f1
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=40.8.0
    Obtaining dependency information for setuptools>=40.8.0 from https://files.pythonhosted.org/packages/f7/29/13965af254e3373bceae8fb9a0e6ea0d0e571171b80d6646932131d6439b/setuptools-69.5.1-py3-none-any.whl.metadata
    Using cached setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB)
  Collecting wheel
    Obtaining dependency information for wheel from https://files.pythonhosted.org/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl.metadata
    Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
  Using cached setuptools-69.5.1-py3-none-any.whl (894 kB)
  Using cached wheel-0.43.0-py3-none-any.whl (65 kB)
  Installing collected packages: wheel, setuptools
  Successfully installed setuptools-69.5.1 wheel-0.43.0

  [notice] A new release of pip is available: 23.2.1 -> 24.0
  [notice] To update, run: pip install --upgrade pip
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Collecting pkgconfig
    Obtaining dependency information for pkgconfig from https://files.pythonhosted.org/packages/32/af/89487c7bbf433f4079044f3dc32f9a9f887597fe04614a37a292e373e16b/pkgconfig-1.5.5-py3-none-any.whl.metadata
    Using cached pkgconfig-1.5.5-py3-none-any.whl.metadata (4.0 kB)
  Collecting cffi>=1.0.0
    Obtaining dependency information for cffi>=1.0.0 from https://files.pythonhosted.org/packages/95/c8/ce05a6cba2bec12d4b28285e66c53cc88dd7385b102dea7231da3b74cfef/cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata
    Using cached cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata (1.5 kB)
  Collecting pycparser (from cffi>=1.0.0)
    Obtaining dependency information for pycparser from https://files.pythonhosted.org/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl.metadata
    Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
  Using cached pkgconfig-1.5.5-py3-none-any.whl (6.7 kB)
  Using cached cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl (182 kB)
  Using cached pycparser-2.22-py3-none-any.whl (117 kB)
  Installing collected packages: pycparser, pkgconfig, cffi
  Successfully installed cffi-1.16.0 pkgconfig-1.5.5 pycparser-2.22

  [notice] A new release of pip is available: 23.2.1 -> 24.0
  [notice] To update, run: pip install --upgrade pip
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-hk2ev6vn/pyvips.egg-info
  writing /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-hk2ev6vn/pyvips.egg-info/PKG-INFO
  writing dependency_links to /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-hk2ev6vn/pyvips.egg-info/dependency_links.txt
  writing requirements to /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-hk2ev6vn/pyvips.egg-info/requires.txt
  writing top-level names to /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-hk2ev6vn/pyvips.egg-info/top_level.txt
  writing manifest file '/private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-hk2ev6vn/pyvips.egg-info/SOURCES.txt'
  reading manifest file '/private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-hk2ev6vn/pyvips.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE.txt'
  writing manifest file '/private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-hk2ev6vn/pyvips.egg-info/SOURCES.txt'
  creating '/private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-hk2ev6vn/pyvips-2.2.3.dist-info'
  Preparing metadata (pyproject.toml) ... done
Collecting cffi>=1.0.0 (from pyvips@ git+https://github.com/libvips/pyvips.git)
  Obtaining dependency information for cffi>=1.0.0 from https://files.pythonhosted.org/packages/95/c8/ce05a6cba2bec12d4b28285e66c53cc88dd7385b102dea7231da3b74cfef/cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata
  Using cached cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata (1.5 kB)
Collecting pkgconfig (from pyvips@ git+https://github.com/libvips/pyvips.git)
  Obtaining dependency information for pkgconfig from https://files.pythonhosted.org/packages/32/af/89487c7bbf433f4079044f3dc32f9a9f887597fe04614a37a292e373e16b/pkgconfig-1.5.5-py3-none-any.whl.metadata
  Using cached pkgconfig-1.5.5-py3-none-any.whl.metadata (4.0 kB)
Collecting pycparser (from cffi>=1.0.0->pyvips@ git+https://github.com/libvips/pyvips.git)
  Obtaining dependency information for pycparser from https://files.pythonhosted.org/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl.metadata
  Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Using cached cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl (182 kB)
Using cached pkgconfig-1.5.5-py3-none-any.whl (6.7 kB)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Building wheels for collected packages: pyvips
  Running command Building wheel for pyvips (pyproject.toml)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-14.2-x86_64-cpython-311
  creating build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vinterpolate.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/enums.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vsourcecustom.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/version.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vobject.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/error.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vtargetcustom.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vregion.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/__init__.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vimage.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vdecls.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/gvalue.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/voperation.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vtarget.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/pyvips_build.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/gobject.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/base.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vsource.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vconnection.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  running build_ext
  generating cffi module 'build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c'
  creating build/temp.macosx-14.2-x86_64-cpython-311
  building '_libvips' extension
  creating build/temp.macosx-14.2-x86_64-cpython-311/build
  creating build/temp.macosx-14.2-x86_64-cpython-311/build/temp.macosx-14.2-x86_64-cpython-311
  clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -DHWY_SHARED_DEFINE -I/usr/local/Cellar/libarchive/3.7.3/include -I/usr/local/Cellar/vips/8.15.2_1/include -I/usr/local/Cellar/fftw/3.3.10_1/include -I/usr/local/Cellar/cfitsio/4.4.0/include -I/usr/local/Cellar/libimagequant/4.3.0/include -I/usr/local/Cellar/cgif/0.4.0/include -I/usr/local/Cellar/libexif/0.6.24/include -I/usr/local/Cellar/libspng/0.7.4/include -I/usr/local/Cellar/webp/1.4.0/include -I/usr/local/Cellar/webp/1.4.0/include/webp -I/usr/local/Cellar/pango/1.52.2/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/8.4.0/include/harfbuzz -I/usr/local/Cellar/pango/1.52.2/include/pango-1.0 -I/usr/local/Cellar/fribidi/1.0.13/include/fribidi -I/usr/local/Cellar/harfbuzz/8.4.0/include/harfbuzz -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/librsvg/2.58.0/include/librsvg-2.0 -I/usr/local/Cellar/gdk-pixbuf/2.42.11/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/libtiff/4.6.0/include -I/usr/local/opt/zstd/include -I/usr/local/Cellar/xz/5.4.6/include -I/usr/local/Cellar/jpeg-turbo/3.0.2/include -I/usr/local/Cellar/cairo/1.18.0/include/cairo -I/usr/local/Cellar/fontconfig/2.15.0/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/opt/libpng/include/libpng16 -I/usr/local/Cellar/libxext/1.3.6/include -I/usr/local/Cellar/libxrender/0.9.11/include -I/usr/local/Cellar/libx11/1.8.9/include -I/usr/local/Cellar/libxcb/1.17.0/include -I/usr/local/Cellar/libxau/1.0.11/include -I/usr/local/Cellar/libxdmcp/1.1.5/include -I/usr/local/Cellar/pixman/0.42.2/include/pixman-1 -I/usr/local/Cellar/libmatio/1.5.27/include -I/usr/local/opt/hdf5/include -I/usr/local/Cellar/little-cms2/2.16/include -I/usr/local/Cellar/openexr/3.2.4/include -I/usr/local/Cellar/openexr/3.2.4/include/OpenEXR -I/usr/local/Cellar/imath/3.1.11/include -I/usr/local/Cellar/imath/3.1.11/include/Imath -I/usr/local/Cellar/openjpeg/2.5.2/include/openjpeg-2.5 -I/usr/local/Cellar/highway/1.1.0/include -I/usr/local/Cellar/glib/2.80.0_2/include -I/usr/local/Cellar/glib/2.80.0_2/include/glib-2.0 -I/usr/local/Cellar/glib/2.80.0_2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.43/include -I/usr/local/Cellar/xorgproto/2024.1/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/ffi -I/Users/dan/.pyenv/versions/3.11.7/include/python3.11 -c build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c -o build/temp.macosx-14.2-x86_64-cpython-311/build/temp.macosx-14.2-x86_64-cpython-311/_libvips.o
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:5712:28: error: incompatible function pointer types passing 'void *(*)(uint64_t, void *, void *)' (aka 'void *(*)(unsigned long long, void *, void *)') to parameter of type 'VipsTypeMap2Fn' (aka 'void *(*)(unsigned long, void *, void *)') [-Wincompatible-function-pointer-types]
    return vips_type_map(x0, x1, x2, x3);
                             ^~
  /usr/local/Cellar/vips/8.15.2_1/include/vips/object.h:676:48: note: passing argument to parameter 'fn' here
  void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b);
                                                 ^
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:5762:32: error: incompatible function pointer types passing 'void *(*)(uint64_t, void *, void *)' (aka 'void *(*)(unsigned long long, void *, void *)') to parameter of type 'VipsTypeMap2Fn' (aka 'void *(*)(unsigned long, void *, void *)') [-Wincompatible-function-pointer-types]
    { result = vips_type_map(x0, x1, x2, x3); }
                                 ^~
  /usr/local/Cellar/vips/8.15.2_1/include/vips/object.h:676:48: note: passing argument to parameter 'fn' here
  void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b);
                                                 ^
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:6364:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
    { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
                    ^     ~~~~~~~~~~~~~~~~
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:6388:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
    { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
                    ^     ~~~~~~~~~~~~~~~~
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:6450:15: warning: incompatible pointer types initializing 'uint64_t (*)[2]' (aka 'unsigned long long (*)[2]') with an expression of type 'union (unnamed union at /usr/local/Cellar/glib/2.80.0_2/include/glib-2.0/gobject/gvalue.h:119:3) (*)[2]' [-Wincompatible-pointer-types]
    { uint64_t(*tmp)[2] = &p->data; (void)tmp; }
                ^         ~~~~~~~~
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:6520:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'VipsArgumentTable **' (aka 'struct _GHashTable **') [-Wincompatible-pointer-types]
    { void * *tmp = &p->argument_table; (void)tmp; }
              ^     ~~~~~~~~~~~~~~~~~~
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:6550:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'GTimer **' (aka 'struct _GTimer **') [-Wincompatible-pointer-types]
    { void * *tmp = &p->start; (void)tmp; }
              ^     ~~~~~~~~~
  5 warnings and 2 errors generated.
  error: command '/usr/bin/clang' failed with exit code 1
  error: subprocess-exited-with-error
  
  × Building wheel for pyvips (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /Users/dan/.pyenv/versions/3.11.7/bin/python3.11 /Users/dan/.pyenv/versions/3.11.7/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/tmp68vazula
  cwd: /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-install-fwl4w4_r/pyvips_8a1628e406b44d30846bd26676461ff7
  Building wheel for pyvips (pyproject.toml) ... error
  ERROR: Failed building wheel for pyvips
Failed to build pyvips
ERROR: Could not build wheels for pyvips, which is required to install pyproject.toml-based projects

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
(.venv) ~/S/livingthing (master↑7|✚1175) [1] $ pip install --upgrade pip
Requirement already satisfied: pip in /Users/dan/.pyenv/versions/3.11.7/lib/python3.11/site-packages (23.2.1)
Collecting pip
  Obtaining dependency information for pip from https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl.metadata
  Downloading pip-24.0-py3-none-any.whl.metadata (3.6 kB)
Using cached pip-24.0-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 23.2.1
    Uninstalling pip-23.2.1:
      Successfully uninstalled pip-23.2.1
Successfully installed pip-24.0
(.venv) ~/S/livingthing (master↑7|✚1175) $ CC=clang pip3 install "pyvips @
 git+https://github.com/libvips/pyvips.git" -v --break-system-packages
Using pip 24.0 from /Users/dan/.pyenv/versions/3.11.7/lib/python3.11/site-packages/pip (python 3.11)
Collecting pyvips@ git+https://github.com/libvips/pyvips.git
  Cloning https://github.com/libvips/pyvips.git to /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-install-sd07luld/pyvips_ff37cfdc56944133934dcd969469cb69
  Running command git version
  git version 2.44.0
  Running command git clone --filter=blob:none https://github.com/libvips/pyvips.git /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-install-sd07luld/pyvips_ff37cfdc56944133934dcd969469cb69
  Cloning into '/private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-install-sd07luld/pyvips_ff37cfdc56944133934dcd969469cb69'...
  Running command git rev-parse HEAD
  9c7e151eafa20ed03041e5406e52eccb2c6815f1
  Resolved https://github.com/libvips/pyvips.git to commit 9c7e151eafa20ed03041e5406e52eccb2c6815f1
  Running command git rev-parse HEAD
  9c7e151eafa20ed03041e5406e52eccb2c6815f1
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=40.8.0
    Using cached setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB)
  Using cached setuptools-69.5.1-py3-none-any.whl (894 kB)
  Installing collected packages: setuptools
  Successfully installed setuptools-69.5.1
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Collecting pkgconfig
    Using cached pkgconfig-1.5.5-py3-none-any.whl.metadata (4.0 kB)
  Collecting wheel
    Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
  Collecting cffi>=1.0.0
    Downloading cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata (1.5 kB)
  Collecting pycparser (from cffi>=1.0.0)
    Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
  Using cached pkgconfig-1.5.5-py3-none-any.whl (6.7 kB)
  Using cached wheel-0.43.0-py3-none-any.whl (65 kB)
  Downloading cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl (182 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 182.4/182.4 kB 2.8 MB/s eta 0:00:00
  Using cached pycparser-2.22-py3-none-any.whl (117 kB)
  Installing collected packages: wheel, pycparser, pkgconfig, cffi
  Successfully installed cffi-1.16.0 pkgconfig-1.5.5 pycparser-2.22 wheel-0.43.0
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-lwsj54m0/pyvips.egg-info
  writing /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-lwsj54m0/pyvips.egg-info/PKG-INFO
  writing dependency_links to /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-lwsj54m0/pyvips.egg-info/dependency_links.txt
  writing requirements to /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-lwsj54m0/pyvips.egg-info/requires.txt
  writing top-level names to /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-lwsj54m0/pyvips.egg-info/top_level.txt
  writing manifest file '/private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-lwsj54m0/pyvips.egg-info/SOURCES.txt'
  reading manifest file '/private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-lwsj54m0/pyvips.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE.txt'
  writing manifest file '/private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-lwsj54m0/pyvips.egg-info/SOURCES.txt'
  creating '/private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-modern-metadata-lwsj54m0/pyvips-2.2.3.dist-info'
  Preparing metadata (pyproject.toml) ... done
Collecting cffi>=1.0.0 (from pyvips@ git+https://github.com/libvips/pyvips.git)
  Obtaining dependency information for cffi>=1.0.0 from https://files.pythonhosted.org/packages/95/c8/ce05a6cba2bec12d4b28285e66c53cc88dd7385b102dea7231da3b74cfef/cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata
  Using cached cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata (1.5 kB)
Collecting pkgconfig (from pyvips@ git+https://github.com/libvips/pyvips.git)
  Obtaining dependency information for pkgconfig from https://files.pythonhosted.org/packages/32/af/89487c7bbf433f4079044f3dc32f9a9f887597fe04614a37a292e373e16b/pkgconfig-1.5.5-py3-none-any.whl.metadata
  Using cached pkgconfig-1.5.5-py3-none-any.whl.metadata (4.0 kB)
Collecting pycparser (from cffi>=1.0.0->pyvips@ git+https://github.com/libvips/pyvips.git)
  Obtaining dependency information for pycparser from https://files.pythonhosted.org/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl.metadata
  Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Using cached cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl (182 kB)
Using cached pkgconfig-1.5.5-py3-none-any.whl (6.7 kB)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Building wheels for collected packages: pyvips
  Running command Building wheel for pyvips (pyproject.toml)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-14.2-x86_64-cpython-311
  creating build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vinterpolate.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/enums.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vsourcecustom.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/version.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vobject.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/error.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vtargetcustom.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vregion.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/__init__.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vimage.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vdecls.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/gvalue.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/voperation.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vtarget.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/pyvips_build.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/gobject.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/base.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vsource.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  copying pyvips/vconnection.py -> build/lib.macosx-14.2-x86_64-cpython-311/pyvips
  running build_ext
  generating cffi module 'build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c'
  creating build/temp.macosx-14.2-x86_64-cpython-311
  building '_libvips' extension
  creating build/temp.macosx-14.2-x86_64-cpython-311/build
  creating build/temp.macosx-14.2-x86_64-cpython-311/build/temp.macosx-14.2-x86_64-cpython-311
  clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -DHWY_SHARED_DEFINE -I/usr/local/Cellar/libarchive/3.7.3/include -I/usr/local/Cellar/vips/8.15.2_1/include -I/usr/local/Cellar/fftw/3.3.10_1/include -I/usr/local/Cellar/cfitsio/4.4.0/include -I/usr/local/Cellar/libimagequant/4.3.0/include -I/usr/local/Cellar/cgif/0.4.0/include -I/usr/local/Cellar/libexif/0.6.24/include -I/usr/local/Cellar/libspng/0.7.4/include -I/usr/local/Cellar/webp/1.4.0/include -I/usr/local/Cellar/webp/1.4.0/include/webp -I/usr/local/Cellar/pango/1.52.2/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/8.4.0/include/harfbuzz -I/usr/local/Cellar/pango/1.52.2/include/pango-1.0 -I/usr/local/Cellar/fribidi/1.0.13/include/fribidi -I/usr/local/Cellar/harfbuzz/8.4.0/include/harfbuzz -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/librsvg/2.58.0/include/librsvg-2.0 -I/usr/local/Cellar/gdk-pixbuf/2.42.11/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/libtiff/4.6.0/include -I/usr/local/opt/zstd/include -I/usr/local/Cellar/xz/5.4.6/include -I/usr/local/Cellar/jpeg-turbo/3.0.2/include -I/usr/local/Cellar/cairo/1.18.0/include/cairo -I/usr/local/Cellar/fontconfig/2.15.0/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/opt/libpng/include/libpng16 -I/usr/local/Cellar/libxext/1.3.6/include -I/usr/local/Cellar/libxrender/0.9.11/include -I/usr/local/Cellar/libx11/1.8.9/include -I/usr/local/Cellar/libxcb/1.17.0/include -I/usr/local/Cellar/libxau/1.0.11/include -I/usr/local/Cellar/libxdmcp/1.1.5/include -I/usr/local/Cellar/pixman/0.42.2/include/pixman-1 -I/usr/local/Cellar/libmatio/1.5.27/include -I/usr/local/opt/hdf5/include -I/usr/local/Cellar/little-cms2/2.16/include -I/usr/local/Cellar/openexr/3.2.4/include -I/usr/local/Cellar/openexr/3.2.4/include/OpenEXR -I/usr/local/Cellar/imath/3.1.11/include -I/usr/local/Cellar/imath/3.1.11/include/Imath -I/usr/local/Cellar/openjpeg/2.5.2/include/openjpeg-2.5 -I/usr/local/Cellar/highway/1.1.0/include -I/usr/local/Cellar/glib/2.80.0_2/include -I/usr/local/Cellar/glib/2.80.0_2/include/glib-2.0 -I/usr/local/Cellar/glib/2.80.0_2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.43/include -I/usr/local/Cellar/xorgproto/2024.1/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/ffi -I/Users/dan/.pyenv/versions/3.11.7/include/python3.11 -c build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c -o build/temp.macosx-14.2-x86_64-cpython-311/build/temp.macosx-14.2-x86_64-cpython-311/_libvips.o
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:5712:28: error: incompatible function pointer types passing 'void *(*)(uint64_t, void *, void *)' (aka 'void *(*)(unsigned long long, void *, void *)') to parameter of type 'VipsTypeMap2Fn' (aka 'void *(*)(unsigned long, void *, void *)') [-Wincompatible-function-pointer-types]
    return vips_type_map(x0, x1, x2, x3);
                             ^~
  /usr/local/Cellar/vips/8.15.2_1/include/vips/object.h:676:48: note: passing argument to parameter 'fn' here
  void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b);
                                                 ^
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:5762:32: error: incompatible function pointer types passing 'void *(*)(uint64_t, void *, void *)' (aka 'void *(*)(unsigned long long, void *, void *)') to parameter of type 'VipsTypeMap2Fn' (aka 'void *(*)(unsigned long, void *, void *)') [-Wincompatible-function-pointer-types]
    { result = vips_type_map(x0, x1, x2, x3); }
                                 ^~
  /usr/local/Cellar/vips/8.15.2_1/include/vips/object.h:676:48: note: passing argument to parameter 'fn' here
  void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b);
                                                 ^
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:6364:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
    { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
                    ^     ~~~~~~~~~~~~~~~~
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:6388:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
    { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
                    ^     ~~~~~~~~~~~~~~~~
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:6450:15: warning: incompatible pointer types initializing 'uint64_t (*)[2]' (aka 'unsigned long long (*)[2]') with an expression of type 'union (unnamed union at /usr/local/Cellar/glib/2.80.0_2/include/glib-2.0/gobject/gvalue.h:119:3) (*)[2]' [-Wincompatible-pointer-types]
    { uint64_t(*tmp)[2] = &p->data; (void)tmp; }
                ^         ~~~~~~~~
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:6520:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'VipsArgumentTable **' (aka 'struct _GHashTable **') [-Wincompatible-pointer-types]
    { void * *tmp = &p->argument_table; (void)tmp; }
              ^     ~~~~~~~~~~~~~~~~~~
  build/temp.macosx-14.2-x86_64-cpython-311/_libvips.c:6550:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'GTimer **' (aka 'struct _GTimer **') [-Wincompatible-pointer-types]
    { void * *tmp = &p->start; (void)tmp; }
              ^     ~~~~~~~~~
  5 warnings and 2 errors generated.
  error: command '/usr/bin/clang' failed with exit code 1
  error: subprocess-exited-with-error
  
  × Building wheel for pyvips (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /Users/dan/.pyenv/versions/3.11.7/bin/python3.11 /Users/dan/.pyenv/versions/3.11.7/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/tmp3emdgz47
  cwd: /private/var/folders/52/6m51fzvn70523vrdbn755szm012kmn/T/pip-install-sd07luld/pyvips_ff37cfdc56944133934dcd969469cb69
  Building wheel for pyvips (pyproject.toml) ... error
  ERROR: Failed building wheel for pyvips
Failed to build pyvips
ERROR: Could not build wheels for pyvips, which is required to install pyproject.toml-based projects

@danmackinlay
Copy link

danmackinlay commented Apr 22, 2024

And one from an M1 mac, Sonoma 14.2.1

longer ARM error ```text $ CC=clang pip3 install "pyvips @ git+https://github.c om/libvips/pyvips.git" -v --break-system-packages Using pip 23.3.1 from /Users/dan/Source/livingthing/.venv/lib/python3.12/site-packages/pip (python 3.12) Collecting pyvips@ git+https://github.com/libvips/pyvips.git Cloning https://github.com/libvips/pyvips.git to /private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-install-no9rqown/pyvips_e2923bff2536472ab6acf11fb9b93c36 Running command git version git version 2.39.3 (Apple Git-146) Running command git clone --filter=blob:none https://github.com/libvips/pyvips.git /private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-install-no9rqown/pyvips_e2923bff2536472ab6acf11fb9b93c36 Cloning into '/private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-install-no9rqown/pyvips_e2923bff2536472ab6acf11fb9b93c36'... warning: templates not found in /Users/dan/.git_template Running command git rev-parse HEAD 9c7e151 Resolved https://github.com/libvips/pyvips.git to commit 9c7e151 Running command git rev-parse HEAD 9c7e151 Running command pip subprocess to install build dependencies Collecting setuptools>=40.8.0 Using cached setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB) Collecting wheel Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB) Using cached setuptools-69.5.1-py3-none-any.whl (894 kB) Using cached wheel-0.43.0-py3-none-any.whl (65 kB) Installing collected packages: wheel, setuptools Successfully installed setuptools-69.5.1 wheel-0.43.0

[notice] A new release of pip is available: 23.3.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
Installing build dependencies ... done
Running command Getting requirements to build wheel
Getting requirements to build wheel ... done
Running command pip subprocess to install backend dependencies
Collecting cffi>=1.0.0
Using cached cffi-1.16.0-cp312-cp312-macosx_11_0_arm64.whl.metadata (1.5 kB)
Collecting pkgconfig
Using cached pkgconfig-1.5.5-py3-none-any.whl.metadata (4.0 kB)
Collecting pycparser (from cffi>=1.0.0)
Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Using cached cffi-1.16.0-cp312-cp312-macosx_11_0_arm64.whl (177 kB)
Using cached pkgconfig-1.5.5-py3-none-any.whl (6.7 kB)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Installing collected packages: pycparser, pkgconfig, cffi
Successfully installed cffi-1.16.0 pkgconfig-1.5.5 pycparser-2.22

[notice] A new release of pip is available: 23.3.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
Installing backend dependencies ... done
Running command Preparing metadata (pyproject.toml)
running dist_info
creating /private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-modern-metadata-_ng4k5r4/pyvips.egg-info
writing /private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-modern-metadata-_ng4k5r4/pyvips.egg-info/PKG-INFO
writing dependency_links to /private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-modern-metadata-_ng4k5r4/pyvips.egg-info/dependency_links.txt
writing requirements to /private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-modern-metadata-_ng4k5r4/pyvips.egg-info/requires.txt
writing top-level names to /private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-modern-metadata-_ng4k5r4/pyvips.egg-info/top_level.txt
writing manifest file '/private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-modern-metadata-_ng4k5r4/pyvips.egg-info/SOURCES.txt'
reading manifest file '/private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-modern-metadata-_ng4k5r4/pyvips.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file '/private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-modern-metadata-_ng4k5r4/pyvips.egg-info/SOURCES.txt'
creating '/private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-modern-metadata-_ng4k5r4/pyvips-2.2.3.dist-info'
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: cffi>=1.0.0 in ./.venv/lib/python3.12/site-packages (from pyvips@ git+https://github.com/libvips/pyvips.git) (1.16.0)
Requirement already satisfied: pkgconfig in ./.venv/lib/python3.12/site-packages (from pyvips@ git+https://github.com/libvips/pyvips.git) (1.5.5)
Requirement already satisfied: pycparser in ./.venv/lib/python3.12/site-packages (from cffi>=1.0.0->pyvips@ git+https://github.com/libvips/pyvips.git) (2.22)
Building wheels for collected packages: pyvips
Running command Building wheel for pyvips (pyproject.toml)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-14.0-arm64-cpython-312
creating build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/vinterpolate.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/enums.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/vsourcecustom.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/version.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/vobject.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/error.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/vtargetcustom.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/vregion.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/init.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/vimage.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/vdecls.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/gvalue.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/voperation.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/vtarget.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/pyvips_build.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/gobject.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/base.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/vsource.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
copying pyvips/vconnection.py -> build/lib.macosx-14.0-arm64-cpython-312/pyvips
running build_ext
generating cffi module 'build/temp.macosx-14.0-arm64-cpython-312/_libvips.c'
creating build/temp.macosx-14.0-arm64-cpython-312
building '_libvips' extension
creating build/temp.macosx-14.0-arm64-cpython-312/build
creating build/temp.macosx-14.0-arm64-cpython-312/build/temp.macosx-14.0-arm64-cpython-312
clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -DHWY_SHARED_DEFINE -I/opt/homebrew/Cellar/libarchive/3.7.3/include -I/opt/homebrew/Cellar/vips/8.15.2_1/include -I/opt/homebrew/Cellar/fftw/3.3.10_1/include -I/opt/homebrew/Cellar/cfitsio/4.4.0/include -I/opt/homebrew/Cellar/libimagequant/4.3.0/include -I/opt/homebrew/Cellar/cgif/0.4.0/include -I/opt/homebrew/Cellar/libexif/0.6.24/include -I/opt/homebrew/Cellar/libspng/0.7.4/include -I/opt/homebrew/Cellar/webp/1.4.0/include -I/opt/homebrew/Cellar/webp/1.4.0/include/webp -I/opt/homebrew/Cellar/pango/1.52.2/include/pango-1.0 -I/opt/homebrew/Cellar/harfbuzz/8.4.0/include/harfbuzz -I/opt/homebrew/Cellar/pango/1.52.2/include/pango-1.0 -I/opt/homebrew/Cellar/fribidi/1.0.13/include/fribidi -I/opt/homebrew/Cellar/harfbuzz/8.4.0/include/harfbuzz -I/opt/homebrew/Cellar/graphite2/1.3.14/include -I/opt/homebrew/Cellar/librsvg/2.58.0/include/librsvg-2.0 -I/opt/homebrew/Cellar/gdk-pixbuf/2.42.11/include/gdk-pixbuf-2.0 -I/opt/homebrew/Cellar/libtiff/4.6.0/include -I/opt/homebrew/opt/zstd/include -I/opt/homebrew/Cellar/xz/5.4.6/include -I/opt/homebrew/Cellar/jpeg-turbo/3.0.2/include -I/opt/homebrew/Cellar/cairo/1.18.0/include/cairo -I/opt/homebrew/Cellar/fontconfig/2.15.0/include -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/opt/libpng/include/libpng16 -I/opt/homebrew/Cellar/libxext/1.3.6/include -I/opt/homebrew/Cellar/libxrender/0.9.11/include -I/opt/homebrew/Cellar/libx11/1.8.9/include -I/opt/homebrew/Cellar/libxcb/1.17.0/include -I/opt/homebrew/Cellar/libxau/1.0.11/include -I/opt/homebrew/Cellar/libxdmcp/1.1.5/include -I/opt/homebrew/Cellar/pixman/0.42.2/include/pixman-1 -I/opt/homebrew/Cellar/libmatio/1.5.27/include -I/opt/homebrew/opt/hdf5/include -I/opt/homebrew/Cellar/little-cms2/2.16/include -I/opt/homebrew/Cellar/openexr/3.2.4/include -I/opt/homebrew/Cellar/openexr/3.2.4/include/OpenEXR -I/opt/homebrew/Cellar/imath/3.1.11/include -I/opt/homebrew/Cellar/imath/3.1.11/include/Imath -I/opt/homebrew/Cellar/openjpeg/2.5.2/include/openjpeg-2.5 -I/opt/homebrew/Cellar/highway/1.1.0/include -I/opt/homebrew/Cellar/glib/2.80.0_2/include -I/opt/homebrew/Cellar/glib/2.80.0_2/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.80.0_2/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.43/include -I/opt/homebrew/Cellar/xorgproto/2024.1/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -I/Users/dan/Source/livingthing/.venv/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c build/temp.macosx-14.0-arm64-cpython-312/_libvips.c -o build/temp.macosx-14.0-arm64-cpython-312/build/temp.macosx-14.0-arm64-cpython-312/_libvips.o
build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:5712:28: error: incompatible function pointer types passing 'void ()(uint64_t, void *, void *)' (aka 'void ()(unsigned long long, void *, void *)') to parameter of type 'VipsTypeMap2Fn' (aka 'void ()(unsigned long, void *, void *)') [-Wincompatible-function-pointer-types]
return vips_type_map(x0, x1, x2, x3);
^~
/opt/homebrew/Cellar/vips/8.15.2_1/include/vips/object.h:676:48: note: passing argument to parameter 'fn' here
void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b);
^
build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:5762:32: error: incompatible function pointer types passing 'void ()(uint64_t, void *, void *)' (aka 'void ()(unsigned long long, void *, void *)') to parameter of type 'VipsTypeMap2Fn' (aka 'void ()(unsigned long, void *, void *)') [-Wincompatible-function-pointer-types]
{ result = vips_type_map(x0, x1, x2, x3); }
^~
/opt/homebrew/Cellar/vips/8.15.2_1/include/vips/object.h:676:48: note: passing argument to parameter 'fn' here
void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b);
^
build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:6364:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
{ GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
^ ~~~~~~~~~~~~~~~~
build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:6388:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass ' (aka 'struct _GTypeClass ') [-Wincompatible-pointer-types]
{ GTypeClass * tmp = &p->g_type_class; (void)tmp; }
^ ~~~~~~~~~~~~~~~~
build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:6450:15: warning: incompatible pointer types initializing 'uint64_t (
)[2]' (aka 'unsigned long long (
)[2]') with an expression of type 'union (unnamed union at /opt/homebrew/Cellar/glib/2.80.0_2/include/glib-2.0/gobject/gvalue.h:119:3) (
)[2]' [-Wincompatible-pointer-types]
{ uint64_t(*tmp)[2] = &p->data; (void)tmp; }
^ ~~~~~~~~
build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:6520:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'VipsArgumentTable **' (aka 'struct _GHashTable **') [-Wincompatible-pointer-types]
{ void * *tmp = &p->argument_table; (void)tmp; }
^ ~~~~~~~~~~~~~~~~~~
build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:6550:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'GTimer **' (aka 'struct _GTimer **') [-Wincompatible-pointer-types]
{ void * *tmp = &p->start; (void)tmp; }
^ ~~~~~~~~~
5 warnings and 2 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
error: subprocess-exited-with-error

× Building wheel for pyvips (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /Users/dan/Source/livingthing/.venv/bin/python /Users/dan/Source/livingthing/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/tmpmxo9z6_g
cwd: /private/var/folders/5f/p21r0s2n7r75v17t052n_2km0000gp/T/pip-install-no9rqown/pyvips_e2923bff2536472ab6acf11fb9b93c36
Building wheel for pyvips (pyproject.toml) ... error
ERROR: Failed building wheel for pyvips
Failed to build pyvips
ERROR: Could not build wheels for pyvips, which is required to install pyproject.toml-based projects

[notice] A new release of pip is available: 23.3.1 -> 24.0
[notice] To update, run: pip install --upgrade pip

</details>

kleisauke added a commit to kleisauke/pyvips that referenced this issue Apr 22, 2024
This appears redundant, as these types and functions originate from
`vips/vips.h` in API mode.

Resolves: libvips#459.
@kleisauke
Copy link
Member

kleisauke commented Apr 22, 2024

Thanks for these error logs. It looks like uint64_t from CFFI internally doesn't align with uint64_t from stdint.h on macOS (unsigned long versus unsigned long long).

typedef uint64_t guint64;

I just opened PR #463 #464 for this.

@kleisauke kleisauke reopened this Apr 22, 2024
kleisauke added a commit to kleisauke/pyvips that referenced this issue Apr 22, 2024
@pasqualesalza
Copy link

I can confirm that @kleisauke's edit makes the build successful on my macOS 14.4.1!

@WeisiminPeng-Simmi
Copy link

WeisiminPeng-Simmi commented Apr 25, 2024

Maybe it help. I think I have the same issue. Error I got

.....
build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:6433:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
        { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
                        ^     ~~~~~~~~~~~~~~~~
      build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:6457:19: warning: incompatible pointer types initializing 'GTypeClass **' (aka 'struct _GTypeClass **') with an expression of type 'GTypeClass *' (aka 'struct _GTypeClass *') [-Wincompatible-pointer-types]
        { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
                        ^     ~~~~~~~~~~~~~~~~
      build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:6519:15: warning: incompatible pointer types initializing 'uint64_t (*)[2]' (aka 'unsigned long long (*)[2]') with an expression of type 'union (unnamed union at /opt/homebrew/Cellar/glib/2.80.0_2/include/glib-2.0/gobject/gvalue.h:119:3) (*)[2]' [-Wincompatible-pointer-types]
        { uint64_t(*tmp)[2] = &p->data; (void)tmp; }
                    ^         ~~~~~~~~
      build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:6589:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'VipsArgumentTable **' (aka 'struct _GHashTable **') [-Wincompatible-pointer-types]
        { void * *tmp = &p->argument_table; (void)tmp; }
                  ^     ~~~~~~~~~~~~~~~~~~
      build/temp.macosx-14.0-arm64-cpython-312/_libvips.c:6619:13: warning: incompatible pointer types initializing 'void **' with an expression of type 'GTimer **' (aka 'struct _GTimer **') [-Wincompatible-pointer-types]
        { void * *tmp = &p->start; (void)tmp; }
                  ^     ~~~~~~~~~
      5 warnings and 4 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyvips
  Running setup.py clean for pyvips
Failed to build pyvips
ERROR: Could not build wheels for pyvips, which is required to install pyproject.toml-based projects

I am using macOS Sonoma 14.4.1, vips-8.15.2, Python 3.11.9 before. I got this error after I upgraded my Python to 3.12.

jcupitt pushed a commit that referenced this issue Apr 28, 2024
@jcupitt
Copy link
Member

jcupitt commented Apr 28, 2024

I just pushed 2.2.3 to pyvips that includes Kleis's fix, so this might be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants