gpt4 book ai didi

cygwin - 在 cygwin 上安装 uwsgi

转载 作者:行者123 更新时间:2023-12-01 06:11:13 27 4
gpt4 key购买 nike

有没有人设法在 cygwin (python 2.7) 上安装 uwsgi?

{ uwsgi-2.0.11.2 }  » python setup.py install
running install
using profile: buildconf/default.ini
detected include path: ['/usr/lib/gcc/i686-pc-cygwin/4.9.2/include', '/usr/lib/gcc/i686-pc-cygwin/4.9.2/include-fixed', '/usr/include', '/usr/lib/gcc/i686-pc-cygwin/4.9.2/../../../../include/w32api']
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_WINDOWS_MUTEX -DUWSGI_EVENT_USE_POLL -DUWSGI_EVENT_TIMER_USE_NONE -DUWSGI_EVENT_FILEMONITOR_USE_NONE -DUWSGI_UUID -DUWSGI_VERSION="\"2.0.11.2\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="11" -DUWSGI_VERSION_REVISION="2" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_SSL -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(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(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 ***
[gcc] core/utils.o
core/utils.c: In function ‘uwsgi_as_root’:
core/utils.c:848:4: error: implicit declaration of function ‘initgroups’ [-Werror=implicit-function-declaration]
if (initgroups(uidname, uwsgi.gid)) {
^
cc1: all warnings being treated as errors

我有 make, automake , gcc (4.9.2) 。我还需要什么吗?

最佳答案

我在 Windows 7 下遇到了完全相同的问题,gcc (GCC) 4.9.3GNU Make 4.1 .实际上有3个问题需要解决。首先是通过删除 -Wall 来禁用 GCC 警告。旗帜。二是删除GCC -rdynamic使用 Cygwin 时的链接器选项。最后一个问题是你需要安装libcrypt-devel使用 Cygwin 的安装程序。

这是我的 git diff uwsgiconfig.py好像。请注意,我克隆了 master分支来自 GitHub .

diff --git a/uwsgiconfig.py b/uwsgiconfig.py
index 3279777..cca00cf 100644
--- a/uwsgiconfig.py
+++ b/uwsgiconfig.py
@@ -1,5 +1,6 @@
# uWSGI build system

+
uwsgi_version = '2.1-dev'

import os
@@ -621,7 +622,7 @@ class uConf(object):
self.cflags = [
'-O2',
'-I.',
- '-Wall',
+ # '-Wall',
'-Werror',
'-D_LARGEFILE_SOURCE',
'-D_FILE_OFFSET_BITS=64'
@@ -842,6 +843,9 @@ class uConf(object):
if GCC in ('clang',):
self.libs.remove('-rdynamic')

+ if uwsgi_os.startswith('CYGWIN'):
+ self.libs.remove('-rdynamic')
+
# compile extras
extras = self.get('extras', None)
if extras:

然后是一个简单的 make在克隆的 uwsgi 目录中应该构建所有内容。

我通过创建一个名为 app.py 的文件对其进行了测试。与以下 -
def application(env, start_response):
start_response('200 OK', [('content-type', 'text/html')])

return [b'asdasdasd']

然后运行服务器 -
./uwsgi --http :9090 --wsgi-file app.py

当我访问 http://localhost:9090/ 时一切正常.

关于cygwin - 在 cygwin 上安装 uwsgi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33012225/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com