unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.46k stars 691 forks source link

Problems with greenlet support with asyncio config #2066

Open trbabb opened 5 years ago

trbabb commented 5 years ago

Hi,

I'm having trouble getting asyncio support working. Hopefully this is just a simple build/misconfiguration issue on my part, but I'd appreciate any pointers!

When I run

 uwsgi --asyncio 20 --greenlet

I get

ImportError: PyCapsule_Import could not import module "greenlet"

and

uwsgi --asyncio 20

by itself complains *** DANGER *** asyncio mode without coroutine/greenthread engine loaded !!!

I've built uwsgi with this command:

 LDFLAGS="-L/PATH/TO/venv/lib -L/usr/local/opt/openssl/lib" UWSGI_PROFILE="asyncio" CFLAGS="-I/PATH/TO/venv/include/site/python3.6 -I/usr/local/opt/openssl/include" UWSGI_PROFILE_OVERRIDE=ssl=true pip3 -vvv install uwsgi --no-binary :all: --no-cache-dir

It is worth pointing out that I am building on OSX 10.14.3, and the python environment (as you might guess from the build command above) is a virtualenv.

Some relevant snippets from the build (I can provide more, if it would be useful):

    using profile: buildconf/asyncio.ini
    detected include path: ['/opt/local/include', '/usr/local/include', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/include', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include', '/usr/include', '/System/Library/Frameworks', '/Library/Frameworks']
    Patching "bin_name" to properly install_scripts dir
    detected CPU cores: 12
    configured CFLAGS: -O2 -I. -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/PATH/TO/venv/include/site/python3.6 -I/usr/local/opt/openssl/include -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-format -Wno-format-security -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -mmacosx-version-min=10.5 -DUWSGI_LOCK_USE_OSX_SPINLOCK -DUWSGI_EVENT_USE_KQUEUE -DUWSGI_EVENT_TIMER_USE_KQUEUE -DUWSGI_EVENT_FILEMONITOR_USE_KQUEUE -I/usr/local/Cellar/pcre/8.43/include -DUWSGI_PCRE -DUWSGI_ROUTING -DUWSGI_UUID -DUWSGI_VERSION="\"2.0.18\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="18" -DUWSGI_VERSION_REVISION="0" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_SSL -DUWSGI_XML -DUWSGI_XML_EXPAT -DUWSGI_PLUGIN_DIR="\".\"" -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(asyncio);UDEP(greenlet);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(corerouter);UDEP(fastrouter);UDEP(http);UDEP(signal);UDEP(syslog);UDEP(rsyslog);UDEP(logsocket);UDEP(router_uwsgi);UDEP(router_redirect);UDEP(router_basicauth);UDEP(zergpool);UDEP(redislog);UDEP(mongodblog);UDEP(router_rewrite);UDEP(router_http);UDEP(logfile);UDEP(router_cache);UDEP(rawrouter);UDEP(router_static);UDEP(sslrouter);UDEP(spooler);UDEP(cheaper_busyness);UDEP(symcall);UDEP(transformation_tofile);UDEP(transformation_gzip);UDEP(transformation_chunked);UDEP(transformation_offload);UDEP(router_memcached);UDEP(router_redis);UDEP(router_hash);UDEP(router_expires);UDEP(router_metrics);UDEP(transformation_template);UDEP(stats_pusher_socket);" -DUWSGI_LOAD_EMBEDDED_PLUGINS="ULEP(python);ULEP(asyncio);ULEP(greenlet);ULEP(ping);ULEP(cache);ULEP(nagios);ULEP(rrdtool);ULEP(carbon);ULEP(rpc);ULEP(corerouter);ULEP(fastrouter);ULEP(http);ULEP(signal);ULEP(syslog);ULEP(rsyslog);ULEP(logsocket);ULEP(router_uwsgi);ULEP(router_redirect);ULEP(router_basicauth);ULEP(zergpool);ULEP(redislog);ULEP(mongodblog);ULEP(router_rewrite);ULEP(router_http);ULEP(logfile);ULEP(router_cache);ULEP(rawrouter);ULEP(router_static);ULEP(sslrouter);ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);"
    *** uWSGI compiling server core ***

[ ... snip ... ]

    ################# uWSGI configuration #################

    kernel = Darwin
    execinfo = False
    ifaddrs = True
    locking = osx_spinlock
    event = kqueue
    timer = kqueue
    filemonitor = kqueue
    pcre = True
    routing = True
    capabilities = False
    yaml = embedded
    json = False
    ssl = True
    xml = expat
    debug = False
    plugin_dir = .
    zlib = True
    ucontext = False
    malloc = libc

    ############## end of uWSGI configuration #############
    total build time: 26 seconds
    *** uWSGI is ready, launch it with /PATH/TO/venv/bin/uwsgi ***

[snip]

Why does uwsgi report that greenlets are disabled? How do I enable them?

thanks!

SpootDev commented 4 years ago

pip3 install greenlet