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

setup.py bdist_egg build fails because it doesn't build the c library first #82

Open
marshallpierce opened this issue Apr 7, 2016 · 2 comments

Comments

@marshallpierce
Copy link

curl -O https://pypi.python.org/packages/source/l/librabbitmq/librabbitmq-1.6.1.tar.gz#md5=716f05388d4747ea605c1a31f8541e3b
tar xzf librabbitmq*
cd librabbitmq-1.6.1
python setup.py bdist_egg

fails with

running bdist_egg
running egg_info
writing requirements to librabbitmq.egg-info/requires.txt
writing librabbitmq.egg-info/PKG-INFO
writing top-level names to librabbitmq.egg-info/top_level.txt
writing dependency_links to librabbitmq.egg-info/dependency_links.txt
reading manifest file 'librabbitmq.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'tests'
no previously-included directories found matching '*.pyc'
no previously-included directories found matching '*.o'
no previously-included directories found matching '*.la'
no previously-included directories found matching '*.so'
no previously-included directories found matching '*.dylib'
writing manifest file 'librabbitmq.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/funtests
copying funtests/setup.py -> build/lib.linux-x86_64-2.7/funtests
copying funtests/__init__.py -> build/lib.linux-x86_64-2.7/funtests
copying funtests/config.py -> build/lib.linux-x86_64-2.7/funtests
copying funtests/disabled_basic_get_leak.py -> build/lib.linux-x86_64-2.7/funtests
creating build/lib.linux-x86_64-2.7/librabbitmq
copying librabbitmq/__init__.py -> build/lib.linux-x86_64-2.7/librabbitmq
creating build/lib.linux-x86_64-2.7/funtests/tests
copying funtests/tests/test_channel_errors.py -> build/lib.linux-x86_64-2.7/funtests/tests
copying funtests/tests/__init__.py -> build/lib.linux-x86_64-2.7/funtests/tests
creating build/lib.linux-x86_64-2.7/librabbitmq/tests
copying librabbitmq/tests/__init__.py -> build/lib.linux-x86_64-2.7/librabbitmq/tests
copying librabbitmq/tests/test_functional.py -> build/lib.linux-x86_64-2.7/librabbitmq/tests
running build_ext
building '_librabbitmq' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/Modules
creating build/temp.linux-x86_64-2.7/Modules/_librabbitmq
creating build/temp.linux-x86_64-2.7/clib
creating build/temp.linux-x86_64-2.7/clib/librabbitmq
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Iclib/librabbitmq -Iclib -I/usr/include/python2.7 -c Modules/_librabbitmq/connection.c -o build/temp.linux-x86_64-2.7/Modules/_librabbitmq/connection.o
In file included from /usr/include/python2.7/Python.h:8:0,
                 from Modules/_librabbitmq/connection.h:4,
                 from Modules/_librabbitmq/connection.c:11:
/usr/include/python2.7/pyconfig.h:1188:0: warning: "_POSIX_C_SOURCE" redefined
 #define _POSIX_C_SOURCE 200112L
 ^
In file included from /usr/include/stdlib.h:24:0,
                 from Modules/_librabbitmq/connection.c:1:
/usr/include/features.h:225:0: note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L
 ^
Modules/_librabbitmq/connection.c:719:26: warning: ‘PyDict_ToAMQTable’ is static but used in inline function ‘PyDict_to_basic_properties’ which is not static
         props->headers = PyDict_ToAMQTable(conn, value, pool);
                          ^
Modules/_librabbitmq/connection.c:496:17: warning: ‘AMQTable_toPyDict’ is static but used in inline function ‘basic_properties_to_PyDict’ which is not static
         value = AMQTable_toPyDict(&(props->headers));
                 ^
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Iclib/librabbitmq -Iclib -I/usr/include/python2.7 -c clib/librabbitmq/amqp_api.c -o build/temp.linux-x86_64-2.7/clib/librabbitmq/amqp_api.o
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Iclib/librabbitmq -Iclib -I/usr/include/python2.7 -c clib/librabbitmq/amqp_connection.c -o build/temp.linux-x86_64-2.7/clib/librabbitmq/amqp_connection.o
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Iclib/librabbitmq -Iclib -I/usr/include/python2.7 -c clib/librabbitmq/amqp_consumer.c -o build/temp.linux-x86_64-2.7/clib/librabbitmq/amqp_consumer.o
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Iclib/librabbitmq -Iclib -I/usr/include/python2.7 -c clib/librabbitmq/amqp_framing.c -o build/temp.linux-x86_64-2.7/clib/librabbitmq/amqp_framing.o
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Iclib/librabbitmq -Iclib -I/usr/include/python2.7 -c clib/librabbitmq/amqp_hostcheck.c -o build/temp.linux-x86_64-2.7/clib/librabbitmq/amqp_hostcheck.o
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Iclib/librabbitmq -Iclib -I/usr/include/python2.7 -c clib/librabbitmq/amqp_mem.c -o build/temp.linux-x86_64-2.7/clib/librabbitmq/amqp_mem.o
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Iclib/librabbitmq -Iclib -I/usr/include/python2.7 -c clib/librabbitmq/amqp_socket.c -o build/temp.linux-x86_64-2.7/clib/librabbitmq/amqp_socket.o
clib/librabbitmq/amqp_socket.c: In function ‘amqp_login_inner’:
clib/librabbitmq/amqp_socket.c:1195:28: error: ‘AMQ_PLATFORM’ undeclared (first use in this function)
         amqp_cstring_bytes(AMQ_PLATFORM);
                            ^
clib/librabbitmq/amqp_socket.c:1195:28: note: each undeclared identifier is reported only once for each function it appears in
error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1

Note that this log doesn't show it building the c lib or doing codegen. However, if we instead run python setup.py build first, it builds the c library and does its codegen, and then a subsequent bdist_egg will work. I'm new to python's setuptools, but it seems like bdist_egg should take care of building everything like build does.

@auvipy
Copy link
Member

auvipy commented Aug 6, 2016

I will take care of this.

@andir
Copy link

andir commented Jan 8, 2021

Was there ever a solution for this? I just ran into the same issue when installing librabbitmq via pip.

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

3 participants