openresty / openresty/lua-nginx-module

failed to build the module for Win32 using MSYS2

Open
#2,498 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.8k
Forks
2.1k
Avg merge
6h 1m
Merged PRs (30d)
6

Description

related to https://github.com/openresty/lua-nginx-module/pull/1222 (i guess ?)
commit : bbace592caf0dfe182e4d8a0b2a80660bcafd1f0

gcc -c  -I/ucrt64/include/luajit-2.1  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I/ucrt64/include -DNDK_SET_VAR -DLIBINJECTION_VERSION=0 -I../naxsi/naxsi_src/libinjection_ngxbuild/ -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/win32 -I ../ngx_devel_kit/objs -I objs/addon/ndk -I ../ngx_devel_kit/src -I ../ngx_devel_kit/objs -I objs/addon/ndk -I /ucrt64/include/luajit-2.1 -I ../lua-nginx-module/src/api -I ../naxsi/naxsi_src/ -I ./pcre2-10.47/src/ -I ./openssl-4.0.0/.openssl/include -I ./zlib-1.3.2 -I objs -I src/http -I src/http/modules -I ../ngx_devel_kit/src \
        -o objs/addon/src/ngx_http_lua_socket_tcp.o \
        ../lua-nginx-module/src/ngx_http_lua_socket_tcp.c
In file included from ../ngx_devel_kit/objs/ndk_includes.h:53,
                 from ../ngx_devel_kit/src/ndk.h:47,
                 from ../lua-nginx-module/src/ngx_http_lua_common.h:50,
                 from ../lua-nginx-module/src/ngx_http_lua_socket_tcp.h:11,
                 from ../lua-nginx-module/src/ngx_http_lua_socket_tcp.c:13:
../ngx_devel_kit/src/ndk_log.h:163:9: note: '#pragma message: Nginx Devel Kit logging without variadic macros not yet implemented'
  163 | #pragma message("Nginx Devel Kit logging without variadic macros not yet implemented")
      |         ^~~~~~~
In file included from src/core/ngx_core.h:82,
                 from ../lua-nginx-module/src/ddebug.h:13,
                 from ../lua-nginx-module/src/ngx_http_lua_socket_tcp.c:10:
../lua-nginx-module/src/ngx_http_lua_socket_tcp.c: In function 'ngx_http_lua_socket_tcp_log_error':
src/core/ngx_inet.h:21:13: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_un'
   21 |      sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path))
      |             ^~~~~~
../lua-nginx-module/src/ngx_http_lua_socket_tcp.c:453:26: note: in expansion of macro 'NGX_UNIX_ADDRSTRLEN'
  453 |         u_char addr_text[NGX_UNIX_ADDRSTRLEN];
      |                          ^~~~~~~~~~~~~~~~~~~
In file included from M:/Installations/MSY2/ucrt64/lib/gcc/x86_64-w64-mingw32/16.1.0/include/stddef.h:1,
                 from M:/Installations/MSY2/ucrt64/include/inttypes.h:14,
                 from ./pcre2-10.47/src/pcre2.h:89,
                 from src/core/ngx_regex.h:19,
                 from src/core/ngx_core.h:75:
src/core/ngx_inet.h:21:35: error: invalid use of undefined type 'struct sockaddr_un'
   21 |      sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path))
      |                                   ^~~~~~~~
../lua-nginx-module/src/ngx_http_lua_socket_tcp.c:453:26: note: in expansion of macro 'NGX_UNIX_ADDRSTRLEN'
  453 |         u_char addr_text[NGX_UNIX_ADDRSTRLEN];
      |                          ^~~~~~~~~~~~~~~~~~~
src/core/ngx_inet.h:21:13: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_un'
   21 |      sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path))
      |             ^~~~~~
../lua-nginx-module/src/ngx_http_lua_socket_tcp.c:457:50: note: in expansion of macro 'NGX_UNIX_ADDRSTRLEN'
  457 |                                       addr_text, NGX_UNIX_ADDRSTRLEN, 0);
      |                                                  ^~~~~~~~~~~~~~~~~~~
src/core/ngx_inet.h:21:35: error: invalid use of undefined type 'struct sockaddr_un'
   21 |      sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path))
      |                                   ^~~~~~~~
../lua-nginx-module/src/ngx_http_lua_socket_tcp.c:457:50: note: in expansion of macro 'NGX_UNIX_ADDRSTRLEN'
  457 |                                       addr_text, NGX_UNIX_ADDRSTRLEN, 0);
      |                                                  ^~~~~~~~~~~~~~~~~~~
../lua-nginx-module/src/ngx_http_lua_socket_tcp.c:453:16: error: unused variable 'addr_text' [-Werror=unused-variable]
  453 |         u_char addr_text[NGX_UNIX_ADDRSTRLEN];
      |                ^~~~~~~~~
cc1.exe: all warnings being treated as errors
make[1]: *** [objs/Makefile:1672: objs/addon/src/ngx_http_lua_socket_tcp.o] Error 1
make[1]: Leaving directory '/m/MyJob/nginx-builds/nginx-source'
make: *** [Makefile:10: build] Error 2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Win32 MSYS2 build at commit bbace592caf0dfe182e4d8a0b2a80660bcafd1f0, starting with src/core/ngx_inet.h and ngx_http_lua_socket_tcp.c around the NGX_UNIX_ADDRSTRLEN errors. Determine why sockaddr_un is incomplete in this build environment and verify that the module compiles successfully without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, lua
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.