denji / homebrew-nginx

:fire_engine: Community NGINX tap for custom modules
https://denji.github.io/homebrew-nginx/
Other
616 stars 197 forks source link

lua-nginx-module: handling of multiple headers changed in nginx 1.23+ #418

Closed barkingfoodog closed 1 year ago

barkingfoodog commented 1 year ago

Indicate troubleshooting steps taken

Bug reports / build errors:

==> Fetching denji/nginx/nginx-full
==> Downloading https://nginx.org/download/nginx-1.23.3.tar.gz
Already downloaded: /Users/aclay/Library/Caches/Homebrew/downloads/863e4f8cefb39e2c86b9797ec606b51137fe2b556c02f09e3ce9621a4034d6e6--nginx-1.23.3.tar.gz
==> Installing nginx-full from denji/nginx
==> ./configure --prefix=/opt/homebrew/Cellar/nginx-full/1.23.3 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-path=/opt/homebrew/Cellar/nginx-full/1.23.3/bin/nginx --with-cc-opt=-I/opt/homebrew/include -I/opt/homebrew/opt/pcre/include -I/opt/homebrew/opt/openssl@1.1/include --with-ld-opt=-L/opt/homebrew/lib -L/opt/homebrew/opt/pcre/lib -L/opt/homebrew/op
==> make install
Last 15 lines from /Users/aclay/Library/Logs/Homebrew/nginx-full/02.make:
        -o objs/addon/src/ngx_http_lua_rewriteby.o \
        /opt/homebrew/share/lua-nginx-module/src/ngx_http_lua_rewriteby.c
clang -c -I/opt/homebrew/opt/luajit/include/luajit-2.1  -pipe  -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Wno-deprecated-declarations -Werror -g -I/opt/homebrew/include -I/opt/homebrew/opt/pcre/include -I/opt/homebrew/opt/openssl@1.1/include -DNDK_SET_VAR  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /opt/homebrew/share/ngx-devel-kit/objs -I objs/addon/ndk -I /opt/homebrew/share/lua-nginx-module/src/api -I objs -I src/http -I src/http/modules -I /opt/homebrew/share/ngx-devel-kit/src -I /opt/homebrew/share/ngx-devel-kit/src -I /opt/homebrew/share/ngx-devel-kit/objs -I objs/addon/ndk -I /opt/homebrew/opt/luajit/include/luajit-2.1 \
        -o objs/addon/src/ngx_http_lua_accessby.o \
        /opt/homebrew/share/lua-nginx-module/src/ngx_http_lua_accessby.c
/opt/homebrew/share/lua-nginx-module/src/ngx_http_lua_headers_in.c:156:18: error: no member named 'cookies' in ''
                 offsetof(ngx_http_headers_in_t, cookies),
                 ^                               ~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
1 error generated.
make[1]: *** [objs/addon/src/ngx_http_lua_headers_in.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [install] Error 2

Brief summary of issue:

Installing denji/nginx/nginx-full --with-lua-module produces an error. This appears to be different from #407. Found similar error reports from other packages:

There is a similar error reported on openresty with headers-more-module:

https://github.com/openresty/headers-more-nginx-module/issues/135

These issues suggest updating to nginx 1.23.1, but homebrew-nginx is installing 1.23.3.

The complete command that you issued:

 brew install denji/nginx/nginx-full --with-lua-module

Gist with output of brew doctor:

06:13:58 local ~ $ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  salt
  stormssh

Link output by brew gist-logs <formula>:

https://gist.github.com/ae624e83a4cec2c24ba38f4cdc38ca91

Output of brew config:

HOMEBREW_VERSION: 3.6.17
ORIGIN: https://github.com/Homebrew/brew
HEAD: e76c55e18434c870cca1de7aadf9d5218271fe2d
Last commit: 10 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 23f125f249a3a6f22f325ce12ff1c224a283f3d2
Core tap last commit: 18 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.VoX26gw0TM/org.macosforge.xquartz:0
HOMEBREW_EDITOR: /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -w
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_INSTALL_BADGE: ☕️
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 14.0.0 build 1400
Git: 2.39.0 => /opt/homebrew/bin/git
Curl: 7.85.0 => /usr/bin/curl
macOS: 13.1-arm64
CLT: 14.2.0.0.1.1668646533
Xcode: 14.2
Rosetta 2: false
denji commented 1 year ago

Looks like will need an extra patch from the openresty/lua-nginx-module#2063 to access the multiple headers.