Bug 250981

Summary: sysutils/goaccess linker_error with OpenSSL from ports
Product: Ports & Packages Reporter: Miroslav Lachman <000.fbsd>
Component: Individual Port(s)Assignee: Sofian Brabez <sbz>
Status: In Progress ---    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (sbz)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
poudriere build log none

Description Miroslav Lachman 2020-11-09 15:57:32 UTC
Created attachment 219491 [details]
poudriere build log

goaccess cannot be built with OpenSSL from ports:

cc -O2 -DSYSCONFDIR=\"/usr/local/etc\" -Wall  -Wextra -Wnested-externs -Wformat=2  -Wmissing-prototypes -Wstrict-prototypes  -Wmissing-declarations -Wwrite-strings -Wshadow  -Wpointer-arith -Wsign-compare  -Wbad-function-cast -Wcast-align  -Wdeclaration-after-statement -Wshadow  -Wold-style-definition -O2 -pipe  -I/usr/include -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing  -pthread -rdynamic -L/usr/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib -fstack-protector-strong -o goaccess src/base64.o src/browsers.o  src/color.o src/commons.o src/csv.o  src/error.o src/gdashboard.o  src/gdns.o src/gholder.o src/gkhash.o  src/gmenu.o src/goaccess.o  src/gslist.o src/gstorage.o  src/gwsocket.o src/json.o src/opesys.o  src/options.o src/output.o  src/parser.o src/settings.o src/sha1.o  src/sort.o src/tpl.o src/ui.o  src/util.o src/websocket.o  src/xmalloc.o    -lncursesw -lcrypto -lssl -lpthread
src/websocket.o: In function `ws_start':
websocket.c:(.text+0xf12): undefined reference to `OPENSSL_init_ssl'
websocket.c:(.text+0xf17): undefined reference to `TLS_server_method'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[3]: stopped in /wrkdirs/usr/ports/sysutils/goaccess/work/goaccess-1.4
*** Error code 1
Comment 1 Sofian Brabez freebsd_committer 2021-03-11 18:52:47 UTC
Hi Miroslav,

I have just updated sysutils/goaccess to 1.4.6 since r568103. 1.4.1 is obsolete, is it still the case? Also, what is the reason to use OpenSSL from ports, it's already in base?
Comment 2 Miroslav Lachman 2021-03-11 21:08:36 UTC
The reason is FreeBSD 11.4. It contains old OpenSSL 1.0 in base but many apps cannot be built with OpenSSL 1.0 or lack some features provided by OpenSSL 1.1 thus we build everything in poudriere with ports OpenSSL 1.1.1.

I cannot test new version of goaccess right now because I have some troubles updating my FreeBSD based desktop computer but I will let you know when time permits.
Comment 3 Sofian Brabez freebsd_committer 2021-03-29 08:00:10 UTC
Hi Miroslav,

Alright, I understand better know, we could add an option to build with openssl from base if you really need and it's supported, but by no mean it will be enabled by default.
Comment 4 Miroslav Lachman 2021-03-30 18:51:59 UTC
It definitely should not be the default option. Maybe there is no need to have it as user editable option at all because everything the user needs to do to use OpenSSL from ports is add ssl=openssl to DEFAULT_VERSIONS in the make.conf.
Then every port should be rebuilt with dependency on security/openssl
I don't know how it is handled by /ports/Mk/ and what needs to be done in port's Makefile to properly link to whatever SSL version is chosen.
Comment 5 Sofian Brabez freebsd_committer 2021-04-14 21:00:42 UTC
Hi,

Yes, it uses USE=ssl which is part of the framework to handle everything related to ssl build dependencies. You can have a look at ${PORTSDIR}/Mk/Uses/ssl.mk for the details. Even after configuring /etc/make.conf to use openssl from port I cannot reproduce it.

$ grep ssl /etc/make.conf
DEFAULT_VERSIONS+=	ssl=openssl

Also, I have noticed that from the poudriere build log attached the jail is 11.4-RELEASE-p1, would you mind to try on more recent versions? 12.2 or 13.0