[MDEV-12938] Discrepancy between mysql_config and mariadb_config Created: 2017-05-28  Updated: 2017-07-05  Resolved: 2017-07-05

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.2.6
Fix Version/s: 10.2.7

Type: Bug Priority: Major
Reporter: Dan Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

macOS 10.12.5, Homebrew



 Description   

Hello!

There is a discrepancy between the link options provided by mysql_config and mariadb_config. Please see the relevant outputs (options --libs and --libs_r) below.

I would expect for mysql_config to also output the missing link libraries. Otherwise it is breaking out-of-the-box compatibility to MySQL as one is required to add the missing link dependencies by hand.

$ mariadb_config 
Copyright 2011-2015 MariaDB Corporation AB
Get compiler flags for using the MariaDB Connector/C.
Usage: mariadb_config [OPTIONS]
  --cflags        [-I/usr/local/Cellar/mariadb/10.2.6/include/mysql -I/usr/local/Cellar/mariadb/10.2.6/include/mysql/mysql]
  --include       [-I/usr/local/Cellar/mariadb/10.2.6/include/mysql -I/usr/local/Cellar/mariadb/10.2.6/include/mysql/mysql]
  --libs          [-L/usr/local/Cellar/mariadb/10.2.6/lib/ -lmariadb -lpthread -ldl -lm -l/usr/lib/libiconv.dylib -l/usr/local/opt/openssl/lib/libssl.dylib -l/usr/local/opt/openssl/lib/libcrypto.dylib /usr/lib/libiconv.dylib]
  --libs_r        [-L/usr/local/Cellar/mariadb/10.2.6/lib/ -lmariadb -lpthread -ldl -lm -l/usr/lib/libiconv.dylib -l/usr/local/opt/openssl/lib/libssl.dylib -l/usr/local/opt/openssl/lib/libcrypto.dylib /usr/lib/libiconv.dylib]
  --libs_sys      [-lpthread -ldl -lm -l/usr/lib/libiconv.dylib -l/usr/local/opt/openssl/lib/libssl.dylib -l/usr/local/opt/openssl/lib/libcrypto.dylib /usr/lib/libiconv.dylib]
  --version       [10.2.5]
  --socket        [/tmp/mysql.sock]
  --port          [3306]
  --plugindir     [/usr/local/Cellar/mariadb/10.2.6/lib/plugin]
  --tlsinfo       [OpenSSL 1.0.2k]

$ mysql_config
Usage: /usr/local/bin/mysql_config [OPTIONS]
Options:
        --cflags         [-I/usr/local/Cellar/mariadb/10.2.6/include/mysql -I/usr/local/Cellar/mariadb/10.2.6/include/mysql/.. ]
        --include        [-I/usr/local/Cellar/mariadb/10.2.6/include/mysql -I/usr/local/Cellar/mariadb/10.2.6/include/mysql/..]
        --libs           [-L/usr/local/Cellar/mariadb/10.2.6/lib  -lmariadb]
        --libs_r         [-L/usr/local/Cellar/mariadb/10.2.6/lib  -lmariadb]
        --plugindir      [/usr/local/Cellar/mariadb/10.2.6/lib/plugin]
        --socket         [/tmp/mysql.sock]
        --port           [0]
        --version        [10.2.6]
        --libmysqld-libs [-L/usr/local/Cellar/mariadb/10.2.6/lib  -lmysqld]
        --variable=VAR   VAR is one of:
                pkgincludedir [/usr/local/Cellar/mariadb/10.2.6/include/mysql]
                pkglibdir     [/usr/local/Cellar/mariadb/10.2.6/lib]
                plugindir     [/usr/local/Cellar/mariadb/10.2.6/lib/plugin]

Thank you.



 Comments   
Comment by Sergei Golubchik [ 2017-05-30 ]

georg, wlad, why do we still distribute mysql_config in the first place?

Comment by Vladislav Vaintroub [ 2017-05-30 ]

serg, I think it widely used to detect MySQL or MariaDB installations, in 3rd parties builds. I see no mistake in mysql_config . I'm wondering what we install mariadb_config for. Nothing depends on it. it is a question whether mariadb_config makes a good replacement for mysql_config yet. I think the library paths are hardcoded in mariadb_config, and if this is so, zip or tar.gz packages would no more be relocatable

Comment by Sergei Golubchik [ 2017-06-29 ]

Generally, I'd say that such a script belongs to the client library code, so it should be part of libmariadb/.
But mysql_config is a widely used name, so ideally, I'd say, C/C should install mariadb_config and symlink it to mysql_config, just as it's doing with libmariadb.so -> libmysqlclient.so.

But in this particular case, C/C knows nothing about embedded, so mariadb_config cannot possibly have --libmysqld-libs flag. So, I'd say, we don't install mariadb_config, only mysql_config. And symlink it to mariadb_config.

Comment by Vladislav Vaintroub [ 2017-06-29 ]

do we need mariadb_config at all? as symlink. Who would need it?

Comment by Sergei Golubchik [ 2017-06-29 ]

I thought that when we implement MDEV-9295, then we could switch to using mariadb_config and mysql_config will be a symlink to it.

and it's kind of expected to have xxx_config script for a library libxxx.so.

Comment by Sergei Golubchik [ 2017-07-05 ]

mysql_config --libs now lists all libraries

Generated at Thu Feb 08 08:01:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.