homebrew-brew icon indicating copy to clipboard operation
homebrew-brew copied to clipboard

Replace the deprecated 'geoip' dependency

Open Omoeba opened this issue 1 year ago • 1 comments
trafficstars

The geoip formula has been deprecated upstream. The authors of geoip recommends migrating to the libmaxminddb formula.

Omoeba avatar Jan 14 '24 00:01 Omoeba

Will anyone follow up with this? How is feasibility?

calvinit avatar Jul 26 '24 03:07 calvinit

Will anyone follow up with this? How is feasibility?

@zhuizhuhaomeng

calvinit avatar Oct 12 '24 07:10 calvinit

Fixed

zhuizhuhaomeng avatar Oct 12 '24 08:10 zhuizhuhaomeng

Fixed

@zhuizhuhaomeng Hi, it might not be possible to resolve this issue simply by modifying the depends_on item in Formula/openresty.rb, because the GeoIP module will still depend on this library (because of --with-http_geoip_module).

➜  ~ brew install openresty/brew/openresty
==> Tapping openresty/brew
Cloning into '/usr/local/Homebrew/Library/Taps/openresty/homebrew-brew'...
remote: Enumerating objects: 2984, done.
remote: Counting objects: 100% (152/152), done.
remote: Compressing objects: 100% (109/109), done.
remote: Total 2984 (delta 64), reused 70 (delta 43), pack-reused 2832 (from 1)
Receiving objects: 100% (2984/2984), 658.17 KiB | 3.48 MiB/s, done.
Resolving deltas: 100% (1652/1652), done.
Tapped 63 formulae (84 files, 823.8KB).
==> Fetching dependencies for openresty/brew/openresty: libmaxminddb and openresty/brew/openresty-openssl3
==> Fetching libmaxminddb
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/libmaxminddb-1.11.0.sonoma.bottle.tar.gz
################################################################################################################################################################################## 100.0%
==> Fetching openresty/brew/openresty-openssl3
==> Downloading https://raw.githubusercontent.com/openresty/openresty/master/patches/openssl-3.0.15-sess_set_get_cb_yield.patch
################################################################################################################################################################################## 100.0%
==> Downloading https://github.com/openssl/openssl/releases/download/openssl-3.0.15/openssl-3.0.15.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/7634677/3c20ec14-b294-4ab7-9440-8fc93414b244?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Cre
################################################################################################################################################################################## 100.0%
==> Fetching openresty/brew/openresty
==> Downloading https://openresty.org/download/openresty-1.27.1.1.tar.gz
################################################################################################################################################################################## 100.0%
==> Installing openresty from openresty/brew
==> Installing dependencies for openresty/brew/openresty: libmaxminddb and openresty/brew/openresty-openssl3
==> Installing openresty/brew/openresty dependency: libmaxminddb
==> Pouring libmaxminddb-1.11.0.sonoma.bottle.tar.gz
🍺  /usr/local/Cellar/libmaxminddb/1.11.0: 31 files, 175.6KB
==> Installing openresty/brew/openresty dependency: openresty/brew/openresty-openssl3
==> Patching
==> Applying openssl-3.0.15-sess_set_get_cb_yield.patch
patching file 'include/openssl/bio.h.in'
patching file 'include/openssl/ssl.h.in'
patching file 'ssl/bio_ssl.c'
patching file 'ssl/ssl_lib.c'
patching file 'ssl/ssl_sess.c'
patching file 'ssl/statem/statem_srvr.c'
patching file 'util/libssl.num'
==> perl ./Configure --prefix=/usr/local/Cellar/openresty-openssl3/3.0.15_1 --openssldir=/usr/local/etc/openssl@(3.0.15) --libdir=lib no-threads shared zlib -g enable-ssl3 enable-ssl3-m
==> make
==> make install MANDIR=/usr/local/Cellar/openresty-openssl3/3.0.15_1/share/man MANSUFFIX=ssl
🍺  /usr/local/Cellar/openresty-openssl3/3.0.15_1: 6,554 files, 28.5MB, built in 3 minutes 21 seconds
==> Installing openresty/brew/openresty
==> ./configure -j12 --pid-path=/usr/local/var/run/openresty.pid --lock-path=/usr/local/var/run/openresty.lock --conf-path=/usr/local/etc/openresty/nginx.conf --http-log-path=/usr/local
Last 15 lines from /Users/calvinit/Library/Logs/Homebrew/openresty/01.configure:
checking for SA_RESTART ... found
 + ngx_stream_lua_module was configured
checking for PCRE2 library ... found
checking for OpenSSL library ... found
checking for zlib library ... found
checking for GeoIP library ... not found
checking for GeoIP library in /usr/local/ ... not found
checking for GeoIP library in /usr/pkg/ ... not found
checking for GeoIP library in /opt/local/ ... not found
checking for GeoIP library in /opt/homebrew/ ... not found

./configure: error: the GeoIP module requires the GeoIP library.
You can either do not enable the module or install the library.

ERROR: failed to run command: sh ./configure --prefix=/usr/local/Cellar/openresty/1.27.1.1_1/nginx \...

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

These open issues may also help:
homeBrew update 1.27 Error [1]    40929 segmentation fault  openresty https://github.com/openresty/homebrew-brew/issues/44
Openresty dies with `terminated by signal SIGSEGV` after upgrade to 1.25.3.2 https://github.com/openresty/homebrew-brew/issues/42
The openresty-debug package should use openresty-openssl-debug instead https://github.com/openresty/homebrew-brew/issues/3
Fails to install OpenResty https://github.com/openresty/homebrew-brew/issues/5

At the same time, I noticed from the installation log that the dependency is on the PCRE2 library, but the depends_on in Formula/openresty.rb is set to pcre. Could it also be upgraded to PCRE2 as well?

calvinit avatar Oct 12 '24 11:10 calvinit

Thanks for your feedback.

zhuizhuhaomeng avatar Oct 12 '24 13:10 zhuizhuhaomeng

Thanks for your feedback.

@zhuizhuhaomeng

I noticed that this repository already has the Formula for geoip2-nginx-module. I'm wondering if it's possible to use it directly instead of libmaxminddb?

I tried replacing libmaxminddb with openresty/brew/geoip2-nginx-module, then adding --add-module=#{Formula["openresty/brew/geoip2-nginx-module"].opt_prefix}/share/geoip2-nginx-module or --add-dynamic-module=#{Formula["openresty/brew/geoip2-nginx-module"].opt_prefix}/share/geoip2-nginx-module (along with --with-compat), and removing --with-http_geoip_module. This allowed the build to succeed, but after installing, it seems nginx hangs when starting (unable to start normally). I'm not sure if there's something else I haven't considered.

By the way, should this change also be made in openresty-debug.rb?

calvinit avatar Oct 12 '24 14:10 calvinit