#68002 closed defect (fixed)

mysql8 @8.0.34: mysql_config --libs has incorrect lib name for zlib

Reported by: jhoyt4 Owned by: herbygillot (Herby Gillot)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: mysql8 mysql81 p5-dbd-mysql

Description

It may possibly be related to the recent update of zlib

There is no zlib in /opt/local/lib (not sure if this was a change, all of my machines are already updated to the latest zlib port).

find /opt/local/lib|grep zlib|sort
    /opt/local/lib/mysql8/bin/zlib_decompress
    /opt/local/lib/pkgconfig/zlib.pc
ls /opt/local/lib/libz*
    /opt/local/lib/libz.1.3.dylib
    /opt/local/lib/libz.1.dylib
    /opt/local/lib/libz.a

Here's the log

--->  Configuring p5.34-dbd-mysql
DEBUG: Preferred compilers: clang macports-clang-15 macports-clang-14 macports-clang-13 macports-clang-12 macports-clang-11 macports-clang-10 macports-clang-9.0
DEBUG: Using compiler 'Xcode Clang'
DEBUG: elevating privileges for configure ccache: euid changed to 0, egid changed to 0.
DEBUG: dropping privileges: euid changed to 502, egid changed to 501.
DEBUG: Executing org.macports.configure (p5.34-dbd-mysql)
DEBUG: Environment: 
CC='ccache /usr/bin/clang'
CC_PRINT_OPTIONS='YES'
CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_mports_macports-ports_perl_p5-dbd-mysql/p5.34-dbd-mysql/work/.CC_PRINT_OPTIONS'
CFLAGS='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch x86_64'
CPATH='/opt/local/include'
CPPFLAGS='-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk'
CXX='ccache /usr/bin/clang++'
CXXFLAGS='-pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch x86_64'
DEVELOPER_DIR='/Library/Developer/CommandLineTools'
F90FLAGS='-pipe -Os -m64'
FCFLAGS='-pipe -Os -m64'
FFLAGS='-pipe -Os -m64'
INSTALL='/usr/bin/install -c'
LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch x86_64'
LIBRARY_PATH='/opt/local/lib'
MACOSX_DEPLOYMENT_TARGET='13.0'
OBJC='ccache /usr/bin/clang'
OBJCFLAGS='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch x86_64'
OBJCXX='ccache /usr/bin/clang++'
OBJCXXFLAGS='-pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch x86_64'
PERL_AUTOINSTALL='--skipdeps'
SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk'
Executing:  cd "/opt/local/var/macports/build/_opt_mports_macports-ports_perl_p5-dbd-mysql/p5.34-dbd-mysql/work/DBD-mysql-4.050" && /opt/local/bin/perl5.34 Makefile.PL INSTALLDIRS=vendor CC="/usr/bin/clang" LD="/usr/bin/clang" --mysql_config=/opt/local/lib/mysql8/bin/mysql_config 
DEBUG: system:  cd "/opt/local/var/macports/build/_opt_mports_macports-ports_perl_p5-dbd-mysql/p5.34-dbd-mysql/work/DBD-mysql-4.050" && /opt/local/bin/perl5.34 Makefile.PL INSTALLDIRS=vendor CC="/usr/bin/clang" LD="/usr/bin/clang" --mysql_config=/opt/local/lib/mysql8/bin/mysql_config 


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'root' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/opt/local/include/mysql8/mysql
  embedded      (guessed     ) = 
  ldflags       (guessed     ) = 
  libs          (mysql_config) = -L/opt/local/lib/mysql8/mysql -lmysqlclient -lzlib -lzstd -lssl -lcrypto -lresolv
  mysql_config  (Users choice) = /opt/local/lib/mysql8/bin/mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  nossl         (default     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) = 
  testpassword  (default     ) = 
  testport      (default     ) = 
  testsocket    (default     ) = 
  testuser      (guessed     ) = root

To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.

Checking if libs are available for compiling...
Can't link/include C library 'zlib', aborting.
Command failed:  cd "/opt/local/var/macports/build/_opt_mports_macports-ports_perl_p5-dbd-mysql/p5.34-dbd-mysql/work/DBD-mysql-4.050" && /opt/local/bin/perl5.34 Makefile.PL INSTALLDIRS=vendor CC="/usr/bin/clang" LD="/usr/bin/clang" --mysql_config=/opt/local/lib/mysql8/bin/mysql_config 
Exit code: 2
Error: Failed to configure p5.34-dbd-mysql: configure failure: command execution failed
DEBUG: Error code: NONE
DEBUG: Backtrace: configure failure: command execution failed
    while executing
"$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_mports_macports-ports_perl_p5-dbd-mysql/p5.34-dbd-mysql/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port p5.34-dbd-mysql failed

Change History (5)

comment:1 Changed 15 months ago by jmroot (Joshua Root)

Port: p5-dbd-mysql added; p5.34-dbd-mysql removed
Summary: p5.34-dbd-mysql +mysql8 fails to build (zlib)p5.34-dbd-mysql @4.50.0 +mysql8 fails to configure (zlib)

comment:2 Changed 15 months ago by jmroot (Joshua Root)

Owner: set to herbygillot
Port: mysql8 added
Status: newassigned
Summary: p5.34-dbd-mysql @4.50.0 +mysql8 fails to configure (zlib)mysql8 @8.0.34: mysql_config --libs has incorrect lib name for zlib

comment:3 Changed 15 months ago by jhoyt4

Port: mysql81 added

Homebrew patched around the problem by modifying mysql_config to use the correct link witht he following code:

    # Fix bad linker flags in `mysql_config`.
    # https://bugs.mysql.com/bug.php?id=111011
    inreplace bin/"mysql_config", "-lzlib", "-lz"

This issue also effects mysql81

Last edited 15 months ago by jhoyt4 (previous) (diff)

comment:5 Changed 15 months ago by jhoyt4

Resolution: fixed
Status: assignedclosed

In 6346d572f5916a33ea7a1657243870f3ca17f688/macports-ports (master):

mysql: Fix zlib link in mysql_config

Fixes a bug in mysql8 and mysql8.1 which incorrecly puts
a link to zlib and not libz or lz in mysql_config

See: https://bugs.mysql.com/bug.php?id=111011
Closes: #68002

Note: See TracTickets for help on using tickets.