kivy / pyobjus

Access Objective-C classes from Python
https://pyobjus.readthedocs.io
MIT License
179 stars 47 forks source link

'objc_msgSend_stret' is unavailable: not available in arm64 #81

Closed rajeshmajumdar closed 2 years ago

rajeshmajumdar commented 2 years ago

I am trying to install pyobjus in my mac running big sur. I am getting this error while installing. Here is the error log:

Pyobjus platform is darwin running install running build running build_py creating build creating build/lib.macosx-10.9-universal2-3.10 creating build/lib.macosx-10.9-universal2-3.10/pyobjus copying pyobjus/dylib_manager.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus copying pyobjus/protocols.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus copying pyobjus/init.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus copying pyobjus/objc_py_types.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus creating build/lib.macosx-10.9-universal2-3.10/pyobjus/consts copying pyobjus/consts/init.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus/consts copying pyobjus/consts/corebluetooth.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus/consts running build_ext cythoning pyobjus/pyobjus.pyx to pyobjus/pyobjus.c /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/kirito/Downloads/pyobjus-master/pyobjus/pyobjus.pyx tree = Parsing.p_module(s, pxd, full_module_name) building 'pyobjus' extension creating build/temp.macosx-10.9-universal2-3.10 creating build/temp.macosx-10.9-universal2-3.10/pyobjus clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c pyobjus/pyobjus.c -o build/temp.macosx-10.9-universal2-3.10/pyobjus/pyobjus.o pyobjus/pyobjus.c:29384:18: warning: cast to smaller integer type 'int' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast] pyx_t_5 = ((int)(pyx_v_f_result[0])); ^~~~~~ pyobjus/pyobjus.c:29410:41: warning: cast to smaller integer type 'int' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast] pyx_t_3 = Pyx_PyInt_From_int(((int)(pyx_v_f_result[0]))); if (unlikely(!pyx_t_3)) PYX_ERR(4, 203, pyx_L1_error) ^~~~~~ pyobjus/pyobjus.c:29452:45: warning: cast to smaller integer type 'char' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast] pyx_t_2 = Pyx_PyInt_From_int(((int)((char)(pyx_v_f_result[0])))); if (unlikely(!pyx_t_2)) PYX_ERR(4, 204, pyx_L1_error) ^~~~~~~ pyobjus/pyobjus.c:29488:39: warning: cast to smaller integer type 'int' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast] pyx_t_4 = Pyx_PyInt_From_int(((int)(pyx_v_f_result[0]))); if (unlikely(!pyx_t_4)) PYX_ERR(4, 206, pyx_L1_error) ^~~~~~ pyobjus/pyobjus.c:29521:41: warning: cast to smaller integer type 'short' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast] pyx_t_4 = Pyx_PyInt_From_short(((short)(pyx_v_f_result[0]))); if (unlikely(!pyx_t_4)) PYX_ERR(4, 208, pyx_L1_error) ^~~~~~~~ pyobjus/pyobjus.c:29620:49: warning: cast to smaller integer type 'unsigned char' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast] pyx_t_4 = Pyx_PyInt_From_unsigned_char(((unsigned char)(pyx_v_f_result[0]))); if (unlikely(!pyx_t_4)) PYX_ERR(4, 214, pyx_L1_error) ^~~~~~~~ pyobjus/pyobjus.c:29653:48: warning: cast to smaller integer type 'unsigned int' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast] pyx_t_4 = Pyx_PyInt_From_unsigned_int(((unsigned int)(pyx_v_f_result[0]))); if (unlikely(!pyx_t_4)) PYX_ERR(4, 216, pyx_L1_error) ^~~~~~~~~~~ pyobjus/pyobjus.c:29686:50: warning: cast to smaller integer type 'unsigned short' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast] pyx_t_4 = Pyx_PyInt_From_unsigned_short(((unsigned short)(pyx_v_f_result[0]))); if (unlikely(!pyx_t_4)) PYX_ERR(4, 218, pyx_L1_error) ^~~~~~~~~ pyobjus/pyobjus.c:30030:19: warning: cast to smaller integer type 'int' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast] pyx_t_6 = (((int)(pyx_v_f_result[0])) != 0); ^~~~~~ pyobjus/pyobjus.c:43690:75: error: 'objc_msgSend_stret' is unavailable: not available in arm64 ffi_call((&__pyx_v_self->f_cif), ((void ()(void))((id ()(id, SEL))objc_msgSend_stret)), __pyx_v_res_ptr, __pyx_v_f_args); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/message.h:123:1: note: 'objc_msgSend_stret' has been explicitly marked unavailable here objc_msgSend_stret(void / id self, SEL op, ... */ ) ^ 9 warnings and 1 error generated. error: command '/usr/bin/clang' failed with exit code 1

misl6 commented 2 years ago

Hi @rajeshmajumdar,

If I'm right, you're on an M1 based device and using the latest version available on pypi.

Can you try to build the master version available here on GitHub?

rajeshmajumdar commented 2 years ago

Same error persists, and it's not m1 based it's intel based mac with latest version of pypi

misl6 commented 2 years ago

Is confirmed that while building a universal2 wheel on Intel, (that is now the default on python3.10), the reported error occurs during the arm64 crosscompilation phase.

misl6 commented 2 years ago

Hi, I posted a PR that should fix the issue (#82)

Let me know if it works fine for you.

rajeshmajumdar commented 2 years ago

Thanks @misl6, it worked.