Bug 233243 - www/nginx builds against OpenSSL111 in poudriere but sets the library path to /usr/lib
Summary: www/nginx builds against OpenSSL111 in poudriere but sets the library path to...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: i386 Any
: --- Affects Some People
Assignee: Jochen Neumeister
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-15 20:12 UTC by reko.turja
Modified: 2018-11-26 13:59 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (joneum)


Attachments
svn diff for www/nginx (484 bytes, patch)
2018-11-18 09:42 UTC, Bernard Spil
brnrd: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description reko.turja 2018-11-15 20:12:56 UTC
It seems that www/nginx builds nicely against OpenSSL 1.1.1 in Poudriere environment, but then linker uses /usr/lib for libcrypto.so and libssl.so:

/usr/local/sbin/nginx:
        libthr.so.3 => /lib/libthr.so.3 (0x28122000)
        libcrypt.so.5 => /lib/libcrypt.so.5 (0x28145000)
        libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x28164000)
        libssl.so => /usr/lib/libssl.so (0x281f2000)
        libcrypto.so => /usr/lib/libcrypto.so (0x2824b000)
        libz.so.6 => /lib/libz.so.6 (0x283dc000)
        libc.so.7 => /lib/libc.so.7 (0x283f2000)

service nginx restart
Performing sanity check on nginx configuration:
/usr/local/sbin/nginx: Undefined symbol "OPENSSL_init_ssl"

When I do:

root@xxx:/usr/lib # rm libssl.so
root@xxx:/usr/lib # rm libcrypto.so
root@xxx:/usr/lib # ln -s /usr/local/lib
lib/     libdata/ libexec/ 
root@xxx:/usr/lib # ln -s /usr/local/lib/libcrypto.so.11 libcrypto.so
root@xxx:/usr/lib # ln -s /usr/local/lib/libssl.so.11 libssl.so
root@xxx:/usr/lib # service nginx restart
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@xxx:/usr/lib # 

Nginx starts as expected.
My make.conf for poudriere jail is:
DEFAULT_VERSIONS        += ssl=openssl111 python=3.6 python2=2.7 python3=3.6 perl5=5.26
OPTIONS_UNSET           += GSSAPI_BASE
OPTIONS_SET             += GSSAPI_NONE
OPTIONS_UNSET           += X11 MYSQL GNOME NIS DEBUG HELP GNUTLS NLS DBUS SOUND \
        ALSA PULSEAUDIO DOCBOOK CUPS TESTS HTMLDOCS BONJOUR GSSAPI APIDOCS
WITH_PKG=yes

and src.conf:

WITHOUT_UNBOUND=yes
WITHOUT_APM=yes
WITHOUT_ATM=yes
WITHOUT_BLUETOOTH=yes
WITHOUT_CDDL=yes
WITHOUT_FLOPPY=yes
WITHOUT_FORTRAN=yes
WITHOUT_GSSAPI=yes
WITHOUT_I4B=yes
WITH_IDEA=yes
WITHOUT_INFO=yes
WITHOUT_IPFILTER=yes
WITHOUT_IPFW=yes
WITHOUT_IPX=yes
WITHOUT_KERBEROS=yes
WITHOUT_LDNS=yes
WITHOUT_NIS=yes
WITHOUT_PROFILE=yes
WITHOUT_RCMDS=yes
WITHOUT_SENDMAIL=yes
WITHOUT_WPA_SUPPLICANT_EAPOL=yes
WITHOUT_WIRELESS=yes
WITHOUT_ZFS=yes
WITHOUT_NTP=YES
WITHOUT_NIS=YES
Comment 1 reko.turja 2018-11-15 20:15:48 UTC
This happens on FreeBSD 11.2-p4 i386 (both poudriere jail and run environment), not on FBSD 12.x which i reckon uses OpenSSL111 as default
Comment 2 reko.turja 2018-11-15 20:41:23 UTC
Sorry for being noisy and giving information little at a time. "pkg info nginx" gives:

Shared Libs required:
        libpcre.so.1
Annotations    :
        FreeBSD_version: 1102000
        cpe            : cpe:2.3:a:nginx:nginx:1.14.1:::::freebsd11:x86
        repo_type      : binary
        repository     : poudriere
Flat size      : 1.06MiB
Comment 3 Bernard Spil freebsd_committer 2018-11-18 09:42:45 UTC
Created attachment 199308 [details]
svn diff for www/nginx

Hi Reko,

Sounds like an issue with runtime directory search for libs. Can you try the attached patch and post the result here?

Cheers, Bernard
Comment 4 reko.turja 2018-11-18 13:07:02 UTC
Thank you very much Bernard!

Nginx is behaving now as expected, please see the "evidence" below.

-Reko


root@xxx:/usr/local/www/nginx-dist/packages # ldd /usr/local/sbin/nginx 
/usr/local/sbin/nginx:
        libthr.so.3 => /lib/libthr.so.3 (0x2810d000)
        libcrypt.so.5 => /lib/libcrypt.so.5 (0x28130000)
        libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x2814f000)
        libssl.so => /usr/local/lib/libssl.so (0x281dd000)
        libcrypto.so => /usr/local/lib/libcrypto.so (0x28252000)
        libz.so.6 => /lib/libz.so.6 (0x2844e000)
        libc.so.7 => /lib/libc.so.7 (0x28464000)
root@xxx:/usr/local/www/nginx-dist/packages # service nginx restart
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@xxx:/usr/local/www/nginx-dist/packages #
Comment 5 commit-hook freebsd_committer 2018-11-26 13:58:35 UTC
A commit references this bug:

Author: joneum
Date: Mon Nov 26 13:58:10 UTC 2018
New revision: 485941
URL: https://svnweb.freebsd.org/changeset/ports/485941

Log:
  Fix for build OpenSSL, set the correct library path

  PR:		233243
  Submitted by:	brnrd
  Reported by:	reko.turja@liukuma.net
  Sponsored by:	Netzkommune GmbH

Changes:
  head/www/nginx/Makefile