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

Collection Python requirements can no longer be installed on Mac ARM due to upstream uamqp dependency #1511

Open
gygitlab opened this issue Mar 25, 2024 · 3 comments
Labels
dependencies Pull requests that update a dependency file hold The problem holds for a particular reason medium_priority Medium priority work in In trying to solve, or in working with contributors

Comments

@gygitlab
Copy link

gygitlab commented Mar 25, 2024

SUMMARY

This is very closely related to #1505 but it is subtly different.

On up to date Mac systems a new build issue has appeared with the uamqp Python package, which is an upstream dependency of azure-iot-hub. There appears to be a guttural C build issue now with the latest versions on Mac that prevents building the package outright on any Python version.

Like the above issue the best course here is likely to remove azure-iot-hub as a requirement as it's a stale library that requires azure-uamqp-python, which is no longer in active development.

An issue on the azure-uamqp-python tracker has also been raised.

      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/libpq/include -I./src/vendor/inc -I./src/vendor/azure-uamqp-c/deps/azure-macro-utils-c/inc -I./src/vendor/azure-uamqp-c/deps/umock-c/inc -I./src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/pal/inc -I./src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/inc -I./src/vendor/azure-uamqp-c/inc -I./src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/pal/linux -I/Users/user/.asdf/installs/python/3.11.2/include/python3.11 -c uamqp/c_uamqp.c -o build/temp.macosx-13.2-arm64-cpython-311/uamqp/c_uamqp.o -g -O0 -std=gnu99 -fPIC
      uamqp/c_uamqp.c:10837:69: warning: incompatible pointer types passing 'PyObject *' (aka 'struct _object *') to parameter of type 'STRING_HANDLE' (aka 'struct STRING_TAG *') [-Wincompatible-pointer-types]
          __pyx_t_6 = ((STRING_concat_with_STRING(__pyx_v_self->_c_value, __pyx_t_1) != 0) != 0);
                                                                          ^~~~~~~~~
      ./src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/inc/azure_c_shared_utility/strings.h:31:87: note: passing argument to parameter 's2' here
      MOCKABLE_FUNCTION(, int, STRING_concat_with_STRING, STRING_HANDLE, s1, STRING_HANDLE, s2);
                                                                                            ^
      uamqp/c_uamqp.c:17140:8: warning: passing 'const char *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        free(__pyx_v_as_string);
             ^~~~~~~~~~~~~~~~~
      /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:56:37: note: passing argument to parameter here
      void  free(void * __unsafe_indexable);
                                          ^
      uamqp/c_uamqp.c:18588:74: warning: incompatible pointer types passing 'int *' to parameter of type 'bool *' [-Wincompatible-pointer-types]
        __pyx_t_5 = ((amqpvalue_get_boolean(__pyx_v_self->__pyx_base._c_value, (&__pyx_v__value)) == 0) != 0);
                                                                               ^~~~~~~~~~~~~~~~~
      ./src/vendor/azure-uamqp-c/inc/azure_uamqp_c/amqpvalue.h:34:79: note: passing argument to parameter 'bool_value' here
          MOCKABLE_FUNCTION(, int, amqpvalue_get_boolean, AMQP_VALUE, value, bool*, bool_value);
                                                                                    ^
      uamqp/c_uamqp.c:41712:24: warning: cast to 'void *' from smaller integer type 'unsigned int' [-Wint-to-void-pointer-cast]
              __pyx_t_1 = ((((void *)__pyx_v_status_code) != NULL) != 0);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:44042:20: warning: cast to 'void *' from smaller integer type 'uint32_t' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
          __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                         ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:44303:20: warning: cast to 'void *' from smaller integer type 'uint16_t' (aka 'unsigned short') [-Wint-to-void-pointer-cast]
          __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                         ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:44564:20: warning: cast to 'void *' from smaller integer type 'milliseconds' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
          __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                         ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:45081:20: warning: cast to 'void *' from smaller integer type 'uint32_t' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
          __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                         ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:48549:20: warning: cast to 'void *' from smaller integer type 'uint32_t' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
          __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                         ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:48797:20: warning: cast to 'void *' from smaller integer type 'milliseconds' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
          __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                         ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:49035:60: warning: incompatible pointer types passing 'int *' to parameter of type 'bool *' [-Wincompatible-pointer-types]
        __pyx_t_1 = ((header_get_durable(__pyx_v_self->_c_value, (&__pyx_v__value)) == 0) != 0);
                                                                 ^~~~~~~~~~~~~~~~~
      ./src/vendor/azure-uamqp-c/inc/azure_uamqp_c/amqp_definitions_header.h:33:80: note: passing argument to parameter 'durable_value' here
          MOCKABLE_FUNCTION(, int, header_get_durable, HEADER_HANDLE, header, bool*, durable_value);
                                                                                     ^
      uamqp/c_uamqp.c:49045:20: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
          __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                         ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:49283:67: warning: incompatible pointer types passing 'int *' to parameter of type 'bool *' [-Wincompatible-pointer-types]
        __pyx_t_1 = ((header_get_first_acquirer(__pyx_v_self->_c_value, (&__pyx_v__value)) == 0) != 0);
                                                                        ^~~~~~~~~~~~~~~~~
      ./src/vendor/azure-uamqp-c/inc/azure_uamqp_c/amqp_definitions_header.h:39:87: note: passing argument to parameter 'first_acquirer_value' here
          MOCKABLE_FUNCTION(, int, header_get_first_acquirer, HEADER_HANDLE, header, bool*, first_acquirer_value);
                                                                                            ^
      uamqp/c_uamqp.c:49293:20: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
          __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                         ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:49541:20: warning: cast to 'void *' from smaller integer type 'uint8_t' (aka 'unsigned char') [-Wint-to-void-pointer-cast]
          __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                         ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:65557:146: error: incompatible function pointer types passing 'void (void *, enum MESSAGE_RECEIVER_STATE_TAG, enum MESSAGE_RECEIVER_STATE_TAG)' to parameter of type 'ON_MESSAGE_RECEIVER_STATE_CHANGED' (aka 'void (*)(const void *, enum MESSAGE_RECEIVER_STATE_TAG, enum MESSAGE_RECEIVER_STATE_TAG)') [-Wincompatible-function-pointer-types]
        __pyx_t_1 = ((struct __pyx_vtabstruct_5uamqp_7c_uamqp_cMessageReceiver *)__pyx_v_receiver->__pyx_vtab)->create(__pyx_v_receiver, __pyx_v_link, __pyx_f_5uamqp_7c_uamqp_on_message_receiver_state_changed, ((void *)__pyx_v_callback_context)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 23, __pyx_L1_error)
                                                                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:71932:138: warning: passing 'const IO_INTERFACE_DESCRIPTION *' (aka 'const struct IO_INTERFACE_DESCRIPTION_TAG *') to parameter of type 'IO_INTERFACE_DESCRIPTION *' (aka 'struct IO_INTERFACE_DESCRIPTION_TAG *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_2 = ((struct __pyx_vtabstruct_5uamqp_7c_uamqp_IOInterfaceDescription *)__pyx_v_interface->__pyx_vtab)->wrap(__pyx_v_interface, __pyx_v_io_desc); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 50, __pyx_L1_error)
                                                                                                                                               ^~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:74194:64: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_1 = ((properties_get_subject(__pyx_v_self->_c_value, (&__pyx_v__value)) == 0) != 0);
                                                                     ^~~~~~~~~~~~~~~~~
      ./src/vendor/azure-uamqp-c/inc/azure_uamqp_c/amqp_definitions_properties.h:39:99: note: passing argument to parameter 'subject_value' here
          MOCKABLE_FUNCTION(, int, properties_get_subject, PROPERTIES_HANDLE, properties, const char**, subject_value);
                                                                                                        ^
      uamqp/c_uamqp.c:75046:69: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_1 = ((properties_get_content_type(__pyx_v_self->_c_value, (&__pyx_v__value)) == 0) != 0);
                                                                          ^~~~~~~~~~~~~~~~~
      ./src/vendor/azure-uamqp-c/inc/azure_uamqp_c/amqp_definitions_properties.h:45:104: note: passing argument to parameter 'content_type_value' here
          MOCKABLE_FUNCTION(, int, properties_get_content_type, PROPERTIES_HANDLE, properties, const char**, content_type_value);
                                                                                                             ^
      uamqp/c_uamqp.c:75294:73: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_1 = ((properties_get_content_encoding(__pyx_v_self->_c_value, (&__pyx_v__value)) == 0) != 0);
                                                                              ^~~~~~~~~~~~~~~~~
      ./src/vendor/azure-uamqp-c/inc/azure_uamqp_c/amqp_definitions_properties.h:47:108: note: passing argument to parameter 'content_encoding_value' here
          MOCKABLE_FUNCTION(, int, properties_get_content_encoding, PROPERTIES_HANDLE, properties, const char**, content_encoding_value);
                                                                                                                 ^
      uamqp/c_uamqp.c:76296:20: warning: cast to 'void *' from smaller integer type 'sequence_no' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
          __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                         ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:76534:74: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_1 = ((properties_get_reply_to_group_id(__pyx_v_self->_c_value, (&__pyx_v__value)) == 0) != 0);
                                                                               ^~~~~~~~~~~~~~~~~
      ./src/vendor/azure-uamqp-c/inc/azure_uamqp_c/amqp_definitions_properties.h:57:109: note: passing argument to parameter 'reply_to_group_id_value' here
          MOCKABLE_FUNCTION(, int, properties_get_reply_to_group_id, PROPERTIES_HANDLE, properties, const char**, reply_to_group_id_value);
                                                                                                                  ^
      uamqp/c_uamqp.c:76934:139: warning: passing 'const SASL_MECHANISM_INTERFACE_DESCRIPTION *' (aka 'const struct SASL_MECHANISM_INTERFACE_TAG *') to parameter of type 'SASL_MECHANISM_INTERFACE_DESCRIPTION *' (aka 'struct SASL_MECHANISM_INTERFACE_TAG *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_2 = ((struct __pyx_vtabstruct_5uamqp_7c_uamqp_SASLMechanismInterfaceDescription *)__pyx_v_desc->__pyx_vtab)->wrap(__pyx_v_desc, __pyx_v_interface); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 24, __pyx_L1_error)
                                                                                                                                                ^~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:77037:19: warning: assigning to 'SASL_MECHANISM_INTERFACE_DESCRIPTION *' (aka 'struct SASL_MECHANISM_INTERFACE_TAG *') from 'const SASL_MECHANISM_INTERFACE_DESCRIPTION *' (aka 'const struct SASL_MECHANISM_INTERFACE_TAG *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_v_io_desc = saslanonymous_get_interface();
                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:77193:19: warning: assigning to 'SASL_MECHANISM_INTERFACE_DESCRIPTION *' (aka 'struct SASL_MECHANISM_INTERFACE_TAG *') from 'const SASL_MECHANISM_INTERFACE_DESCRIPTION *' (aka 'const struct SASL_MECHANISM_INTERFACE_TAG *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_v_io_desc = saslplain_get_interface();
                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:83617:18: warning: cast to 'void *' from smaller integer type 'terminus_durability' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
        __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                       ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:84131:18: warning: cast to 'void *' from smaller integer type 'seconds' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
        __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                       ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:84343:60: warning: incompatible pointer types passing 'int *' to parameter of type 'bool *' [-Wincompatible-pointer-types]
        __pyx_t_1 = ((source_get_dynamic(__pyx_v_self->_c_value, (&__pyx_v__value)) != 0) != 0);
                                                                 ^~~~~~~~~~~~~~~~~
      ./src/vendor/azure-uamqp-c/inc/azure_uamqp_c/amqp_definitions_source.h:41:80: note: passing argument to parameter 'dynamic_value' here
          MOCKABLE_FUNCTION(, int, source_get_dynamic, SOURCE_HANDLE, source, bool*, dynamic_value);
                                                                                     ^
      uamqp/c_uamqp.c:84388:18: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
        __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                       ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:86663:18: warning: cast to 'void *' from smaller integer type 'terminus_durability' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
        __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                       ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:87177:18: warning: cast to 'void *' from smaller integer type 'seconds' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
        __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                       ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:87389:60: warning: incompatible pointer types passing 'int *' to parameter of type 'bool *' [-Wincompatible-pointer-types]
        __pyx_t_1 = ((target_get_dynamic(__pyx_v_self->_c_value, (&__pyx_v__value)) != 0) != 0);
                                                                 ^~~~~~~~~~~~~~~~~
      ./src/vendor/azure-uamqp-c/inc/azure_uamqp_c/amqp_definitions_target.h:41:80: note: passing argument to parameter 'dynamic_value' here
          MOCKABLE_FUNCTION(, int, target_get_dynamic, TARGET_HANDLE, target, bool*, dynamic_value);
                                                                                     ^
      uamqp/c_uamqp.c:87434:18: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
        __pyx_t_1 = ((((void *)__pyx_v__value) == NULL) != 0);
                       ^~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:90457:109: warning: passing 'const IO_INTERFACE_DESCRIPTION *' (aka 'const struct IO_INTERFACE_DESCRIPTION_TAG *') to parameter of type 'IO_INTERFACE_DESCRIPTION *' (aka 'struct IO_INTERFACE_DESCRIPTION_TAG *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_1 = ((struct __pyx_vtabstruct_5uamqp_7c_uamqp_XIO *)__pyx_v_xio->__pyx_vtab)->create(__pyx_v_xio, __pyx_v_ws_io_interface, ((PyObject *)__pyx_v_io_config), (&__pyx_v_io_config->_c_value)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 23, __pyx_L1_error)
                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:90791:109: warning: passing 'const IO_INTERFACE_DESCRIPTION *' (aka 'const struct IO_INTERFACE_DESCRIPTION_TAG *') to parameter of type 'IO_INTERFACE_DESCRIPTION *' (aka 'struct IO_INTERFACE_DESCRIPTION_TAG *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_2 = ((struct __pyx_vtabstruct_5uamqp_7c_uamqp_XIO *)__pyx_v_xio->__pyx_vtab)->create(__pyx_v_xio, __pyx_v_interface, ((PyObject *)__pyx_v_io_config), (&__pyx_v_io_config->_c_value)); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 39, __pyx_L1_error)
                                                                                                                  ^~~~~~~~~~~~~~~~~
      uamqp/c_uamqp.c:111209:3: warning: unused label 'bad' [-Wunused-label]
        bad:
        ^~~~
      35 warnings and 1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
@haaranenjarmo
Copy link

I have same problem.

@Fred-sun Fred-sun added has_pr PR fixes have been made medium_priority Medium priority labels Mar 26, 2024
@Fred-sun Fred-sun added work in In trying to solve, or in working with contributors dependencies Pull requests that update a dependency file and removed has_pr PR fixes have been made labels Apr 11, 2024
@miguelmgl
Copy link

UAMQP Package Version: 1.6.9
Operating System: Sonoma 14.4.1
Python Version: 3.11.6
M2

It is possible to build with this flag:
CFLAGS="-Wno-error=incompatible-function-pointer-types" pip install uamqp==1.6.9

Not sure if there are side effects, but I only require to install uampq as a dependency of azure-iot-hub, and it doesn't seems to affect the functionality I need.

With Python 3.12 this workaround doesn't work.

@marwa-ayaz
Copy link

UAMQP Package Version: 1.6.9 Operating System: Sonoma 14.4.1 Python Version: 3.11.6 M2

It is possible to build with this flag: CFLAGS="-Wno-error=incompatible-function-pointer-types" pip install uamqp==1.6.9

Not sure if there are side effects, but I only require to install uampq as a dependency of azure-iot-hub, and it doesn't seems to affect the functionality I need.

With Python 3.12 this workaround doesn't work.

Thanks

@Fred-sun Fred-sun added the hold The problem holds for a particular reason label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file hold The problem holds for a particular reason medium_priority Medium priority work in In trying to solve, or in working with contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants