Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew install nginx-full --with-lua-module fails #407

Open
mehmet-tb opened this issue Feb 4, 2022 · 9 comments
Open

brew install nginx-full --with-lua-module fails #407

mehmet-tb opened this issue Feb 4, 2022 · 9 comments

Comments

@mehmet-tb
Copy link

mehmet-tb commented Feb 4, 2022

Seems ngx_http_lua_autoconf.h is removed from the lua-nginx-module: https://github.com/openresty/lua-nginx-module/blob/master/.gitignore#L174. This is possibly the cause.

Command: brew install nginx-full --with-lua-module

Full error message:

Last 15 lines from /Users/mehmetdogan/Library/Logs/Homebrew/nginx-full/02.make:
clang -c -I/usr/local/opt/luajit/include/luajit-2.0  -pipe  -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Wno-deprecated-declarations -Werror -g -I/usr/local/include -I/usr/local/opt/pcre/include -I/usr/local/opt/openssl@1.1/include -DNDK_SET_VAR -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/share/ngx-devel-kit/objs -I objs/addon/ndk -I /usr/local/share/lua-nginx-module/src/api -I objs -I src/http -I src/http/modules -I /usr/local/share/ngx-devel-kit/src -I /usr/local/share/ngx-devel-kit/src -I /usr/local/share/ngx-devel-kit/objs -I objs/addon/ndk -I /usr/local/opt/luajit/include/luajit-2.0 \
                -o objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
                src/http/modules/ngx_http_upstream_least_conn_module.c
clang -c -I/usr/local/opt/luajit/include/luajit-2.0  -pipe  -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Wno-deprecated-declarations -Werror -g -I/usr/local/include -I/usr/local/opt/pcre/include -I/usr/local/opt/openssl@1.1/include -DNDK_SET_VAR -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/share/ngx-devel-kit/objs -I objs/addon/ndk -I /usr/local/share/lua-nginx-module/src/api -I objs -I src/http -I src/http/modules -I /usr/local/share/ngx-devel-kit/src -I /usr/local/share/ngx-devel-kit/src -I /usr/local/share/ngx-devel-kit/objs -I objs/addon/ndk -I /usr/local/opt/luajit/include/luajit-2.0 \
                -o objs/src/http/modules/ngx_http_upstream_random_module.o \
                src/http/modules/ngx_http_upstream_random_module.c
clang -c -I/usr/local/opt/luajit/include/luajit-2.0  -pipe  -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Wno-deprecated-declarations -Werror -g -I/usr/local/include -I/usr/local/opt/pcre/include -I/usr/local/opt/openssl@1.1/include -DNDK_SET_VAR -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/share/ngx-devel-kit/objs -I objs/addon/ndk -I /usr/local/share/lua-nginx-module/src/api -I objs -I src/http -I src/http/modules -I /usr/local/share/ngx-devel-kit/src -I /usr/local/share/ngx-devel-kit/src -I /usr/local/share/ngx-devel-kit/objs -I objs/addon/ndk -I /usr/local/opt/luajit/include/luajit-2.0 \
                -o objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
                src/http/modules/ngx_http_upstream_keepalive_module.c
clang -c -I/usr/local/opt/luajit/include/luajit-2.0  -pipe  -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Wno-deprecated-declarations -Werror -g -I/usr/local/include -I/usr/local/opt/pcre/include -I/usr/local/opt/openssl@1.1/include -DNDK_SET_VAR -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/share/ngx-devel-kit/objs -I objs/addon/ndk -I /usr/local/share/lua-nginx-module/src/api -I objs -I src/http -I src/http/modules -I /usr/local/share/ngx-devel-kit/src -I /usr/local/share/ngx-devel-kit/src -I /usr/local/share/ngx-devel-kit/objs -I objs/addon/ndk -I /usr/local/opt/luajit/include/luajit-2.0 \
                -o objs/src/http/modules/ngx_http_upstream_zone_module.o \
                src/http/modules/ngx_http_upstream_zone_module.c
make[1]: *** No rule to make target `/usr/local/share/lua-nginx-module/src/ngx_http_lua_autoconf.h', needed by `objs/addon/src/ndk.o'.  Stop.
make[1]: *** Waiting for unfinished jobs....
make: *** [install] Error 2

macOS Monterey v12.2

@mehmet-tb mehmet-tb changed the title brew install nginx-full --with-lua-module fails due to missing ngx_http_lua_autoconf.h brew install nginx-full --with-lua-module fails Feb 4, 2022
@teejteej
Copy link

Same issue here with Monterey 12.2

@jshah
Copy link

jshah commented Apr 21, 2022

Similar error here for me on an Apple M1

❯ brew reinstall -v nginx-full --with-lua-module

rm /opt/homebrew/bin/nginx
rm /opt/homebrew/share/man/man8/nginx.8
rmdir /opt/homebrew/share/man/man8
==> Downloading https://nginx.org/download/nginx-1.19.10.tar.gz
Already downloaded: /Users/jshah/Library/Caches/Homebrew/downloads/89ecedcb2cec8851d21199e84277209b4e2d038929ca3b0e9aa38810e7e96bb5--nginx-1.19.10.tar.gz
==> Verifying checksum for '89ecedcb2cec8851d21199e84277209b4e2d038929ca3b0e9aa38810e7e96bb5--nginx-1.19.10.tar.gz'
==> Reinstalling denji/nginx/nginx-full --with-geoip2-module --with-lua-module --with-set-misc-module
tar --extract --no-same-owner --file /Users/jshah/Library/Caches/Homebrew/downloads/89ecedcb2cec8851d21199e84277209b4e2d038929ca3b0e9aa38810e7e96bb5--nginx-1.19.10.tar.gz --directory /private/tmp/d20220421-68633-1rmcbkq
cp -pR /private/tmp/d20220421-68633-1rmcbkq/nginx-1.19.10/. /private/tmp/nginx-full-20220421-68633-1tvyy6x/nginx-1.19.10
chmod -Rf +w /private/tmp/d20220421-68633-1rmcbkq
ln -s ../Cellar/nginx-full/1.19.10/bin/nginx nginx
mkdir -p /opt/homebrew/share/man/man8
ln -s ../../../Cellar/nginx-full/1.19.10/share/man/man8/nginx.8 nginx.8
Error: An exception occurred within a child process:
  Errno::ENOENT: No such file or directory - /usr/local/bin/brew

opened #409 since I think it may be more related to m1 for me

@usrtax
Copy link

usrtax commented Feb 22, 2023

image

m2 error as above
❯ brew install nginx-full --with-lua-module
==> Downloading https://formulae.brew.sh/api/formula.json
######################################################################## 100.0%
Warning: Calling plist_options is deprecated! Use service.require_root instead.
Please report this issue to the denji/nginx tap (not Homebrew/brew or Homebrew/homebrew-core), or even better, submit a PR to fix it:
  /opt/homebrew/Library/Taps/denji/homebrew-nginx/Formula/nginx-full.rb:381

==> Downloading https://formulae.brew.sh/api/cask.json
######################################################################## 100.0%
==> Fetching denji/nginx/nginx-full
==> Downloading https://nginx.org/download/nginx-1.23.3.tar.gz

Already downloaded: /Users/z/Library/Caches/Homebrew/downloads/863e4f8cefb39e2c86b9797ec606b51137fe2b556c02f09e3ce9621a4034d6e6--nginx-1.23.3.tar.gz
==> Installing nginx-full from denji/nginx

Warning: Calling plist_options is deprecated! Use service.require_root instead.
Please report this issue to the denji/nginx tap (not Homebrew/brew or Homebrew/homebrew-core), or even better, submit a PR to fix it:
  /opt/homebrew/Library/Taps/denji/homebrew-nginx/Formula/nginx-full.rb:381

==> ./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/ngin
==> make install
Last 15 lines from /Users/z/Library/Logs/Homebrew/nginx-full/02.make:
  "_pcre_jit_stack_free", referenced from:
      _ngx_http_lua_ffi_set_jit_stack_size in ngx_http_lua_regex.o
  "_pcre_malloc", referenced from:
      _ngx_http_lua_pcre_malloc_init in ngx_http_lua_pcrefix.o
      _ngx_http_lua_pcre_malloc_done in ngx_http_lua_pcrefix.o
     (maybe you meant: _ngx_http_lua_pcre_malloc_done, _ngx_http_lua_pcre_malloc_init )
  "_pcre_study", referenced from:
      _ngx_http_lua_ffi_compile_regex in ngx_http_lua_regex.o
  "_pcre_version", referenced from:
      _ngx_http_lua_ffi_pcre_version in ngx_http_lua_regex.o
     (maybe you meant: _ngx_http_lua_ffi_pcre_version)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [objs/nginx] Error 1
make: *** [install] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/denji/homebrew-nginx/issues

These open issues may also help:
brew install nginx-full --with-njs-module          Error https://github.com/denji/homebrew-nginx/issues/419
Brew install nginx-full --with-rtmp-module brew install nginx-full --with-rtmp-module https://github.com/denji/homebrew-nginx/issues/382
`brew install nginx-full --with-lua-module` fails https://github.com/denji/homebrew-nginx/issues/407
mv: nginx.xsc: No such file or directory while installing nginx-full --with-perl https://github.com/denji/homebrew-nginx/issues/361
`cp: /usr/local/etc/nginx/koi-win: Operation not permitted` installing nginx-full https://github.com/denji/homebrew-nginx/issues/359
building nginx-full with healthcheck module giving error https://github.com/denji/homebrew-nginx/issues/263
Compiler error when installing nginx-full ---with-upload-module https://github.com/denji/homebrew-nginx/issues/304
~

@denji
Copy link
Owner

denji commented Feb 22, 2023

I don't have an Apple Silicon (ARM64) environment to test at the moment, also using Travis instead of Github Actions.
If you have a fix, please submit a pull request.

@usrtax
Copy link

usrtax commented Feb 22, 2023

@denji

this is my m2 macbook https://rustdesk.com Remote Desktop

id 1 649 087 739
password fixnginxbrew

You can use this for fix bug

I try run

brew reinstall nginx-full --with-set-misc-module --with-gzip-static --with-http2 --with-brotli-module --with-lua-module

but can't work

@denji
Copy link
Owner

denji commented Feb 22, 2023

@usrtax Remote access is not necessary, detailed log would be better. Do you also have an error pcre related to lua module?

@usrtax
Copy link

usrtax commented Feb 22, 2023

@denji
image

you can try the Remote desktop with web page http://web.rustdesk.com , No need to install client

I have lua \ brotli \ pcre , but failed in --with-brotli-module and --with-lua-module

❯ cd /opt/homebrew/share/brotli-nginx-module && git submodule update --init
❯ brew reinstall nginx-full --with-set-misc-module --with-gzip-static --with-htt
==> Fetching denji/nginx/nginx-full
==> Downloading https://nginx.org/download/nginx-1.23.3.tar.gz
  /opt/homebrew/Library/Taps/denji/homebrew-nginx/Formula/nginx-full.rb:381

==> Fetching denji/nginx/nginx-full
==> Downloading https://nginx.org/download/nginx-1.23.3.tar.gz
Already downloaded: /Users/z/Library/Caches/Homebrew/downloads/863e4f8cefb39e2c86b9797ec606b51137fe2b556c02f09e3ce9621a4034d6e6--nginx-1.23.3.tar.gz
==> Reinstalling denji/nginx/nginx-full --with-gzip-static --with-http2 --with-brotli-module --with-set-misc-module
Warning: Calling plist_options is deprecated! Use service.require_root instead.
Please report this issue to the denji/nginx tap (not Homebrew/brew or Homebrew/homebrew-core), or even better, submit a PR to fix it:
  /opt/homebrew/Library/Taps/denji/homebrew-nginx/Formula/nginx-full.rb:381

==> ./configure --prefix=/opt/homebrew/Cellar/nginx-full/1.23.3 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-path=/opt/homebrew/Cellar/nginx

Last 15 lines from /Users/z/Library/Logs/Homebrew/nginx-full/01.configure:
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... not found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional modules
adding module in /opt/homebrew/share/ngx-devel-kit
 + ngx_devel_kit was configured
adding module in /opt/homebrew/share/brotli-nginx-module

./configure: error: Brotli library is missing from the /usr directory.

Please make sure that the git submodule has been checked out:

    cd /opt/homebrew/share/brotli-nginx-module && git submodule update --init && cd /private/tmp/nginx-full-20230222-28989-1j9rio4/nginx-1.23.3


If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/denji/homebrew-nginx/issues

