Bug 198812

Summary: databases/mysql56-server, databases/mysql56-client: Use system not bundled zlib
Product: Ports & Packages Reporter: Matthias Andree <mandree>
Component: Individual Port(s)Assignee: Mark Felder <feld>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: ale, feld, klaus, lukasz, mmokhi, rootservice
Priority: --- Keywords: patch, patch-ready
Version: LatestFlags: bugzilla: maintainer-feedback? (ale)
mandree: merge-quarterly?
Hardware: Any   
OS: Any   
URL: http://article.gmane.org/gmane.mail.postfix.user/249946
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206215
Bug Depends on: 216244    
Bug Blocks:    
Attachments:
Description Flags
patch to make MySQL use the system's zlib
none
patch fixes this issue for mysql57
mmokhi: maintainer-approval+
patch fixes issue for mysql5.6 mmokhi: maintainer-approval? (ale)

Description Matthias Andree freebsd_committer freebsd_triage 2015-03-22 22:54:47 UTC
mysql56-client statically links in the bundled zlib, which is older than FreeBSD's system zlib.

This causes problems in Postfix if it is compiled to use MySQL because other libraries in Postfix need the system libz for dlopen(), but since the symbols are already defined from the bundled libz, the system libz symbols won't be bound.  Since the implementations (/lib/libz.so vs. the mysql-bundled zlib) aren't compatible, this causes crashes.

Evidence:

http://thread.gmane.org/gmane.mail.postfix.user/249888/focus=249910

(and the thread surrounding it, which reflects the entire debugging procedure)


I am proposing the attached patch to remedy the problem.
Alternatively, someone could debug the build and find out why MySQL56-client cannot find the zlib and resorts to the bundled one.  I am not sufficiently familiar with debugging cmake rigs to assist here.
Comment 1 Matthias Andree freebsd_committer freebsd_triage 2015-03-22 22:55:12 UTC
*** Bug 198811 has been marked as a duplicate of this bug. ***
Comment 2 Matthias Andree freebsd_committer freebsd_triage 2015-03-22 22:58:09 UTC
Also, see in particular this one:

http://article.gmane.org/gmane.mail.postfix.user/249946
Comment 3 Matthias Andree freebsd_committer freebsd_triage 2015-03-22 22:59:22 UTC
Created attachment 154683 [details]
patch to make MySQL use the system's zlib
Comment 4 Pete French 2015-09-08 12:41:07 UTC
is there any porgress on having this applied to the ports tree ? I just hit this as an issue as I am trying to staticly link an executable which uses both mysql and gzopen. IIf I link againsy mysql it cannot find gzopen, and if I link in the system zlib it complains about multiply defined symbols. Am sure I can work around it, but its a real pain for now...
Comment 5 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-02-14 16:41:57 UTC
Created attachment 166989 [details]
patch fixes this issue for mysql57

This patch makes mysql57 to use system libs (and adds configurable options for user too)
Comment 6 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-02-14 16:42:55 UTC
Created attachment 166990 [details]
patch fixes issue for mysql5.6

This patch makes mysql56 to use system libs (and adds configurable options for user too)
Comment 7 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-02-14 16:50:24 UTC
Both patches
portlint:
for mysql57 is OK
for 56, patches should be generated using make makepatch (instead of diff) [it's only WARN not fatal ;D and it's off-topic for this issue]

poudriere:
Okay (9.3 10.1 11.0)
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2016-02-15 04:38:22 UTC
*** Bug 206215 has been marked as a duplicate of this bug. ***
Comment 9 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-02-15 16:18:44 UTC
*** Bug 207197 has been marked as a duplicate of this bug. ***
Comment 10 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-04-15 16:00:47 UTC
Comment on attachment 166989 [details]
patch fixes this issue for mysql57

With updating to 5.7.12 we won't need this patch anymore.
Comment 11 Matthias Andree freebsd_committer freebsd_triage 2016-11-09 22:35:25 UTC
ping
Comment 12 commit-hook freebsd_committer freebsd_triage 2017-01-19 22:29:57 UTC
A commit references this bug:

Author: feld
Date: Thu Jan 19 22:29:06 UTC 2017
New revision: 431919
URL: https://svnweb.freebsd.org/changeset/ports/431919

