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 at install librabbitmq Big Sur 11.2.2 #157

Open
fjrd12 opened this issue Mar 13, 2021 · 6 comments
Open

Error at install librabbitmq Big Sur 11.2.2 #157

fjrd12 opened this issue Mar 13, 2021 · 6 comments

Comments

@fjrd12
Copy link

fjrd12 commented Mar 13, 2021

Env:

MacOS BigSur 11.2.2
Python 3.7.5
I encounter the below issue, any idea?
$ pip install librabbitmq

error.txt

@thedrow
Copy link
Member

thedrow commented Mar 17, 2021

See #127, #121.
Do any of the workarounds work for you?

@tombroi
Copy link

tombroi commented Apr 21, 2021

No, the above workarounds doesn't help. Fails on MacOS BigSur 11.2.3 too

@aichao
Copy link

aichao commented Jun 20, 2021

Looking at the OP's error.txt, it appears that there are two compilation errors (same error, two places):

    .../Modules/_librabbitmq/connection.c:1359:13: error: implicit declaration of function 'amqp_simple_wait_frame_on_channel' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    .../Modules/_librabbitmq/connection.c:1385:22: error: implicit declaration of function 'amqp_simple_wait_frame_on_channel' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

which suggests that amqp_simple_wait_frame_on_channel is not declared in .../Modules/_librabbitmq/connection.c. A quick grep of the source tree reveals that amqp_simple_wait_frame_on_channel is declared in .../rabbitmq-c/librabbitmq/amqp_socket.h. However, simply including amqp_socket.h is problematic because it redefines some data structures included from amqp_tcp_socket.h. This in itself is a bit smelly, which is probably the reason why we are here in the first place. I have no idea why this issue has not surfaced on other platforms other than the fact that configure may have simply set the flags to only give the warning instead of pedantically turn the warning into an error.

A simple, hackish workaround is to declare amqp_simple_wait_frame_on_channel, as declared in amqp_socket.h, at the top of connection.c. This is performed on the source of librabbitmq downloaded from PyPI. That is, after downloading and unpacking librabbitmq-2.0.0 insert the following at the top of librabbitmq-2.0.0/Modules/_librabbitmq/connection.c (say at line 10 after #include <amqp_tcp_socket.h>):

    int
    amqp_simple_wait_frame_on_channel(amqp_connection_state_t state,
                                      amqp_channel_t channel,
                                      amqp_frame_t *decoded_frame);

Then, build and install from within the librabbitmq-2.0.0 directory:

$ python setup.py build
$ python setup.py install

This worked for me on macOS 11.4 (Big Sur) with Xcode 12.4 and its Command line Tools and Python 3.9.5 (version of python should not matter as others have suggested in related issues). In addition, I had to upgrade m4 to 1.4.19 and install the latest GNU autotools (autoconf, automake, and libtool) to configure and build properly (the powers-to-be in Cupertino are regressing to the Evil Empire in Redmond with every release of macOS). It appears that the OP did this already as his configure output appears clean.

Having said all this (sorry for being verbose), the real question for @thedrow and @ask is: what is the status of librabbitmq? From related issues it appears that it is abandoned and being replaced by py-amqp? From my original understanding, I thought py-amqp is a pure python implementation of a RabbitMQ client and is "slower" than librabbitmq. Has this been improved? @thedrow mentioned in #131 (April 2019):

We're replacing this library with a custom implementation in Celery 5.

Is this now in Celery 5.1.1 itself (i.e., not a part of a bundled dependency)? Is this now the default when the broker is set to amqp://?

Thank you in advance for any clarifying answers.

@Chandan-Baba
Copy link

this issue is also surfacing on mac os Monterey. so, any help?

@nsarussi
Copy link

@aichao your solution worked for me on OSX monterey. thanks.

@sbernatsky
Copy link

sbernatsky commented Jan 16, 2023

For me the following code has helped to solve "implicit declaration of function 'amqp_simple_wait_frame_on_channel'" error during librabbitmq installation:

export CFLAGS="-Wno-error=implicit-function-declaration"
pip install librabbitmq==2.0.0

This is for MacOS BigSur.

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

No branches or pull requests

7 participants