2016-03-25 13 views
8

पर uwsgi स्थापित नहीं कर सकता मैं अपने अल्पाइन डोकर छवि में pip install uwsgi का उपयोग कर uwsgi स्थापित करने के लिए कोशिश कर रहा हूँ लेकिन दुर्भाग्य से यह मेरे लिए अजीब कोई वास्तविक त्रुटि संदेश में नाकाम रहने रखता है: इस कारण बन सकता है क्याअल्पाइन

Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-mEZegv/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-c7XA_e-record/install-record.txt --single-version-externally-managed --compile: 
    running install 
    using profile: buildconf/default.ini 
    detected include path: ['/usr/include/fortify', '/usr/include', '/usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/include'] 
    Patching "bin_name" to properly install_scripts dir 
    detected CPU cores: 1 
    configured CFLAGS: -O2 -I. -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -DUWSGI_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY -DUWSGI_VERSION="\"2.0.12\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="12" -DUWSGI_VERSION_REVISION="0" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_PLUGIN_DIR="\".\"" -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(gevent);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(corerouter);UDEP(fastrouter);UDEP(http);UDEP(ugreen);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(gevent);ULEP(ping);ULEP(cache);ULEP(nagios);ULEP(rrdtool);ULEP(carbon);ULEP(rpc);ULEP(corerouter);ULEP(fastrouter);ULEP(http);ULEP(ugreen);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);"core/utils.c: In function 'uwsgi_as_root': 
    core/utils.c:344:7: error: implicit declaration of function 'unshare' [-Werror=implicit-function-declaration] 
     if (unshare(uwsgi.unshare)) { 
     ^
    core/utils.c:564:5: error: implicit declaration of function 'sigfillset' [-Werror=implicit-function-declaration] 
     sigfillset(&smask); 
     ^
    core/utils.c:565:5: error: implicit declaration of function 'sigprocmask' [-Werror=implicit-function-declaration] 
     sigprocmask(SIG_BLOCK, &smask, NULL); 
     ^
    core/utils.c:565:17: error: 'SIG_BLOCK' undeclared (first use in this function) 
     sigprocmask(SIG_BLOCK, &smask, NULL); 
        ^
    core/utils.c:565:17: note: each undeclared identifier is reported only once for each function it appears in 
    core/utils.c:586:7: error: implicit declaration of function 'chroot' [-Werror=implicit-function-declaration] 
     if (chroot(uwsgi.chroot)) { 
     ^
    core/utils.c:791:5: error: unknown type name 'ushort' 
     ushort *array; 
     ^
    core/utils.c:833:8: error: implicit declaration of function 'setgroups' [-Werror=implicit-function-declaration] 
     if (setgroups(0, NULL)) { 
      ^
    core/utils.c:848:8: error: implicit declaration of function 'initgroups' [-Werror=implicit-function-declaration] 
     if (initgroups(uidname, uwsgi.gid)) { 
      ^
    core/utils.c: In function 'uwsgi_close_request': 
    core/utils.c:1145:18: error: 'WAIT_ANY' undeclared (first use in this function) 
     while (waitpid(WAIT_ANY, &waitpid_status, WNOHANG) > 0); 
        ^
    core/utils.c: In function 'uwsgi_resolve_ip': 
    core/utils.c:1802:7: error: implicit declaration of function 'gethostbyname' [-Werror=implicit-function-declaration] 
     he = gethostbyname(domain); 
     ^
    core/utils.c:1802:5: error: assignment makes pointer from integer without a cast [-Werror=int-conversion] 
     he = gethostbyname(domain); 
     ^
    core/utils.c: In function 'uwsgi_unix_signal': 
    core/utils.c:1936:19: error: storage size of 'sa' isn't known 
     struct sigaction sa; 
        ^
    core/utils.c:1938:24: error: invalid application of 'sizeof' to incomplete type 'struct sigaction' 
     memset(&sa, 0, sizeof(struct sigaction)); 
          ^
    core/utils.c:1942:2: error: implicit declaration of function 'sigemptyset' [-Werror=implicit-function-declaration] 
     sigemptyset(&sa.sa_mask); 
    ^
    core/utils.c:1944:6: error: implicit declaration of function 'sigaction' [-Werror=implicit-function-declaration] 
     if (sigaction(signum, &sa, NULL) < 0) { 
     ^
    core/utils.c:1936:19: error: unused variable 'sa' [-Werror=unused-variable] 
     struct sigaction sa; 
        ^
    In file included from core/utils.c:1:0: 
    core/utils.c: In function 'uwsgi_list_has_num': 
    ./uwsgi.h:140:47: error: implicit declaration of function 'strtok_r' [-Werror=implicit-function-declaration] 
    #define uwsgi_foreach_token(x, y, z, w) for(z=strtok_r(x, y, &w);z;z = strtok_r(NULL, y, &w)) 
               ^
    core/utils.c:1953:2: note: in expansion of macro 'uwsgi_foreach_token' 
     uwsgi_foreach_token(list2, ",", p, ctx) { 
    ^
    ./uwsgi.h:140:46: error: assignment makes pointer from integer without a cast [-Werror=int-conversion] 
    #define uwsgi_foreach_token(x, y, z, w) for(z=strtok_r(x, y, &w);z;z = strtok_r(NULL, y, &w)) 
               ^
    core/utils.c:1953:2: note: in expansion of macro 'uwsgi_foreach_token' 
     uwsgi_foreach_token(list2, ",", p, ctx) { 
    ^
    ./uwsgi.h:140:70: error: assignment makes pointer from integer without a cast [-Werror=int-conversion] 
    #define uwsgi_foreach_token(x, y, z, w) for(z=strtok_r(x, y, &w);z;z = strtok_r(NULL, y, &w)) 
                     ^
    core/utils.c:1953:2: note: in expansion of macro 'uwsgi_foreach_token' 
     uwsgi_foreach_token(list2, ",", p, ctx) { 
    ^
    core/utils.c: In function 'uwsgi_list_has_str': 
    ./uwsgi.h:140:46: error: assignment makes pointer from integer without a cast [-Werror=int-conversion] 
    #define uwsgi_foreach_token(x, y, z, w) for(z=strtok_r(x, y, &w);z;z = strtok_r(NULL, y, &w)) 
               ^
    core/utils.c:1968:2: note: in expansion of macro 'uwsgi_foreach_token' 
     uwsgi_foreach_token(list2, " ", p, ctx) { 
    ^
    ./uwsgi.h:140:70: error: assignment makes pointer from integer without a cast [-Werror=int-conversion] 
    #define uwsgi_foreach_token(x, y, z, w) for(z=strtok_r(x, y, &w);z;z = strtok_r(NULL, y, &w)) 
                     ^
    core/utils.c:1968:2: note: in expansion of macro 'uwsgi_foreach_token' 
     uwsgi_foreach_token(list2, " ", p, ctx) { 
    ^
    core/utils.c:1969:8: error: implicit declaration of function 'strcasecmp' [-Werror=implicit-function-declaration] 
     if (!strcasecmp(p, str)) { 
      ^
    core/utils.c: In function 'uwsgi_sig_pause': 
    core/utils.c:2361:2: error: implicit declaration of function 'sigsuspend' [-Werror=implicit-function-declaration] 
     sigsuspend(&mask); 
    ^
    core/utils.c: In function 'uwsgi_run_command_putenv_and_wait': 
    core/utils.c:2453:7: error: implicit declaration of function 'putenv' [-Werror=implicit-function-declaration] 
     if (putenv(envs[i])) { 
     ^
    In file included from core/utils.c:1:0: 
    core/utils.c: In function 'uwsgi_build_unshare': 
    ./uwsgi.h:140:46: error: assignment makes pointer from integer without a cast [-Werror=int-conversion] 
    #define uwsgi_foreach_token(x, y, z, w) for(z=strtok_r(x, y, &w);z;z = strtok_r(NULL, y, &w)) 
               ^
    core/utils.c:2855:2: note: in expansion of macro 'uwsgi_foreach_token' 
     uwsgi_foreach_token(list, ",", p, ctx) { 
    ^
    ./uwsgi.h:140:70: error: assignment makes pointer from integer without a cast [-Werror=int-conversion] 
    #define uwsgi_foreach_token(x, y, z, w) for(z=strtok_r(x, y, &w);z;z = strtok_r(NULL, y, &w)) 
                     ^
    core/utils.c:2855:2: note: in expansion of macro 'uwsgi_foreach_token' 
     uwsgi_foreach_token(list, ",", p, ctx) { 
    ^
    core/utils.c: In function 'uwsgi_tmpfd': 
    core/utils.c:3533:7: error: implicit declaration of function 'mkstemp' [-Werror=implicit-function-declaration] 
     fd = mkstemp(template); 
     ^
    core/utils.c: In function 'uwsgi_expand_path': 
    core/utils.c:3615:7: error: implicit declaration of function 'realpath' [-Werror=implicit-function-declaration] 
     if (!realpath(src, dst)) { 
     ^
    core/utils.c: In function 'uwsgi_set_cpu_affinity': 
    core/utils.c:3641:3: error: unknown type name 'cpu_set_t' 
     cpu_set_t cpuset; 
    ^
    core/utils.c:3646:3: error: implicit declaration of function 'CPU_ZERO' [-Werror=implicit-function-declaration] 
     CPU_ZERO(&cpuset); 
    ^
    core/utils.c:3651:4: error: implicit declaration of function 'CPU_SET' [-Werror=implicit-function-declaration] 
     CPU_SET(base_cpu, &cpuset); 
     ^
    core/utils.c:3662:7: error: implicit declaration of function 'sched_setaffinity' [-Werror=implicit-function-declaration] 
     if (sched_setaffinity(0, sizeof(cpu_set_t), &cpuset)) { 
     ^
    core/utils.c:3662:35: error: 'cpu_set_t' undeclared (first use in this function) 
     if (sched_setaffinity(0, sizeof(cpu_set_t), &cpuset)) { 
            ^
    core/utils.c: In function 'uwsgi_thread_run': 
    core/utils.c:3782:2: error: implicit declaration of function 'pthread_sigmask' [-Werror=implicit-function-declaration] 
     pthread_sigmask(SIG_BLOCK, &smask, NULL); 
    ^
    core/utils.c:3782:18: error: 'SIG_BLOCK' undeclared (first use in this function) 
     pthread_sigmask(SIG_BLOCK, &smask, NULL); 
        ^
    core/utils.c: In function 'uwsgi_envdir': 
    core/utils.c:4349:8: error: implicit declaration of function 'unsetenv' [-Werror=implicit-function-declaration] 
     if (unsetenv(de->d_name)) { 
      ^
    core/utils.c:4380:7: error: implicit declaration of function 'setenv' [-Werror=implicit-function-declaration] 
     if (setenv(de->d_name, content, 1)) { 
     ^
    cc1: all warnings being treated as errors 

    *** uWSGI compiling server core *** 

किसी भी विचार? मैं निम्नलिखित निर्भरता पहले से स्थापित करने हूँ:

RUN apk --update add \ 
     bash \ 
     python \ 
     python-dev \ 
     py-pip \ 
     gcc \ 
     zlib-dev \ 
     git \ 
     linux-headers \ 
     build-base \ 
     musl \ 
     musl-dev \ 
     memcached \ 
     libmemcached-dev 
+0

कुछ लोगों को एक WSGI, https://github.com/OrangeTux/minimal-docker-python-setup या https पर देखने के अल्पाइन से बना सकता है पर मेरे लिए पूरी तरह से ठीक काम करता है: //github.com/sickp/docker-alpine-nginx/blob/master/versions/1.9.12/Dockerfile – user2915097

+0

क्या आप कभी इसे समझने में सक्षम थे? मुझे भी यही तकलीफ़ है। – djmoch

उत्तर

8

दुर्भाग्य uwsgi की नवीनतम रिलीज musl का समर्थन नहीं करता, एक glibc विकल्प है कि अल्पाइन और एक जोड़ी अन्य distros का उपयोग करें। Uwsgi musl के साथ नहीं बनाएगा जब ugreen प्लगइन शामिल है (https://github.com/unbit/uwsgi/pull/522 देखें), तो आप अभी भी pip install uwsgi नहीं देख सकते हैं। हालांकि, यदि आप पर्यावरण परिवर्तनीय UWSGI_PROFILE=core के साथ uwsgi बनाते हैं तो निर्माण सफल होना चाहिए; लेकिन यदि यहां हल किए गए मुद्दों के कारण रनटाइम पर असफल हो जाएगा (https://github.com/unbit/uwsgi/pull/1210)। यह शायद गंभीर समाचार - मुझे पता है कि यह मेरे लिए था - लेकिन कम से कम ऐसा लगता है कि यूवीजीआई टीम ने मुसलमानों पर चल रहे अपने मुद्दों को हल करने में समय लगाया है। उम्मीद है कि यह अगली रिलीज में काम करेगा।

0

आप की कोशिश की

http://github.com/unbit/uwsgi/archive/uwsgi-2.0.zip 
अपने requirements.txt में

है?

आप pcre-dev पैकेज स्थापित

0

मैं एक GitHub thread पर इस पाया की आवश्यकता होगी। यह थोड़ा संशोधित और अजगर 3,5

apk add python3-dev build-base linux-headers pcre-dev 
pip install uwsgi 
संबंधित मुद्दे