Log:
  databases/mysql56: Update to 5.6.35

  - Port improvements from MySQL 5.7 port
  - Use system libs instead of bundled
  - Fix many open PRs
  - Change MAINTAINER

  PR:		216244 192657 198812 199751 205093
  PR:		209618 211248 205983 209338

Changes:
  head/databases/mysql56-client/Makefile
  head/databases/mysql56-client/files/patch-CMakeLists.txt
  head/databases/mysql56-client/files/patch-extra_CMakeLists.txt
  head/databases/mysql56-client/files/patch-man_CMakeLists.txt
  head/databases/mysql56-client/files/patch-mysys_ssl_my_default.cc
  head/databases/mysql56-client/files/patch-scripts_CMakeLists.txt
  head/databases/mysql56-client/files/patch-support-files_CMakeLists.txt
  head/databases/mysql56-client/pkg-message
  head/databases/mysql56-server/Makefile
  head/databases/mysql56-server/distinfo
  head/databases/mysql56-server/files/my.cnf.sample.in
  head/databases/mysql56-server/files/mysql-server.in
  head/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc
  head/databases/mysql56-server/pkg-message
  head/databases/mysql56-server/pkg-plist
Comment 13 commit-hook freebsd_committer freebsd_triage 2017-01-26 19:58:24 UTC
A commit references this bug:

Author: brnrd
Date: Thu Jan 26 19:58:06 UTC 2017
New revision: 432535
URL: https://svnweb.freebsd.org/changeset/ports/432535

Log:
  MFH: r431919 r431968 r431975 r432035 r432066 r432458

  databases/mysql56: Update to 5.6.35

  - Port improvements from MySQL 5.7 port
  - Use system libs instead of bundled
  - Fix many open PRs
  - Change MAINTAINER

  PR:		216244 192657 198812 199751 205093
  PR:		209618 211248 205983 209338

  databases/mysql56-server: Rollback rc script changes

  databases/mysql56-server: Do not install my.cnf sample

  An issue was discovered where users of mysql did not have a my.cnf and
  the recent update was causing mysqld to find a sample my.cnf and load
  its parameters. This was causing errors on startup for users of innodb
  as the parameters used to init the database did not match the ones in
  the sample config file it was now reading.

  databases/mysql56-server: Fix build with LibreSSL

    - Fix CMake SSL detection
    - Always set WITH_SSL=${OPENSSLBASE}

  PR:		216311
  Approved by:	Mahdi Moktari <mokhi64@gmail.com> (maintainer)
  Differential Revision:	D9272

  Revert r432035 part 2, it breaks build with openssl from base

  With hat:	portmgr

  databases/mysql56-server: Fix OpenSSL linking

    - Force dynamic linking with OpenSSL

  Approved by:	ports-secteam (feld)

Changes:
_U  branches/2017Q1/
  branches/2017Q1/databases/mysql56-client/Makefile
  branches/2017Q1/databases/mysql56-client/files/patch-CMakeLists.txt
  branches/2017Q1/databases/mysql56-client/files/patch-cmake_ssl.cmake
  branches/2017Q1/databases/mysql56-client/files/patch-extra_CMakeLists.txt
  branches/2017Q1/databases/mysql56-client/files/patch-man_CMakeLists.txt
  branches/2017Q1/databases/mysql56-client/files/patch-mysys_ssl_my_default.cc
  branches/2017Q1/databases/mysql56-client/files/patch-scripts_CMakeLists.txt
  branches/2017Q1/databases/mysql56-client/files/patch-support-files_CMakeLists.txt
  branches/2017Q1/databases/mysql56-client/pkg-message
  branches/2017Q1/databases/mysql56-server/Makefile
  branches/2017Q1/databases/mysql56-server/distinfo
  branches/2017Q1/databases/mysql56-server/files/my.cnf.sample.in
  branches/2017Q1/databases/mysql56-server/files/patch-cmake_ssl.cmake
  branches/2017Q1/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc
  branches/2017Q1/databases/mysql56-server/pkg-message
  branches/2017Q1/databases/mysql56-server/pkg-plist