Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Eror compiling with nginx 1.23.1 #1764

Closed
crywolfy opened this issue Feb 23, 2023 · 5 comments
Closed

Eror compiling with nginx 1.23.1 #1764

crywolfy opened this issue Feb 23, 2023 · 5 comments

Comments

@crywolfy
Copy link

crywolfy commented Feb 23, 2023

Hi there im trying to compile module with nginx 1.23.1 and im getting the folowing output

nginx version: nginx/1.23.1
Debian 10 Buster

just whanna do the dynamic module
./configure --with-compat --add-dynamic-module=./incubator-pagespeed-ngx

    ./incubator-pagespeed-ngx/src/ngx_pagespeed.cc

./incubator-pagespeed-ngx/src/ngx_pagespeed.cc: In function ‘ngx_int_t net_instaweb::{anonymous}::ps_set_cache_control(ngx_http_request_t*, char*)’:
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:407:36: error: request for member ‘elts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
if (r->headers_out.cache_control.elts == NULL) {
^~~~
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:408:35: error: cannot convert ‘ngx_table_elt_t**’ {aka ‘ngx_table_elt_s**’} to ‘ngx_array_t*’
ngx_int_t rc = ngx_array_init(&r->headers_out.cache_control, r->pool,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/core/ngx_core.h:65,
from src/http/ngx_http.h:13,
from ./incubator-pagespeed-ngx/src/ngx_pagespeed.h:33,
from ./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:26:
src/core/ngx_array.h:32:29: note: initializing argument 1 of ‘ngx_int_t ngx_array_init(ngx_array_t*, ngx_pool_t*, ngx_uint_t, size_t)’
ngx_array_init(ngx_array_t array, ngx_pool_t pool, ngx_uint_t n, size_t size)
~~~~~~~~~~~~~^~~~~
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:415:22: error: cannot convert ‘ngx_table_elt_t
’ {aka ‘ngx_table_elt_s**’} to ‘ngx_array_t*’
ngx_array_push(&r->headers_out.cache_control));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/core/ngx_core.h:65,
from src/http/ngx_http.h:13,
from ./incubator-pagespeed-ngx/src/ngx_pagespeed.h:33,
from ./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:26:
src/core/ngx_array.h:27:35: note: initializing argument 1 of ‘void* ngx_array_push(ngx_array_t*)’
void ngx_array_push(ngx_array_t a);
~~~~~~~~~~~~~^
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc: In function ‘bool net_instaweb::{anonymous}::ps_get_cache_control(ngx_http_request_t
, GoogleString
)’:
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:439:74: error: request for member ‘elts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
auto ccp = static_cast<ngx_table_elt_t**>(r->headers_out.cache_control.elts);
^~~~
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:444:59: error: request for member ‘nelts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
for (ngx_uint_t i = 0; i < r->headers_out.cache_control.nelts; i++) {
^~~~~
make[1]: *** [objs/Makefile:1342: objs/addon/src/ngx_pagespeed.o] Error 1
make[1]: Leaving directory '/home/crywolfy/kernel/nginx1.23.1/nginx-1.23.1'
make: *** [Makefile:16: modules] Error 2

what im doing wrong ?

@eilandert
Copy link

NGINX 1.23+ had some changes, you need to checkout the master tree from git, not the stable version

#1760

@crywolfy
Copy link
Author

crywolfy commented Mar 9, 2023

If you can explain better id be gracefull, did not understand what to check nginx or pagespeed, with commands will be better, i did try to compile it on nginx 1.23.3 and the same... :(

jeezus tryed every version of psol around here and the jammy from your post cannot compile it , does anyone have the compiled files under nginx 1.23^ ?
`./configure --with-compat --add-dynamic-module=./incubator-pagespeed-ngx
checking for OS

  • Linux 5.10.0-0.deb10.20-rt-amd64 x86_64
    checking for C compiler ... found
  • using GNU C compiler
  • gcc version: 8.3.0 (Debian 8.3.0-6)
    checking for gcc -pipe switch ... found
    checking for -Wl,-E switch ... found
    checking for gcc builtin atomic operations ... found
    checking for C99 variadic macros ... found
    checking for gcc variadic macros ... found
    checking for gcc builtin 64 bit byteswap ... found
    checking for unistd.h ... found
    checking for inttypes.h ... found
    checking for limits.h ... found
    checking for sys/filio.h ... not found
    checking for sys/param.h ... found
    checking for sys/mount.h ... found
    checking for sys/statvfs.h ... found
    checking for crypt.h ... found
    checking for Linux specific features
    checking for epoll ... found
    checking for EPOLLRDHUP ... found
    checking for EPOLLEXCLUSIVE ... found
    checking for eventfd() ... found
    checking for O_PATH ... found
    checking for sendfile() ... found
    checking for sendfile64() ... found
    checking for sys/prctl.h ... found
    checking for prctl(PR_SET_DUMPABLE) ... found
    checking for prctl(PR_SET_KEEPCAPS) ... found
    checking for capabilities ... found
    checking for crypt_r() ... found
    checking for sys/vfs.h ... found
    checking for UDP_SEGMENT ... not found
    checking for nobody group ... not found
    checking for nogroup group ... found
    checking for poll() ... found
    checking for /dev/poll ... not found
    checking for kqueue ... not found
    checking for crypt() ... not found
    checking for crypt() in libcrypt ... found
    checking for F_READAHEAD ... not found
    checking for posix_fadvise() ... found
    checking for O_DIRECT ... found
    checking for F_NOCACHE ... not found
    checking for directio() ... not found
    checking for statfs() ... found
    checking for statvfs() ... found
    checking for dlopen() ... not found
    checking for dlopen() in libdl ... found
    checking for sched_yield() ... found
    checking for sched_setaffinity() ... found
    checking for SO_SETFIB ... not found
    checking for SO_REUSEPORT ... found
    checking for SO_ACCEPTFILTER ... not found
    checking for SO_BINDANY ... not found
    checking for IP_TRANSPARENT ... found
    checking for IP_BINDANY ... not found
    checking for IP_BIND_ADDRESS_NO_PORT ... found
    checking for IP_RECVDSTADDR ... not found
    checking for IP_SENDSRCADDR ... not found
    checking for IP_PKTINFO ... found
    checking for IPV6_RECVPKTINFO ... found
    checking for TCP_DEFER_ACCEPT ... found
    checking for TCP_KEEPIDLE ... found
    checking for TCP_FASTOPEN ... found
    checking for TCP_INFO ... found
    checking for accept4() ... found
    checking for int size ... 4 bytes
    checking for long size ... 8 bytes
    checking for long long size ... 8 bytes
    checking for void * size ... 8 bytes
    checking for uint32_t ... found
    checking for uint64_t ... found
    checking for sig_atomic_t ... found
    checking for sig_atomic_t size ... 4 bytes
    checking for socklen_t ... found
    checking for in_addr_t ... found
    checking for in_port_t ... found
    checking for rlim_t ... found
    checking for uintptr_t ... uintptr_t found
    checking for system byte ordering ... little endian
    checking for size_t size ... 8 bytes
    checking for off_t size ... 8 bytes
    checking for time_t size ... 8 bytes
    checking for AF_INET6 ... found
    checking for setproctitle() ... not found
    checking for pread() ... found
    checking for pwrite() ... found
    checking for pwritev() ... found
    checking for strerrordesc_np() ... not found
    checking for sys_nerr ... found
    checking for localtime_r() ... found
    checking for clock_gettime(CLOCK_MONOTONIC) ... found
    checking for posix_memalign() ... found
    checking for memalign() ... found
    checking for mmap(MAP_ANON|MAP_SHARED) ... found
    checking for mmap("/dev/zero", MAP_SHARED) ... found
    checking for System V shared memory ... found
    checking for POSIX semaphores ... not found
    checking for POSIX semaphores in libpthread ... found
    checking for struct msghdr.msg_control ... found
    checking for ioctl(FIONBIO) ... found
    checking for ioctl(FIONREAD) ... found
    checking for struct tm.tm_gmtoff ... found
    checking for struct dirent.d_namlen ... not found
    checking for struct dirent.d_type ... found
    checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
    checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found
    checking for openat(), fstatat() ... found
    checking for getaddrinfo() ... found
    configuring additional dynamic modules
    adding module in ./incubator-pagespeed-ngx
    mod_pagespeed_dir=./incubator-pagespeed-ngx/psol/include
    build_from_source=false
    checking for psol ... found
    List of modules (in reverse order of applicability): ngx_http_write_filter_module ngx_http_header_filter_module ngx_http_chunked_filter_module ngx_http_range_header_filter_module ngx_http_gzip_filter_module ngx_http_postpone_filter_module ngx_http_ssi_filter_module ngx_http_charset_filter_module ngx_http_userid_filter_module ngx_http_headers_filter_module
    checking for psol-compiler-compat ... found
  • ngx_pagespeed was configured
    checking for PCRE2 library ... found
    checking for zlib library ... found
    creating objs/Makefile

Configuration summary

  • using system PCRE2 library
  • OpenSSL library is not used
  • using system zlib library

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
`
#2
make modules
make -f objs/Makefile modules
make[1]: Entering directory '/home/crywolfy/kernel/nginx1.23.1/nginx-1.23.1'
cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -D_GLIBCXX_USE_CXX11_ABI=0 --std=c++11 -I src/core -I src/event -I src/event/modules -I src/os/unix -I ./incubator-pagespeed-ngx/psol/include -I ./incubator-pagespeed-ngx/psol/include/third_party/chromium/src -I ./incubator-pagespeed-ngx/psol/include/third_party/google-sparsehash/src/src -I ./incubator-pagespeed-ngx/psol/include/third_party/google-sparsehash/gen/arch/linux/x64/include -I ./incubator-pagespeed-ngx/psol/include/third_party/grpc/src/include -I ./incubator-pagespeed-ngx/psol/include/third_party/protobuf/src/src -I ./incubator-pagespeed-ngx/psol/include/third_party/re2/src -I ./incubator-pagespeed-ngx/psol/include/out/Release/obj/gen -I ./incubator-pagespeed-ngx/psol/include/out/Release/obj/gen/protoc_out/instaweb -I ./incubator-pagespeed-ngx/psol/include/third_party/apr/src/include -I ./incubator-pagespeed-ngx/psol/include/third_party/aprutil/src/include -I ./incubator-pagespeed-ngx/psol/include/third_party/apr/gen/arch/linux/x64/include -I ./incubator-pagespeed-ngx/psol/include/third_party/aprutil/gen/arch/linux/x64/include -I ./incubator-pagespeed-ngx/psol/include/url -I objs -I src/http -I src/http/modules
-o objs/addon/src/ngx_pagespeed.o
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc: In function ‘ngx_int_t net_instaweb::{anonymous}::ps_set_cache_control(ngx_http_request_t*, char*)’:
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:407:36: error: request for member ‘elts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
if (r->headers_out.cache_control.elts == NULL) {
^~~~
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:408:35: error: cannot convert ‘ngx_table_elt_t**’ {aka ‘ngx_table_elt_s**’} to ‘ngx_array_t*’
ngx_int_t rc = ngx_array_init(&r->headers_out.cache_control, r->pool,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/core/ngx_core.h:65,
from src/http/ngx_http.h:13,
from ./incubator-pagespeed-ngx/src/ngx_pagespeed.h:33,
from ./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:26:
src/core/ngx_array.h:32:29: note: initializing argument 1 of ‘ngx_int_t ngx_array_init(ngx_array_t*, ngx_pool_t*, ngx_uint_t, size_t)’
ngx_array_init(ngx_array_t array, ngx_pool_t pool, ngx_uint_t n, size_t size)
~~~~~~~~~~~~~^~~~~
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:415:22: error: cannot convert ‘ngx_table_elt_t
’ {aka ‘ngx_table_elt_s**’} to ‘ngx_array_t*’
ngx_array_push(&r->headers_out.cache_control));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/core/ngx_core.h:65,
from src/http/ngx_http.h:13,
from ./incubator-pagespeed-ngx/src/ngx_pagespeed.h:33,
from ./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:26:
src/core/ngx_array.h:27:35: note: initializing argument 1 of ‘void* ngx_array_push(ngx_array_t*)’
void ngx_array_push(ngx_array_t a);
~~~~~~~~~~~~~^
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc: In function ‘bool net_instaweb::{anonymous}::ps_get_cache_control(ngx_http_request_t
, GoogleString
)’:
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:439:74: error: request for member ‘elts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
auto ccp = static_cast<ngx_table_elt_t**>(r->headers_out.cache_control.elts);
^~~~
./incubator-pagespeed-ngx/src/ngx_pagespeed.cc:444:59: error: request for member ‘nelts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
for (ngx_uint_t i = 0; i < r->headers_out.cache_control.nelts; i++) {
^~~~~
make[1]: *** [objs/Makefile:1342: objs/addon/src/ngx_pagespeed.o] Error 1
make[1]: Leaving directory '/home/crywolfy/kernel/nginx1.23.1/nginx-1.23.1'
make: *** [Makefile:16: modules] Error 2

@skygunner
Copy link

skygunner commented Mar 13, 2023

git master tree is the main git repository branch.

see here for working building instructions
#1760

@crywolfy
Copy link
Author

They don't work on me, but this worked flawesly
#1756 (comment)

Thanks.

@skygunner
Copy link

It is off topic but I want to mention that by enabling the corefilters level on my testing 2 cpu shared vps,
loader.io test showing the response time has been slowed by almost 100% even with just 100 concurrent connections.
Might be better to use it on vps with at least 4 cores?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants