Closed hongzhidao closed 6 years ago
Hello @hongzhidao. Glad to see you here.
I've made a branch for compilation on old Linux kernels: https://github.com/arut/nginx-python-module/tree/oldlinux I hope, later I will come up with a better solution.
BTW tests will not work with python2.6, they use some new unittest features.
And it seems the module only works well with latest nginx version 1.11+ because of the struct ngx_sockaddr_t.
Yes.
The same error
make -f objs/Makefile make[1]: Вход в каталог `/home/kobzar/install/nginx/srv/nginx-1.12.0' cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/python2.7 -I /usr/include/python2.7 -I objs -I src/http -I src/http/modules -I /usr/include/python2.7 -I /usr/include/python2.7 \ -o objs/addon/src/ngx_python.o \ /home/kobzar/install/nginx/srv/mods/nginx-python-module/src/ngx_python.c In file included from /usr/include/python2.7/pyconfig.h:6:0, from /usr/include/python2.7/Python.h:8, from /home/kobzar/install/nginx/srv/mods/nginx-python-module/src/ngx_python.h:13, from /home/kobzar/install/nginx/srv/mods/nginx-python-module/src/ngx_python.c:11: /usr/include/python2.7/pyconfig-64.h:1166:0: ошибка: «_GNU_SOURCE» переопределён [-Werror]
^ In file included from src/core/ngx_config.h:26:0, from /home/kobzar/install/nginx/srv/mods/nginx-python-module/src/ngx_python.c:7: src/os/unix/ngx_linux_config.h:13:0: замечание: это расположение предыдущего определения
^ In file included from /usr/include/python2.7/pyconfig.h:6:0, from /usr/include/python2.7/Python.h:8, from /home/kobzar/install/nginx/srv/mods/nginx-python-module/src/ngx_python.h:13, from /home/kobzar/install/nginx/srv/mods/nginx-python-module/src/ngx_python.c:11: /usr/include/python2.7/pyconfig-64.h:1188:0: ошибка: «_POSIX_C_SOURCE» переопределён [-Werror]
^ In file included from /usr/include/sys/types.h:25:0, from src/os/unix/ngx_linux_config.h:18, from src/core/ngx_config.h:26, from /home/kobzar/install/nginx/srv/mods/nginx-python-module/src/ngx_python.c:7: /usr/include/features.h:168:0: замечание: это расположение предыдущего определения
^ In file included from /usr/include/python2.7/pyconfig.h:6:0, from /usr/include/python2.7/Python.h:8, from /home/kobzar/install/nginx/srv/mods/nginx-python-module/src/ngx_python.h:13, from /home/kobzar/install/nginx/srv/mods/nginx-python-module/src/ngx_python.c:11: /usr/include/python2.7/pyconfig-64.h:1210:0: ошибка: «_XOPEN_SOURCE» переопределён [-Werror]
^ In file included from /usr/include/sys/types.h:25:0, from src/os/unix/ngx_linux_config.h:18, from src/core/ngx_config.h:26, from /home/kobzar/install/nginx/srv/mods/nginx-python-module/src/ngx_python.c:7: /usr/include/features.h:170:0: замечание: это расположение предыдущего определения
^ cc1: all warnings being treated as errors make[1]: [objs/addon/src/ngx_python.o] Ошибка 1 make[1]: Выход из каталога `/home/kobzar/install/nginx/srv/nginx-1.12.0' make: [build] Ошибка 2
@kobzar what Linux version do you have? did you try the branch?
yes. But issue the same. And my kernel isn't old. Linux server 3.10.0-514.16.1.el7.x86_64 #1 SMP Wed Apr 12 15:04:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Yes, but patching nginx is a bad idea anyway.
I've just built module pretty fine (with the warnings, tho, but it is no -Werror
anywhere) with nginx-1.13.3 on 4.12.1 and 4.12.4
This should have been fixed in v0.2.0.
Hi!
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/python2.6 -I /usr/include/python2.6 -I objs -I src/http -I src/http/modules -I /usr/include/python2.6 -I /usr/include/python2.6 \ -o objs/addon/src/ngx_python.o \ /root/nginx-python-module/src/ngx_python.c In file included from /usr/include/python2.6/pyconfig.h:6, from /usr/include/python2.6/Python.h:8, from /root/nginx-python-module/src/ngx_python.h:13, from /root/nginx-python-module/src/ngx_python.c:11: /usr/include/python2.6/pyconfig-64.h:1022:1: error: "_GNU_SOURCE" redefined In file included from src/core/ngx_config.h:26, from /root/nginx-python-module/src/ngx_python.c:7: src/os/unix/ngx_linux_config.h:13:1: error: this is the location of the previous definition In file included from /usr/include/python2.6/pyconfig.h:6, from /usr/include/python2.6/Python.h:8, from /root/nginx-python-module/src/ngx_python.h:13, from /root/nginx-python-module/src/ngx_python.c:11: /usr/include/python2.6/pyconfig-64.h:1034:1: error: "_POSIX_C_SOURCE" redefined In file included from /usr/include/sys/types.h:26, from src/os/unix/ngx_linux_config.h:18, from src/core/ngx_config.h:26, from /root/nginx-python-module/src/ngx_python.c:7: /usr/include/features.h:162:1: error: this is the location of the previous definition In file included from /usr/include/python2.6/pyconfig.h:6, from /usr/include/python2.6/Python.h:8, from /root/nginx-python-module/src/ngx_python.h:13, from /root/nginx-python-module/src/ngx_python.c:11: /usr/include/python2.6/pyconfig-64.h:1043:1: error: "_XOPEN_SOURCE" redefined In file included from /usr/include/sys/types.h:26, from src/os/unix/ngx_linux_config.h:18, from src/core/ngx_config.h:26, from /root/nginx-python-module/src/ngx_python.c:7: /usr/include/features.h:164:1: error: this is the location of the previous definition make[1]: [objs/addon/src/ngx_python.o] Error 1 make[1]: Leaving directory `/root/nginx-1.10.2' make: [build] Error 2
Thanks.