Bug 243854

Summary: net-mgmt/net-snmp: Failed: build
Product: Ports & Packages Reporter: Danny McGrath <danmcgrath.ca>
Component: Individual Port(s)Assignee: Ryan Steinmetz <zi>
Status: Closed Overcome By Events    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (zi)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Danny McGrath 2020-02-03 21:17:32 UTC
Seems I can't get net-snmp-5.7.3_20,1 to build for 11.3. I have pasted the most relevant/obvious logs. Any ideas?

keytools.c:155:24: error: invalid application of 'sizeof' to an incomplete type 'EVP_MD_CTX' (aka 'struct evp_md_ctx_st')
    ctx = malloc(sizeof(*ctx));
                       ^~~~~~
/usr/local/include/openssl/ossl_typ.h:92:16: note: forward declaration of 'struct evp_md_ctx_st'
typedef struct evp_md_ctx_st EVP_MD_CTX;
               ^
keytools.c:265:9: warning: implicit declaration of function 'EVP_MD_CTX_cleanup' is invalid in C99 [-Wimplicit-function-declaration]
        EVP_MD_CTX_cleanup(ctx);
        ^
1 warning and 1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /wrkdirs/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.3/snmplib
*** Error code 1
Comment 1 Ryan Steinmetz freebsd_committer freebsd_triage 2020-02-09 01:21:59 UTC
What's in your make.conf?

What OPTIONS do you have set for the port?
Comment 2 Danny McGrath 2020-02-09 02:10:01 UTC
About the only things that I would think are relevant would be:

OPTIONS_SET+= ZTS GSSAPI_NONE
OPTIONS_UNSET+= CUPS DBUS X11 DOCBOOK EXAMPLES KERBEROS PERFSCHEMA PERFSCHM GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_MIT WAYLAND OPENGL XCB
DEFAULT_VERSIONS+= ssl=openssl
net-mgmt_zabbix4-proxy_UNSET+= PGSQL MYSQL
net-mgmt_zabbix4-proxy_SET+= SQLITE

I can only assume something with OpenSSL, and there were some peculiar OpenSSL 1.1.1d issues recently. Ideas?
Comment 3 Danny McGrath 2020-02-18 03:28:04 UTC
I had a chance do some some tests in a VM on fresh 11.3, and it appears that ssl=base and ssl=libressl build fine, as does an empty make.conf. It is specifically only ssl=openssl (and otherwise empty make.conf) that is failing.

Hopefully this helps.
Comment 4 Danny McGrath 2020-02-18 03:49:50 UTC
(In reply to Danny McGrath from comment #3)

This test was against 2020Q1, btw.

Also interesting was that I was able to just compile fine against the same version in head.

A quick look at the diff between 2020Q1 and head shows:

svn diff https://svn.freebsd.org/ports/branches/2020Q1/net-mgmt/net-snmp  https://svn.freebsd.org/ports/head/net-mgmt/net-snmp
Index: Makefile
===================================================================
--- Makefile    (.../branches/2020Q1/net-mgmt/net-snmp) (revision 526437)
+++ Makefile    (.../head/net-mgmt/net-snmp)    (revision 526437)
@@ -74,7 +74,7 @@
 
 .include <bsd.port.options.mk>
 
-.if (${OSVERSION} >= 1200085 || ${SSL_DEFAULT:Mopenssl111*})
+.if (${OPSYS} == FreeBSD && ${OSVERSION} >= 1200085) || ${SSL_DEFAULT:Mopenssl}
 EXTRA_PATCHES= ${PATCHDIR}/extra-patch-openssl11
 .endif
 
@@ -249,7 +249,7 @@
            ${WRKSRC}/agent/mibgroup/host/hr_system.c
        @${REINPLACE_CMD} -E -e 's|return pci_lookup_name|disabled broken|g' \
                ${WRKSRC}/configure
-.if (${OSVERSION} >= 1200085 || ${SSL_DEFAULT:Mopenssl111*})
+.if (${OPSYS} == FreeBSD && ${OSVERSION} >= 1200085) || ${SSL_DEFAULT:Mopenssl}
        @${REINPLACE_CMD} -E -e 's|SSL_library_init|OPENSSL_init_ssl|g' \
                ${WRKSRC}/configure
 .endif


I do recall that there was a change over for the package that renamed the openssl111 package back to openssl, if that helps.
Comment 5 Danny McGrath 2020-02-18 04:13:12 UTC
A quick recompile with the head changes applied to 2020Q1 seems to work here. Any chance this can be merged to 2020Q1? It is currently holding up some zabbix-proxy ports for me, and I prefer not to edit upstream, if I can help it.