These open issues may also help:
brew install nginx-full --with-njs-module          Error https://github.com/denji/homebrew-nginx/issues/419
`brew install nginx-full --with-lua-module` fails https://github.com/denji/homebrew-nginx/issues/407
Brew install nginx-full --with-rtmp-module brew install nginx-full --with-rtmp-module https://github.com/denji/homebrew-nginx/issues/382
mv: nginx.xsc: No such file or directory while installing nginx-full --with-perl https://github.com/denji/homebrew-nginx/issues/361
`cp: /usr/local/etc/nginx/koi-win: Operation not permitted` installing nginx-full https://github.com/denji/homebrew-nginx/issues/359
building nginx-full with healthcheck module giving error https://github.com/denji/homebrew-nginx/issues/263
Compiler error when installing nginx-full ---with-upload-module https://github.com/denji/homebrew-nginx/issues/304
❯ brew install brotli
Warning: brotli 1.0.9 is already installed and up-to-date.
To reinstall 1.0.9, run:
  brew reinstall brotli

denji added a commit that referenced this issue Feb 22, 2023
@denji
Copy link
Owner

denji commented Feb 22, 2023

@usrtax This doesn't apply to the lua module, brotli is a different module and there seems to be a problem with fakeroot isolation when building the package (/usr?). Do you have the pcre2 brew package installed?

@usrtax
Copy link

usrtax commented Feb 22, 2023

@denji I installed pcre2 , the same error
image

==> Fetching denji/nginx/nginx-full
==> Downloading https://nginx.org/download/nginx-1.23.3.tar.gz
Already downloaded: /Users/z/Library/Caches/Homebrew/downloads/863e4f8cefb39e2c86b9797ec606b51137fe2b556c02f09e3ce9621a4034d6e6--nginx-1.23.3.tar.gz
==> Reinstalling denji/nginx/nginx-full --with-gzip-static --with-http2 --with-lua-module --with-set-misc-module
Warning: Calling plist_options is deprecated! Use service.require_root instead.
Please report this issue to the denji/nginx tap (not Homebrew/brew or Homebrew/homebrew-core), or even better, submit a PR to fix it:
  /opt/homebrew/Library/Taps/denji/homebrew-nginx/Formula/nginx-full.rb:377

==> ./configure --prefix=/opt/homebrew/Cellar/nginx-full/1.23.3 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-path=/opt/homebrew/Cellar/nginx
==> make install
Last 15 lines from /Users/z/Library/Logs/Homebrew/nginx-full/02.make:
  "_pcre_jit_stack_free", referenced from:
      _ngx_http_lua_ffi_set_jit_stack_size in ngx_http_lua_regex.o
  "_pcre_malloc", referenced from:
      _ngx_http_lua_pcre_malloc_init in ngx_http_lua_pcrefix.o
      _ngx_http_lua_pcre_malloc_done in ngx_http_lua_pcrefix.o
     (maybe you meant: _ngx_http_lua_pcre_malloc_done, _ngx_http_lua_pcre_malloc_init )
  "_pcre_study", referenced from:
      _ngx_http_lua_ffi_compile_regex in ngx_http_lua_regex.o
  "_pcre_version", referenced from:
      _ngx_http_lua_ffi_pcre_version in ngx_http_lua_regex.o
     (maybe you meant: _ngx_http_lua_ffi_pcre_version)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [objs/nginx] Error 1
make: *** [install] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/denji/homebrew-nginx/issues

These open issues may also help:
brew install nginx-full --with-njs-module          Error https://github.com/denji/homebrew-nginx/issues/419
`brew install nginx-full --with-lua-module` fails https://github.com/denji/homebrew-nginx/issues/407
Brew install nginx-full --with-rtmp-module brew install nginx-full --with-rtmp-module https://github.com/denji/homebrew-nginx/issues/382
mv: nginx.xsc: No such file or directory while installing nginx-full --with-perl https://github.com/denji/homebrew-nginx/issues/361
`cp: /usr/local/etc/nginx/koi-win: Operation not permitted` installing nginx-full https://github.com/denji/homebrew-nginx/issues/359
building nginx-full with healthcheck module giving error https://github.com/denji/homebrew-nginx/issues/263
Compiler error when installing nginx-full ---with-upload-module https://github.com/denji/homebrew-nginx/issues/304
❯ brew install pcre2
Warning: pcre2 10.42 is already installed and up-to-date.
To reinstall 10.42, run:
  brew reinstall pcre2

denji added a commit that referenced this issue Feb 22, 2023
denji added a commit that referenced this issue Feb 22, 2023
denji added a commit that referenced this issue Feb 22, 2023
denji added a commit that referenced this issue Feb 22, 2023
denji added a commit that referenced this issue Feb 22, 2023
denji added a commit that referenced this issue Feb 22, 2023
denji added a commit that referenced this issue Feb 22, 2023
denji added a commit that referenced this issue Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants