Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15820

Backward compatibility break of mysql_config

Details

    Description

      The shell script bin/mysql_config should provide information on how MySQL/MariaDB has been deployed.
      For example if you have copied the Linux binaries directly on /opt/mariadb of your system, a call to /opt/mariadb/bin/mysql_config --include will tell you that you should add -I/opt/mariadb/include/mysql -I/opt/mariadb/include/mysql/.. to any compilation that uses the MySQL/MariaDb headers.
      This is now broken by MDEV-13836 and commit a75884e.
      In this development it was chosen to match the outputs of mariadb_config and mysql_confg. But mariadb_config doesn't care about where the files are located. It only uses the compilation options of MariaDB. So today if you download the binary packages you will get
      -I/usr/local/mysql/include/mysql -I/usr/local/mysql/include/mysql/mysql no matter where you choose to deploy MariaDB on your system.
      For me, this is a major backward compatibility issue. We should revert to give the choice between mysql_config and mariadb_config with their different behavior.

      Attachments

        Issue Links

          Activity

            pali Pali added a comment -

            Hello! Is there any timeline for fixing this issue? Because this issue basically prevents usage of pre-compiled MariaDB binary releases distributed via tar.gz packages. See linked issue MDEV-16384.

            pali Pali added a comment - Hello! Is there any timeline for fixing this issue? Because this issue basically prevents usage of pre-compiled MariaDB binary releases distributed via tar.gz packages. See linked issue MDEV-16384 .
            danblack Daniel Black added a comment -

            mariadb-10.5.5 tarball

            $ $HOME/Downloads/mariadb-10.5.5-linux-x86_64/bin/mysql_config 
            Usage: /home/dan/Downloads/mariadb-10.5.5-linux-x86_64/bin/mysql_config [OPTIONS]
            Options:
                    --cflags         [-I/usr/local/mysql/include/mysql -I/usr/local/mysql/include/mysql/mysql]
                    --include        [-I/usr/local/mysql/include/mysql -I/usr/local/mysql/include/mysql/mysql]
                    --libs           [-L/usr/local/mysql/lib/ -lmariadb]
                    --libs_r         [-L/usr/local/mysql/lib/ -lmariadb]
                    --plugindir      [/usr/local/mysql/lib/plugin]
                    --socket         [/tmp/mysql.sock]
                    --port           [3306]
                    --version        [10.5.5]
                    --libmysqld-libs [-L/home/dan/Downloads/mariadb-10.5.5-linux-x86_64/lib  -lmysqld]
                    --variable=VAR   VAR is one of:
                            pkgincludedir [/home/dan/Downloads/mariadb-10.5.5-linux-x86_64/include/mysql]
                            pkglibdir     [/home/dan/Downloads/mariadb-10.5.5-linux-x86_64/lib]
                            plugindir     [/usr/local/mysql/lib/plugin]
            

            Comparison of correct output:

            mysql-8.0

            $ /usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/bin/mysql_config
            Usage: /usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/bin/mysql_config [OPTIONS]
            Compiler: GNU 8.2.1
            Options:
                    --cflags         [-I/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/include ]
                    --cxxflags       [-I/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/include ]
                    --include        [-I/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/include]
                    --libs           [-L/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib -Wl,-R,/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib -L/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/private -Wl,-R,/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/private -lmysqlclient -lpthread -lm -lrt -lcrypto -lssl -ldl]
                    --libs_r         [-L/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib -Wl,-R,/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib -L/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/private -Wl,-R,/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/private -lmysqlclient -lpthread -lm -lrt -lcrypto -lssl -ldl]
                    --plugindir      [/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/plugin]
                    --socket         [/tmp/mysql.sock]
                    --port           [0]
                    --version        [8.0.21]
                    --variable=VAR   VAR is one of:
                            pkgincludedir [/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/include]
                            pkglibdir     [/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib]
                            plugindir     [/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/plugin]
            
            

            mysql-5.7

            $ /usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/bin/mysql_config
            Usage: /usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/bin/mysql_config [OPTIONS]
            Compiler: GNU 4.4.7
            Options:
                    --cflags         [-I/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/include ]
                    --cxxflags       [-I/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/include ]
                    --include        [-I/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/include]
                    --libs           [-L/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib -lmysqlclient -lpthread -lm -lrt -ldl]
                    --libs_r         [-L/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib -lmysqlclient -lpthread -lm -lrt -ldl]
                    --plugindir      [/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib/plugin]
                    --socket         [/tmp/mysql.sock]
                    --port           [0]
                    --version        [5.7.31]
                    --libmysqld-libs [-L/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib -lmysqld -lpthread -lm -lrt -ldl -lcrypt -laio -lnuma]
                    --variable=VAR   VAR is one of:
                            pkgincludedir [/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/include]
                            pkglibdir     [/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib]
                            plugindir     [/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib/plugin]
            

            mysql-8.0 relocated

            $ cp -a  /usr/local/mysql-8.0.21-linux-glibc2.12-x86_64 /tmp/rr8xx
             
            ~/repos/PHP-7.4 travis-libmysqlclient-test
            $ /tmp/rr8xx/bin/mysql_config
            Usage: /tmp/rr8xx/bin/mysql_config [OPTIONS]
            Compiler: GNU 8.2.1
            Options:
                    --cflags         [-I/tmp/rr8xx/include ]
                    --cxxflags       [-I/tmp/rr8xx/include ]
                    --include        [-I/tmp/rr8xx/include]
                    --libs           [-L/tmp/rr8xx/lib -Wl,-R,/tmp/rr8xx/lib -L/tmp/rr8xx/lib/private -Wl,-R,/tmp/rr8xx/lib/private -lmysqlclient -lpthread -lm -lrt -lcrypto -lssl -ldl]
                    --libs_r         [-L/tmp/rr8xx/lib -Wl,-R,/tmp/rr8xx/lib -L/tmp/rr8xx/lib/private -Wl,-R,/tmp/rr8xx/lib/private -lmysqlclient -lpthread -lm -lrt -lcrypto -lssl -ldl]
                    --plugindir      [/tmp/rr8xx/lib/plugin]
                    --socket         [/tmp/mysql.sock]
                    --port           [0]
                    --version        [8.0.21]
                    --variable=VAR   VAR is one of:
                            pkgincludedir [/tmp/rr8xx/include]
                            pkglibdir     [/tmp/rr8xx/lib]
                            plugindir     [/tmp/rr8xx/lib/plugin]
            

            As such use of maria mysql_config results in compile errors: https://travis-ci.org/github/grooverdan/php-src/jobs/726696489#L16040

            danblack Daniel Black added a comment - mariadb-10.5.5 tarball $ $HOME/Downloads/mariadb-10.5.5-linux-x86_64/bin/mysql_config Usage: /home/dan/Downloads/mariadb-10.5.5-linux-x86_64/bin/mysql_config [OPTIONS] Options: --cflags [-I/usr/local/mysql/include/mysql -I/usr/local/mysql/include/mysql/mysql] --include [-I/usr/local/mysql/include/mysql -I/usr/local/mysql/include/mysql/mysql] --libs [-L/usr/local/mysql/lib/ -lmariadb] --libs_r [-L/usr/local/mysql/lib/ -lmariadb] --plugindir [/usr/local/mysql/lib/plugin] --socket [/tmp/mysql.sock] --port [3306] --version [10.5.5] --libmysqld-libs [-L/home/dan/Downloads/mariadb-10.5.5-linux-x86_64/lib -lmysqld] --variable=VAR VAR is one of: pkgincludedir [/home/dan/Downloads/mariadb-10.5.5-linux-x86_64/include/mysql] pkglibdir [/home/dan/Downloads/mariadb-10.5.5-linux-x86_64/lib] plugindir [/usr/local/mysql/lib/plugin] Comparison of correct output: mysql-8.0 $ /usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/bin/mysql_config Usage: /usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/bin/mysql_config [OPTIONS] Compiler: GNU 8.2.1 Options: --cflags [-I/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/include ] --cxxflags [-I/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/include ] --include [-I/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/include] --libs [-L/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib -Wl,-R,/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib -L/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/private -Wl,-R,/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/private -lmysqlclient -lpthread -lm -lrt -lcrypto -lssl -ldl] --libs_r [-L/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib -Wl,-R,/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib -L/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/private -Wl,-R,/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/private -lmysqlclient -lpthread -lm -lrt -lcrypto -lssl -ldl] --plugindir [/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/plugin] --socket [/tmp/mysql.sock] --port [0] --version [8.0.21] --variable=VAR VAR is one of: pkgincludedir [/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/include] pkglibdir [/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib] plugindir [/usr/local/mysql-8.0.21-linux-glibc2.12-x86_64/lib/plugin] mysql-5.7 $ /usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/bin/mysql_config Usage: /usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/bin/mysql_config [OPTIONS] Compiler: GNU 4.4.7 Options: --cflags [-I/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/include ] --cxxflags [-I/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/include ] --include [-I/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/include] --libs [-L/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib -lmysqlclient -lpthread -lm -lrt -ldl] --libs_r [-L/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib -lmysqlclient -lpthread -lm -lrt -ldl] --plugindir [/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib/plugin] --socket [/tmp/mysql.sock] --port [0] --version [5.7.31] --libmysqld-libs [-L/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib -lmysqld -lpthread -lm -lrt -ldl -lcrypt -laio -lnuma] --variable=VAR VAR is one of: pkgincludedir [/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/include] pkglibdir [/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib] plugindir [/usr/local/mysql-5.7.31-linux-glibc2.12-x86_64/lib/plugin] mysql-8.0 relocated $ cp -a /usr/local/mysql-8.0.21-linux-glibc2.12-x86_64 /tmp/rr8xx   ~/repos/PHP-7.4 travis-libmysqlclient-test $ /tmp/rr8xx/bin/mysql_config Usage: /tmp/rr8xx/bin/mysql_config [OPTIONS] Compiler: GNU 8.2.1 Options: --cflags [-I/tmp/rr8xx/include ] --cxxflags [-I/tmp/rr8xx/include ] --include [-I/tmp/rr8xx/include] --libs [-L/tmp/rr8xx/lib -Wl,-R,/tmp/rr8xx/lib -L/tmp/rr8xx/lib/private -Wl,-R,/tmp/rr8xx/lib/private -lmysqlclient -lpthread -lm -lrt -lcrypto -lssl -ldl] --libs_r [-L/tmp/rr8xx/lib -Wl,-R,/tmp/rr8xx/lib -L/tmp/rr8xx/lib/private -Wl,-R,/tmp/rr8xx/lib/private -lmysqlclient -lpthread -lm -lrt -lcrypto -lssl -ldl] --plugindir [/tmp/rr8xx/lib/plugin] --socket [/tmp/mysql.sock] --port [0] --version [8.0.21] --variable=VAR VAR is one of: pkgincludedir [/tmp/rr8xx/include] pkglibdir [/tmp/rr8xx/lib] plugindir [/tmp/rr8xx/lib/plugin] As such use of maria mysql_config results in compile errors: https://travis-ci.org/github/grooverdan/php-src/jobs/726696489#L16040
            timok Pierre Cart-Grandjean added a comment - - edited

            I just tried again with MariaDB 10.5.5:

            ubuntu@tab-pcg-ubuntu:~/downloads/mariadb-10.5.5-linux-x86_64/bin$ ./mysql_config --include
            -I/usr/local/mysql/include/mysql -I/usr/local/mysql/include/mysql/mysql
            

            This doesn't give the actual locations of the files to be included. By comparison, here is the same test with MySQL Community edition 8.0.20:

            ubuntu@tab-pcg-ubuntu:~/downloads/mysql-8.0.20-linux-glibc2.12-i686/bin$ ./mysql_config --include
            -I/home/ubuntu/downloads/mysql-8.0.20-linux-glibc2.12-i686/include
            

            This ticket was created more than 2 years ago and this is still a show stopper for me to use MariaDB.

            timok Pierre Cart-Grandjean added a comment - - edited I just tried again with MariaDB 10.5.5 : ubuntu@tab-pcg-ubuntu:~ /downloads/mariadb-10 .5.5-linux-x86_64 /bin $ . /mysql_config --include -I /usr/local/mysql/include/mysql -I /usr/local/mysql/include/mysql/mysql This doesn't give the actual locations of the files to be included. By comparison, here is the same test with MySQL Community edition 8.0.20 : ubuntu@tab-pcg-ubuntu:~ /downloads/mysql-8 .0.20-linux-glibc2.12-i686 /bin $ . /mysql_config --include -I /home/ubuntu/downloads/mysql-8 .0.20-linux-glibc2.12-i686 /include This ticket was created more than 2 years ago and this is still a show stopper for me to use MariaDB.
            georg Georg Richter added a comment -

            This was already fixed in C/C 3.1.10 (rev. 448514a1ad79b7baac29c9d8ed158cbe8ce78ef9) and is now available in latest 10.2, 10.3, 10.4, 10.5 server versions.

            georg Georg Richter added a comment - This was already fixed in C/C 3.1.10 (rev. 448514a1ad79b7baac29c9d8ed158cbe8ce78ef9) and is now available in latest 10.2, 10.3, 10.4, 10.5 server versions.

            Verified on MariaDB 10.5.8, released 11/11/2020.
            Thanks!

            timok Pierre Cart-Grandjean added a comment - Verified on MariaDB 10.5.8, released 11/11/2020. Thanks!

            People

              georg Georg Richter
              timok Pierre Cart-Grandjean
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.