After running pkg_add -u on -current, nginx and nginx-stream were
updated to 1.30.8. Restarting nginx fails:
$ doas /etc/rc.d/nginx -d restart
doing _rc_parse_conf
nginx_flags empty, using default ><
doing _rc_parse_conf /var/run/rc.d/nginx
doing rc_configtest
nginx:/var/www/modules/ngx_stream_module.so: undefined symbol
'SSL_CTX_set_cert_cb'
nginx:/var/www/modules/ngx_stream_module.so: undefined symbol
'SSL_CTX_set_options'
nginx:/var/www/modules/ngx_stream_module.so: undefined symbol
'SSL_get1_peer_certificate'
nginx:/var/www/modules/ngx_stream_module.so: undefined symbol 'SSL_get_options'
nginx:/var/www/modules/ngx_stream_module.so: undefined symbol
'SSL_CTX_get_options'
nginx:/var/www/modules/ngx_stream_module.so: undefined symbol
'SSL_clear_options'
nginx:/var/www/modules/ngx_stream_module.so: undefined symbol 'SSL_set_options'
nginx: [emerg] dlopen() "/var/www/modules/ngx_stream_module.so" failed (Cannot
load specified object) in /etc/nginx/nginx.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
(failed)
The installed nginx reports `built with LibreSSL 4.4.0` and loads
/usr/lib/libssl.so.60.2. The stream module has undefined references to
the symbols above, none of which appear in that library’s dynamic symbol
table.
I suspect the stream module was built against OpenSSL while nginx was
built against LibreSSL. Currently, the Makefile strips the openssl
FLAVOR from subpackage names and paths, so the two stream builds have
the same package identity.
The diff below keeps the FLAVOR on the stream package and makes it
depend on the matching nginx FLAVOR.
OK?
diff --git Makefile Makefile
index 1b17413a8fc..e19c5d7528e 100644
--- Makefile
+++ Makefile
@@ -23,6 +23,7 @@ VERSION= 1.30.8
DISTNAME= nginx-${VERSION}
CATEGORIES= www
REVISION-ldap_auth= 0
+REVISION-stream= 0
PKGNAME-main= ${DISTNAME}
@@ -74,9 +75,8 @@ MODULE_PACKAGES = -cache_purge -geoip2 -headers_more \
-modsecurity -njs -rtmp \
-securelink -stream -xslt
-# subpackages aren't flavoured, so overwrite the default name/path except
-# for the debug flavor, which applies to all subpackages
-.for _S in ${MULTI_PACKAGES:N-main}
+# Most subpackages are not OpenSSL-flavoured; stream must match nginx.
+.for _S in ${MULTI_PACKAGES:N-main:N-stream}
FULLPKGNAME${_S}?= ${PKGNAME${_S}}${FLAVOR_EXT:S/-openssl//}
FULLPKGPATH${_S}?= ${PKGPATH},${_S}${FLAVOR_EXT:S/-openssl//:S/-/,/g}
.endfor
@@ -129,6 +129,7 @@ LIB_DEPENDS-xslt= textproc/libxml \
MODLUA_RUNDEP= No
RUN_DEPENDS= www/nginx,-main=${VERSION}
RUN_DEPENDS-main= # blank (override default)
+RUN_DEPENDS-stream=
${FULLPKGNAME-main}${NO_OPENSSL}${NO_DEBUG}:${BASE_PKGPATH},-main
RUN_DEPENDS-lua= ${RUN_DEPENDS} \
${_MODLUA_RUN_DEPENDS} \
devel/pcre
@@ -155,6 +156,8 @@ MODULES+= perl
.if ${FLAVOR:Mdebug}
CONFIGURE_ARGS+= --with-debug
+.else
+NO_DEBUG= -!debug
.endif
.if ${FLAVOR:Mopenssl}
@@ -168,6 +171,7 @@ WANTLIB-main+= lib/${EOPENSSL_VSN}/crypto
lib/${EOPENSSL_VSN}/ssl
SUBST_VARS+= EOPENSSL_LIB EOPENSSL_INC
.else
WANTLIB-main+= crypto ssl
+NO_OPENSSL= -!openssl
.endif
.if ${BUILD_PACKAGES:M-lua}