From owner-svn-ports-head@freebsd.org Mon Jan 30 13:17:49 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85C2ACC7FEF; Mon, 30 Jan 2017 13:17:49 +0000 (UTC) (envelope-from freebsd.contact@marino.st) Received: from shepard.synsport.com (mail.synsport.com [208.69.230.148]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60A4E1393; Mon, 30 Jan 2017 13:17:48 +0000 (UTC) (envelope-from freebsd.contact@marino.st) Received: from [127.0.0.1] (ip72-204-83-236.fv.ks.cox.net [72.204.83.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by shepard.synsport.com (Postfix) with ESMTP id 04B7043BF0; Mon, 30 Jan 2017 07:16:08 -0600 (CST) Subject: Re: svn commit: r432458 - in head/databases: mysql56-client mysql56-client/files mysql56-server mysql56-server/files To: Bernard Spil , marino@freebsd.org, mokhi64@gmail.com References: <201701251907.v0PJ78fZ061674@repo.freebsd.org> <796ba016-0c35-f368-5115-3a8a1ec4cfec@marino.st> Cc: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Reply-To: marino@freebsd.org From: John Marino Message-ID: <54a4e7df-7435-aadd-d896-5a90e97a62ce@marino.st> Date: Mon, 30 Jan 2017 07:17:44 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 170130-0, 01/30/2017), Outbound message X-Antivirus-Status: Clean X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 13:17:49 -0000 On 1/30/2017 03:07, Bernard Spil wrote: > On 2017-01-29 20:50, John Marino wrote: >> On 1/25/2017 13:07, Bernard Spil wrote: >>> Author: brnrd >>> Date: Wed Jan 25 19:07:08 2017 >>> New Revision: 432458 >>> URL: https://svnweb.freebsd.org/changeset/ports/432458 >>> >>> Log: >>> databases/mysql56-server: Fix OpenSSL linking >>> >>> - Force dynamic linking with OpenSSL >>> >>> MFH: 2017Q1 >>> >>> Added: >>> head/databases/mysql56-client/files/patch-cmake_ssl.cmake >>> (contents, props changed) >>> head/databases/mysql56-server/files/patch-cmake_ssl.cmake >>> (contents, props changed) >>> Modified: >>> head/databases/mysql56-client/Makefile >>> head/databases/mysql56-server/Makefile >>> >>> Modified: head/databases/mysql56-client/Makefile >>> ============================================================================== >>> >>> --- head/databases/mysql56-client/Makefile Wed Jan 25 18:59:23 >>> 2017 (r432457) >>> +++ head/databases/mysql56-client/Makefile Wed Jan 25 19:07:08 >>> 2017 (r432458) >>> @@ -2,7 +2,7 @@ >>> # $FreeBSD$ >>> >>> PORTNAME= mysql >>> -PORTREVISION?= 0 >>> +PORTREVISION?= 1 >>> PKGNAMESUFFIX= 56-client >>> >>> COMMENT= Multithreaded SQL database (client) >>> >>> Added: head/databases/mysql56-client/files/patch-cmake_ssl.cmake >>> ============================================================================== >>> >>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>> +++ head/databases/mysql56-client/files/patch-cmake_ssl.cmake Wed >>> Jan 25 19:07:08 2017 (r432458) >>> @@ -0,0 +1,11 @@ >>> +--- cmake/ssl.cmake.orig 2016-11-28 13:36:22 UTC >>> ++++ cmake/ssl.cmake >>> +@@ -176,7 +176,7 @@ MACRO (MYSQL_CHECK_SSL) >>> + IF(OPENSSL_INCLUDE_DIR AND >>> + OPENSSL_LIBRARY AND >>> + CRYPTO_LIBRARY AND >>> +- OPENSSL_MAJOR_VERSION STREQUAL "1" >>> ++ OPENSSL_MAJOR_VERSION VERSION_GREATER_EQUAL "1" >>> + ) >>> + SET(OPENSSL_FOUND TRUE) >>> + ELSE() >>> >>> Modified: head/databases/mysql56-server/Makefile >>> ============================================================================== >>> >>> --- head/databases/mysql56-server/Makefile Wed Jan 25 18:59:23 >>> 2017 (r432457) >>> +++ head/databases/mysql56-server/Makefile Wed Jan 25 19:07:08 >>> 2017 (r432458) >>> @@ -3,7 +3,7 @@ >>> >>> PORTNAME?= mysql >>> PORTVERSION= 5.6.35 >>> -PORTREVISION?= 2 >>> +PORTREVISION?= 3 >>> CATEGORIES= databases ipv6 >>> MASTER_SITES= MYSQL/MySQL-5.6 >>> PKGNAMESUFFIX?= 56-server >>> @@ -54,6 +54,9 @@ CMAKE_ARGS+= -DINSTALL_LAYOUT=FREEBSD \ >>> -DWITH_LIBEVENT=system \ >>> -DWITH_LZ4=system \ >>> -DWITH_ZLIB=system \ >>> + -DWITH_SSL=${OPENSSLBASE} \ >>> + -DCRYPTO_LIBRARY=${OPENSSLLIB}/libcrypto.so \ >>> + -DOPENSSL_LIBRARY=${OPENSSLLIB}/libssl.so \ >>> -DINSTALL_MYSQLTESTDIR=0 >>> >>> SHEBANG_FILES= scripts/*.pl* scripts/*.sh >>> @@ -129,12 +132,6 @@ PERFSCHM_SUB_LIST_OFF+= PERFSCHEMRC="--s >>> >>> .include >>> >>> -.if ${SSL_DEFAULT} == base >>> -CMAKE_ARGS+= -DWITH_SSL=system >>> -.else >>> -CMAKE_ARGS+= -DWITH_SSL=${OPENSSLBASE} >>> -.endif >>> - >>> post-patch: >>> @${REINPLACE_CMD} 's/*.1/${MMAN1}/' ${WRKSRC}/man/CMakeLists.txt >>> >>> >>> Added: head/databases/mysql56-server/files/patch-cmake_ssl.cmake >>> ============================================================================== >>> >>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>> +++ head/databases/mysql56-server/files/patch-cmake_ssl.cmake Wed >>> Jan 25 19:07:08 2017 (r432458) >>> @@ -0,0 +1,11 @@ >>> +--- cmake/ssl.cmake.orig 2016-11-28 13:36:22 UTC >>> ++++ cmake/ssl.cmake >>> +@@ -176,7 +176,7 @@ MACRO (MYSQL_CHECK_SSL) >>> + IF(OPENSSL_INCLUDE_DIR AND >>> + OPENSSL_LIBRARY AND >>> + CRYPTO_LIBRARY AND >>> +- OPENSSL_MAJOR_VERSION STREQUAL "1" >>> ++ OPENSSL_MAJOR_VERSION VERSION_GREATER_EQUAL "1" >>> + ) >>> + SET(OPENSSL_FOUND TRUE) >>> + ELSE() >>> >> >> Interestingly, this actually broke several ports for us: >> benchmarks sysbench >> databases apq-mysql >> databases mysql-connector-c++ >> mail qmail-mysql >> security pam-mysql >> >> typical message: >> /usr/libexec/binutils227/elf/ld.gold: error: cannot find -lssl >> /usr/libexec/binutils227/elf/ld.gold: error: cannot find -lcrypto >> >> I think mysql_config is to blame: >> >> checking for mysql_config... /usr/local/bin/mysql_config >> checking MySQL C flags... -I/usr/local/include/mysql -isystem >> /usr/local/include -fno-strict-aliasing -g -fno-omit-frame-pointer >> -fno-strict-aliasing >> checking MySQL linker flags... -L/usr/local/lib/mysql -lmysqlclient_r >> -pthread -lz -lm -lexecinfo -lssl -lcrypto >> >> It's not adding -L/usr/local/lib for ports' openssl ports. >> >> John >> > Hi John, > > That's actually an error in MySQL... We are passing it the OpenSSL root > and the shared libs. > MySQL (and MariaDB) builds favour static linking, so I guess they've not > even thought of adding it to the pkgconfig. > > For MariaDB 10.1 it does add /usr/local/lib (mind you, on my system it > will link ssl and crypto from base) > $ mysql_config --cflags > -I/usr/local/include/mysql -I/usr/local/include/mysql/.. > $ mysql_config --libs > -L/usr/local/lib/mysql -lmysqlclient -pthread -lz -lm -lexecinfo -lssl > -lcrypto -L/usr/local/lib > $ mysql_config --libs_r > -L/usr/local/lib/mysql -lmysqlclient -pthread -lz -lm -lexecinfo -lssl > -lcrypto -L/usr/local/lib > > Cheers, > > Bernard. > Yes, I know it's a error in MySQL. We fixed it locally in dports via a post-stage hack. It remains broken but undetected on FreeBSD. Even if SSL_DEFAULT is set on FreeBSD, those port will like to the base openssl libraries by mistake. (FYI, even if vendor has an issue doesn't excuse not fixing downstream issues caused by commits. In other words, ideally saying "it's MySQL's" fault shouldn't be the end of it.). John --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus