ironport / shrapnel

Shrapnel is a scalable, high-performance cooperative threading library for Python.
Other
219 stars 34 forks source link

Build fails on Ubuntu, MacOS #89

Open iapyeh opened 5 years ago

iapyeh commented 5 years ago

It seems to have problem when building with cython 0.29.10 (currently installed by pip3). "pip3 install coro" failed as well as build from source by "python3 setup.py build. Platform: Ubuntu and MacOS (10.14.5) Python: 3.7.3

vijaysharma136-git commented 5 years ago

I am also getting build issue while compiling with python3 (python3.5) Cython 0.29.10. while same code was working fine with Python2.7. i compare the log it found below difference cythoning coro/_coro.pyx to coro/_coro.c ---> Python 2.7 while in python3.x it show skipping 'coro/_coro.c' Cython extension (up-to-date) while look at the build command i found one difference in the build that "fno-strict-aliasing" is not getting popup within in Python3. not sure how it invoke in while using Pythion2. wanted to know from where gcc command get invoke with different parameter.

vijaysharma136-git commented 5 years ago

the complete Error logs as below:

user@user-OptiPlex-7010:~/PycharmProjects/sharpnel1.5/shrapnel-1.0.5$ python3 setup.py build detected NPN-capable OpenSSL running build running build_py file backdoor.py (for module backdoor) not found file coro_process.py (for module coro_process) not found file coro_unittest.py (for module coro_unittest) not found creating build creating build/lib.linux-x86_64-3.5 creating build/lib.linux-x86_64-3.5/coro copying coro/init.py -> build/lib.linux-x86_64-3.5/coro copying coro/read_stream.py -> build/lib.linux-x86_64-3.5/coro copying coro/tb.py -> build/lib.linux-x86_64-3.5/coro copying coro/print_profile.py -> build/lib.linux-x86_64-3.5/coro copying coro/signal_handler.py -> build/lib.linux-x86_64-3.5/coro copying coro/backdoor.py -> build/lib.linux-x86_64-3.5/coro copying coro/frontdoor.py -> build/lib.linux-x86_64-3.5/coro copying coro/optional.py -> build/lib.linux-x86_64-3.5/coro copying coro/profiler.py -> build/lib.linux-x86_64-3.5/coro creating build/lib.linux-x86_64-3.5/coro/ssl copying coro/ssl/init.py -> build/lib.linux-x86_64-3.5/coro/ssl creating build/lib.linux-x86_64-3.5/coro/dns copying coro/dns/reply.py -> build/lib.linux-x86_64-3.5/coro/dns copying coro/dns/exceptions.py -> build/lib.linux-x86_64-3.5/coro/dns copying coro/dns/cache.py -> build/lib.linux-x86_64-3.5/coro/dns copying coro/dns/init.py -> build/lib.linux-x86_64-3.5/coro/dns copying coro/dns/stub_resolver.py -> build/lib.linux-x86_64-3.5/coro/dns creating build/lib.linux-x86_64-3.5/coro/asn1 copying coro/asn1/init.py -> build/lib.linux-x86_64-3.5/coro/asn1 copying coro/asn1/data_file.py -> build/lib.linux-x86_64-3.5/coro/asn1 creating build/lib.linux-x86_64-3.5/coro/db copying coro/db/init.py -> build/lib.linux-x86_64-3.5/coro/db creating build/lib.linux-x86_64-3.5/coro/amqp copying coro/amqp/rpc.py -> build/lib.linux-x86_64-3.5/coro/amqp copying coro/amqp/amqp.py -> build/lib.linux-x86_64-3.5/coro/amqp copying coro/amqp/codegen.py -> build/lib.linux-x86_64-3.5/coro/amqp copying coro/amqp/init.py -> build/lib.linux-x86_64-3.5/coro/amqp copying coro/amqp/wire.py -> build/lib.linux-x86_64-3.5/coro/amqp copying coro/amqp/spec.py -> build/lib.linux-x86_64-3.5/coro/amqp creating build/lib.linux-x86_64-3.5/coro/clocks copying coro/clocks/init.py -> build/lib.linux-x86_64-3.5/coro/clocks creating build/lib.linux-x86_64-3.5/coro/http copying coro/http/json_rpc.py -> build/lib.linux-x86_64-3.5/coro/http copying coro/http/handlers.py -> build/lib.linux-x86_64-3.5/coro/http copying coro/http/protocol.py -> build/lib.linux-x86_64-3.5/coro/http copying coro/http/session_handler.py -> build/lib.linux-x86_64-3.5/coro/http copying coro/http/websocket.py -> build/lib.linux-x86_64-3.5/coro/http copying coro/http/client.py -> build/lib.linux-x86_64-3.5/coro/http copying coro/http/server.py -> build/lib.linux-x86_64-3.5/coro/http copying coro/http/init.py -> build/lib.linux-x86_64-3.5/coro/http copying coro/http/spdy.py -> build/lib.linux-x86_64-3.5/coro/http copying coro/http/http_date.py -> build/lib.linux-x86_64-3.5/coro/http creating build/lib.linux-x86_64-3.5/coro/log copying coro/log/init.py -> build/lib.linux-x86_64-3.5/coro/log copying coro/log/asn1.py -> build/lib.linux-x86_64-3.5/coro/log creating build/lib.linux-x86_64-3.5/coro/ssh copying coro/ssh/init.py -> build/lib.linux-x86_64-3.5/coro/ssh creating build/lib.linux-x86_64-3.5/coro/test copying coro/test/init.py -> build/lib.linux-x86_64-3.5/coro/test copying coro/test/coro_unittest.py -> build/lib.linux-x86_64-3.5/coro/test creating build/lib.linux-x86_64-3.5/coro/emulation copying coro/emulation/thread.py -> build/lib.linux-x86_64-3.5/coro/emulation copying coro/emulation/threading.py -> build/lib.linux-x86_64-3.5/coro/emulation copying coro/emulation/init.py -> build/lib.linux-x86_64-3.5/coro/emulation copying coro/emulation/socket.py -> build/lib.linux-x86_64-3.5/coro/emulation creating build/lib.linux-x86_64-3.5/coro/db/postgres copying coro/db/postgres/postgres.py -> build/lib.linux-x86_64-3.5/coro/db/postgres copying coro/db/postgres/init.py -> build/lib.linux-x86_64-3.5/coro/db/postgres creating build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/openssh_authorized_keys.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/key_storage.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/public_private_key.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/remote_host.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/openssh_key_formats.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/dss.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/static_key_storage.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/openssh_key_storage.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/openssh_known_hosts.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/rebuild.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys copying coro/ssh/keys/rsa.py -> build/lib.linux-x86_64-3.5/coro/ssh/keys creating build/lib.linux-x86_64-3.5/coro/ssh/cipher copying coro/ssh/cipher/des3_cbc.py -> build/lib.linux-x86_64-3.5/coro/ssh/cipher copying coro/ssh/cipher/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/cipher copying coro/ssh/cipher/none.py -> build/lib.linux-x86_64-3.5/coro/ssh/cipher copying coro/ssh/cipher/blowfish_cbc.py -> build/lib.linux-x86_64-3.5/coro/ssh/cipher creating build/lib.linux-x86_64-3.5/coro/ssh/scp copying coro/ssh/scp/core.py -> build/lib.linux-x86_64-3.5/coro/ssh/scp copying coro/ssh/scp/cli.py -> build/lib.linux-x86_64-3.5/coro/ssh/scp copying coro/ssh/scp/client.py -> build/lib.linux-x86_64-3.5/coro/ssh/scp copying coro/ssh/scp/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/scp creating build/lib.linux-x86_64-3.5/coro/ssh/wrapper copying coro/ssh/wrapper/coro_interactive_ssh_wrapper.py -> build/lib.linux-x86_64-3.5/coro/ssh/wrapper copying coro/ssh/wrapper/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/wrapper creating build/lib.linux-x86_64-3.5/coro/ssh/mac copying coro/ssh/mac/hmac_md5.py -> build/lib.linux-x86_64-3.5/coro/ssh/mac copying coro/ssh/mac/hmac.py -> build/lib.linux-x86_64-3.5/coro/ssh/mac copying coro/ssh/mac/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/mac copying coro/ssh/mac/none.py -> build/lib.linux-x86_64-3.5/coro/ssh/mac copying coro/ssh/mac/hmac_sha1.py -> build/lib.linux-x86_64-3.5/coro/ssh/mac creating build/lib.linux-x86_64-3.5/coro/ssh/util copying coro/ssh/util/mpint.py -> build/lib.linux-x86_64-3.5/coro/ssh/util copying coro/ssh/util/password.py -> build/lib.linux-x86_64-3.5/coro/ssh/util copying coro/ssh/util/debug.py -> build/lib.linux-x86_64-3.5/coro/ssh/util copying coro/ssh/util/random.py -> build/lib.linux-x86_64-3.5/coro/ssh/util copying coro/ssh/util/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/util copying coro/ssh/util/packet.py -> build/lib.linux-x86_64-3.5/coro/ssh/util creating build/lib.linux-x86_64-3.5/coro/ssh/transport copying coro/ssh/transport/client.py -> build/lib.linux-x86_64-3.5/coro/ssh/transport copying coro/ssh/transport/server.py -> build/lib.linux-x86_64-3.5/coro/ssh/transport copying coro/ssh/transport/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/transport copying coro/ssh/transport/transport.py -> build/lib.linux-x86_64-3.5/coro/ssh/transport copying coro/ssh/transport/constants.py -> build/lib.linux-x86_64-3.5/coro/ssh/transport creating build/lib.linux-x86_64-3.5/coro/ssh/connection copying coro/ssh/connection/tty_modes.py -> build/lib.linux-x86_64-3.5/coro/ssh/connection copying coro/ssh/connection/data_buffer.py -> build/lib.linux-x86_64-3.5/coro/ssh/connection copying coro/ssh/connection/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/connection copying coro/ssh/connection/channel.py -> build/lib.linux-x86_64-3.5/coro/ssh/connection copying coro/ssh/connection/connect.py -> build/lib.linux-x86_64-3.5/coro/ssh/connection copying coro/ssh/connection/interactive_session.py -> build/lib.linux-x86_64-3.5/coro/ssh/connection copying coro/ssh/connection/constants.py -> build/lib.linux-x86_64-3.5/coro/ssh/connection creating build/lib.linux-x86_64-3.5/coro/ssh/compression copying coro/ssh/compression/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/compression copying coro/ssh/compression/none.py -> build/lib.linux-x86_64-3.5/coro/ssh/compression creating build/lib.linux-x86_64-3.5/coro/ssh/l4_transport copying coro/ssh/l4_transport/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/l4_transport copying coro/ssh/l4_transport/coro_socket_transport.py -> build/lib.linux-x86_64-3.5/coro/ssh/l4_transport creating build/lib.linux-x86_64-3.5/coro/ssh/key_exchange copying coro/ssh/key_exchange/diffie_hellman.py -> build/lib.linux-x86_64-3.5/coro/ssh/key_exchange copying coro/ssh/key_exchange/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/key_exchange creating build/lib.linux-x86_64-3.5/coro/ssh/auth copying coro/ssh/auth/userauth.py -> build/lib.linux-x86_64-3.5/coro/ssh/auth copying coro/ssh/auth/init.py -> build/lib.linux-x86_64-3.5/coro/ssh/auth file backdoor.py (for module backdoor) not found file coro_process.py (for module coro_process) not found file coro_unittest.py (for module coro_unittest) not found running build_ext skipping 'coro/event_queue.cpp' Cython extension (up-to-date) building 'coro.event_queue' extension creating build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/coro x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c coro/event_queue.cpp -o build/temp.linux-x86_64-3.5/coro/event_queue.o cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/coro/event_queue.o -o build/lib.linux-x86_64-3.5/coro/event_queue.cpython-35m-x86_64-linux-gnu.so skipping 'coro/_coro.c' Cython extension (up-to-date) building 'coro._coro' extension x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/user/PycharmProjects/sharpnel1.5/shrapnel-1.0.5/. -I/home/user/PycharmProjects/sharpnel1.5/shrapnel-1.0.5/include -I/usr/include/python3.5m -c coro/_coro.c -o build/temp.linux-x86_64-3.5/coro/_coro.o -Wno-unused-function In file included from coro/_coro.c:615:0: /home/user/PycharmProjects/sharpnel1.5/shrapnel-1.0.5/include/pyrex_helpers.h: In function ‘cmp’: /home/user/PycharmProjects/sharpnel1.5/shrapnel-1.0.5/include/pyrex_helpers.h:69:8: warning: implicit declaration of function ‘PyObject_Cmp’ [-Wimplicit-function-declaration] if(PyObject_Cmp(o1, o2, &result)) { ^ /home/user/PycharmProjects/sharpnel1.5/shrapnel-1.0.5/include/pyrex_helpers.h: In function ‘minimal_ulonglong’: /home/user/PycharmProjects/sharpnel1.5/shrapnel-1.0.5/include/pyrex_helpers.h:204:17: warning: implicit declaration of function ‘PyInt_GetMax’ [-Wimplicit-function-declaration] if (value > PyInt_GetMax()) { ^ In file included from coro/_coro.c:616:0: /home/user/PycharmProjects/sharpnel1.5/shrapnel-1.0.5/include/tsc_time.h: In function ‘init_tsc_time_pointers’: /home/user/PycharmProjects/sharpnel1.5/shrapnel-1.0.5/include/tsc_time.h:134:23: warning: implicit declaration of function ‘PyCObject_AsVoidPtr’ [-Wimplicit-function-declaration] c_ptr = (void ) PyCObject_AsVoidPtr(c_obj); ^ /home/user/PycharmProjects/sharpnel1.5/shrapnel-1.0.5/include/tsc_time.h:134:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] c_ptr = (void ) PyCObject_AsVoidPtr(c_obj); ^ coro/_coro.c: In function ‘pyx_f_4coro_5_coro4coroyield’: coro/_coro.c:8227:15: error: ‘_PyThreadState_Current’ undeclared (first use in this function) pyx_t_3 = _PyThreadState_Current->frame; ^ coro/_coro.c:8227:15: note: each undeclared identifier is reported only once for each function it appears in coro/_coro.c: In function ‘pyx_f_4coro_5_coro_4coro_resume’: coro/_coro.c:8541:17: error: ‘_PyThreadState_Current’ undeclared (first use in this function) pyx_t_3 = _PyThreadState_Current->frame; ^ coro/_coro.c: In function ‘pyx_f_4coro_5_coro_4coro_save_exception_data’: coro/_coro.c:8819:15: error: ‘_PyThreadState_Current’ undeclared (first use in this function) pyx_t_1 = _PyThreadState_Current->curexc_type; ^ coro/_coro.c: In function ‘pyx_f_4coro_5_coro_4coro_restore_exception_data’: coro/_coro.c:8969:15: error: ‘_PyThreadState_Current’ undeclared (first use in this function) pyx_t_1 = _PyThreadState_Current->curexc_type; ^ coro/_coro.c: In function ‘pyx_pf_4coro_5_coro_4coro_24get_frame’: coro/_coro.c:10933:32: error: ‘_PyThreadState_Current’ undeclared (first use in this function) pyx_t_2 = void_as_object(_PyThreadState_Current->frame); if (unlikely(!pyx_t_2)) PYX_ERR(0, 609, __pyx_L1_error) ^ coro/_coro.c: In function ‘pyx_f_4coro_5_coro_info’: coro/_coro.c:60619:15: error: ‘_PyThreadState_Current’ undeclared (first use in this function) pyx_t_2 = _PyThreadState_Current->frame; ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

samrushing commented 5 years ago

Did you try the 'py3' branch? I think it requires a recent version, like 3.7+

vijaysharma136-git commented 5 years ago

Hi after try with 3.7 now i am getting Error

coro/ssl/openssl.c: In function ‘__Pyx_ExceptionReset’: coro/ssl/openssl.c:25681:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’ tmp_type = tstate->exc_type; ^ coro/ssl/openssl.c:25682:23: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’ tmp_value = tstate->exc_value; ^ coro/ssl/openssl.c:25683:20: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’ tmp_tb = tstate->exc_traceback; ^ coro/ssl/openssl.c:25684:11: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’ tstate->exc_type = type; ^ coro/ssl/openssl.c:25685:11: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’ tstate->exc_value = value; ^ coro/ssl/openssl.c:25686:11: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’ tstate->exc_traceback = tb; ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Process finished with exit code 1

samrushing commented 4 years ago

Did you try the 'py3' branch?