openresty / openresty

High Performance Web Platform Based on Nginx and LuaJIT
https://openresty.org
Other
12.43k stars 1.53k forks source link

1.27.0 compilation error ngx_stream_lua_clfactory #985

Closed bsiara closed 5 days ago

bsiara commented 1 month ago

When I try to build latest openresty version 1.27.0 from git repository I get error during compilation:

...
    ../ngx_stream_lua-0.0.14/src/ngx_stream_lua_cache.c
cc -c -I/opt/nginx/openresty-1.27.0.1/build/luajit-root/opt/nginx/luajit/include/luajit-2.1 -I/opt/nginx/openresty-1.27.0.1/build/luajit-root/opt/nginx/luajit/include/luajit-2.1  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -g -DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC -O2 -fstack-protector-strong -I/usr/local/include -DNDK_SET_VAR -DNDK_UPSTREAM_LIST -DNDK_SET_VAR -DNDK_SET_VAR -DNDK_SET_VAR -DNDK_SET_VAR -DLIBINJECTION_VERSION=0 -I/opt/nginx/openresty-1.27.0.1/../naxsi/naxsi_src/libinjection_ngxbuild/ -Wno-deprecated-declarations  -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I src/http/modules/perl -I ../ngx_devel_kit-0.3.3/objs -I objs/addon/ndk -I ../ngx_lua-0.10.26/src/api -I ../ngx_stream_lua-0.0.14/src/api -I /opt/nginx/openresty-1.27.0.1/../ngx_brotli/deps/brotli/c/include -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 -I ../ngx_devel_kit-0.3.3/src -I ../ngx_devel_kit-0.3.3/src -I ../ngx_devel_kit-0.3.3/objs -I objs/addon/ndk -I /opt/nginx/openresty-1.27.0.1/build/luajit-root/opt/nginx/luajit/include/luajit-2.1 -I /opt/nginx/openresty-1.27.0.1/../naxsi/naxsi_src/ -I src/mail -I src/stream -I /opt/nginx/openresty-1.27.0.1/build/luajit-root/opt/nginx/luajit/include/luajit-2.1 \
    -o objs/addon/src/ngx_stream_lua_clfactory.o \
    ../ngx_stream_lua-0.0.14/src/ngx_stream_lua_clfactory.c
../ngx_stream_lua-0.0.14/src/ngx_stream_lua_module.c: In function 'ngx_stream_lua_merge_srv_conf':
../ngx_stream_lua-0.0.14/src/ngx_stream_lua_module.c:867:5: error: unknown type name 'ngx_stream_ssl_conf_t'; did you mean 'ngx_stream_addr_conf_t'?
  867 |     ngx_stream_ssl_conf_t           *sscf;
      |     ^~~~~~~~~~~~~~~~~~~~~
      |     ngx_stream_addr_conf_t
../ngx_stream_lua-0.0.14/src/ngx_stream_lua_module.c:872:21: error: request for member 'listen' in something not a structure or union
  872 |     if (sscf && sscf->listen) {
      |                     ^~
../ngx_stream_lua-0.0.14/src/ngx_stream_lua_module.c:882:21: error: request for member 'ssl' in something not a structure or union
  882 |             if (sscf->ssl.ctx == NULL) {
      |                     ^~
../ngx_stream_lua-0.0.14/src/ngx_stream_lua_module.c:898:45: error: request for member 'ssl' in something not a structure or union
  898 |             SSL_CTX_set_client_hello_cb(sscf->ssl.ctx,
      |                                             ^~
../ngx_stream_lua-0.0.14/src/ngx_stream_lua_module.c:920:21: error: request for member 'ssl' in something not a structure or union
  920 |             if (sscf->ssl.ctx == NULL) {
      |                     ^~
../ngx_stream_lua-0.0.14/src/ngx_stream_lua_module.c:937:37: error: request for member 'ssl' in something not a structure or union
  937 |             SSL_CTX_set_cert_cb(sscf->ssl.ctx, ngx_stream_lua_ssl_cert_handler, NULL);
      |                                     ^~
make[2]: *** [objs/Makefile:3137: objs/addon/src/ngx_stream_lua_module.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/opt/nginx/openresty-1.27.0.1/build/nginx-1.27.0'
make[1]: Leaving directory '/opt/nginx/openresty-1.27.0.1/build/nginx-1.27.0'
make[1]: *** [Makefile:10: build] Error 2
make: *** [Makefile:11: all] Error 2
VermiIIi0n commented 1 month ago

FYI, ngx_stream_ssl_conf_t has been renamed by this commit

I guess we can wait for an update or change the code ourselves for now.

Going to ngx_stream_lua folder and run find ./ -type f -exec sed -i "s/ngx_stream_ssl_conf_t/ngx_stream_ssl_srv_conf_t/g" {} + did the job for me.

centminmod commented 1 month ago

stream lua nginx master branch has the fix https://github.com/openresty/stream-lua-nginx-module/commit/bea8a0c0de94cede71554f53818ac0267d675d63