openresty / set-misc-nginx-module

Various set_xxx directives added to nginx's rewrite module (md5/sha1, sql/json quoting, and many more)
http://wiki.nginx.org/NginxHttpSetMiscModule
388 stars 102 forks source link

compilation fails due to check for NDK_SRCS variable #30

Closed Nopius closed 8 years ago

Nopius commented 8 years ago

I use ngx_devel_kit release 0.2.19, nginx 1.9.12 and set-misc-nginx-module version 0.30. I don't use openresty, but compile nginx myself.

Variable NDK_SRCS is not defined in ngx_devel_kit, but checked for existence in 'config' file:

Here is a partial output of the build:

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.3w2LQ7
+ umask 022
+ cd /opt/orabuild/rpmbuild/BUILD
+ cd nginx-1.9.12
+ export LUAJIT_LIB=/usr/lib64
+ LUAJIT_LIB=/usr/lib64
+ export LUAJIT_INC=/usr/include/luajit-2.0
+ LUAJIT_INC=/usr/include/luajit-2.0
+ ./configure --prefix=/opt/nginx-1.9.12 --pid-path=/var/run/nginx.pid --http-client-body-temp-path=/tmp/nginx-client_body_temp --http-proxy-temp-path=/tmp/nginx-proxy_temp --http-fastcgi-temp-path=/tmp/nginx-fastcgi_temp --http-uwsgi-temp-path=/tmp/nginx-uwsgi_temp --http-scgi-temp-path=/tmp/nginx-scgi_temp --with-pcre --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_realip_module --with-stream --with-stream_ssl_module --add-module=/opt/orabuild/rpmbuild/BUILD/stream-lua-nginx-module-0.0.1 --add-module=/opt/orabuild/rpmbuild/BUILD/ngx_devel_kit-0.2.19 --add-dynamic-module=/opt/orabuild/rpmbuild/BUILD/lua-nginx-module-0.10.2 --add-dynamic-module=/opt/orabuild/rpmbuild/BUILD/lua-upstream-nginx-module-0.05 --add-dynamic-module=/opt/orabuild/rpmbuild/BUILD/set-misc-nginx-module-0.30
checking for OS
 + Linux 3.8.13-68.2.2.el7uek.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC)
...
checking for SO_PASSCRED ... found
 + ngx_stream_lua_module was configured
adding module in /opt/orabuild/rpmbuild/BUILD/ngx_devel_kit-0.2.19
 + ngx_devel_kit was configured
configuring additional dynamic modules
adding module in /opt/orabuild/rpmbuild/BUILD/lua-nginx-module-0.10.2
checking for LuaJIT library in /usr/lib64 and /usr/include/luajit-2.0 (specified by the LUAJIT_LIB and LUAJIT_INC env, with -ldl) ... found
checking for export symbols by default (-E) ... found
checking for export symbols by default (--export-all-symbols) ... not found
checking for SO_PASSCRED ... found
 + ngx_http_lua_module was configured
adding module in /opt/orabuild/rpmbuild/BUILD/lua-upstream-nginx-module-0.05
 + ngx_http_lua_upstream_module was configured
adding module in /opt/orabuild/rpmbuild/BUILD/set-misc-nginx-module-0.30
error: ngx_devel_kit is required to build ngx_set_misc; please put it before ngx_set_misc.
error: Bad exit status from /var/tmp/rpm-tmp.3w2LQ7 (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.3w2LQ7 (%build)

Here is config change (just a workaround), that helped me to build the module:

[orabuild@rpmbuild7 set-misc-nginx-module-0.30]$ diff -u config config.new 
--- config  2016-03-09 13:07:02.000000000 +1000
+++ config.new  2016-03-22 15:45:57.000000000 +1000
@@ -1,12 +1,7 @@
 ngx_addon_name=ngx_http_set_misc_module

 if test -n "$ngx_module_link"; then
-    if test -n "$NDK_SRCS"; then
         echo "found ngx_devel_kit for ngx_set_misc; looks good."
-    else
-        echo "error: ngx_devel_kit is required to build ngx_set_misc; please put it before ngx_set_misc." 1>&2
-        exit 1
-    fi
agentzh commented 8 years ago

@Nopius I think you need the latest git master of NDK for the latest ngx_set_misc tagged version when nginx 1.9.11+ is used.

Nopius commented 8 years ago

You are right, I didn't use master versions of everything, but used latest releases. May be that's a matter of personal preference, but I think it's a good approach to use released version (not master branch) of sources to make reproducible builds.

agentzh commented 8 years ago

@Nopius I will only do new releases when the relevant modules already officially support NGINX 1.9.11+. Right now they are not yet.

agentzh commented 8 years ago

@Nopius The latest tagged release of ngx_set_misc does work with the latest tagged release of NDK for NGINX verisons older than 1.9.11. So I don't see any real problems here.

Nopius commented 8 years ago

OK. Thank you for clarification. I close the issue. And thank you for great product (I mean nginx patches).