Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only do library version check in Windows environment #678

Merged
merged 1 commit into from Sep 9, 2015

Conversation

jconroy77
Copy link
Contributor

Unix systems using libtool do not need to do a version check against the
client version string as the libraries themselves are versioned:

libmysqlclient.so.14 = MySQL 4.1
libmysqlclient.so.15 = MySQL 5.0
libmysqlclient.so.16 = MySQL 5.1
libmysqlclient.so.18 = MySQL 5.5/5.6
libmysqlclient.so.20 = MySQL 5.7

The current test causes failures when attempting to use MariaDB with packages that were built against MySQL (libmysqlclient.so.16 and MySQL 5.1, but MariaDB advertises as 5.3 in the same so.16 library). Same will happen with MySQL 5.5/5.6 which use the same .so.18 libtool versioned library.

Libtool versioning should prevent the library version failure scenarios that this test is checking for...it appears to have been added specifically for Windows clients where the DLLs are not versioned. This change limits this version test to the Windows platform.

@sodabrew
Copy link
Collaborator

sodabrew commented Sep 9, 2015

Interesting, I had not read the full history of that code before. Makes sense to make it Windows-only.

@sodabrew sodabrew added this to the 0.4.1 milestone Sep 9, 2015
@sodabrew
Copy link
Collaborator

sodabrew commented Sep 9, 2015

Please squash to one commit and rebase.

Unix systems using libtool do not need to do a version check against the
client version string as the libraries themselves are versioned.
@jconroy77
Copy link
Contributor Author

Done

sodabrew added a commit that referenced this pull request Sep 9, 2015
Only do library version check in Windows environment
@sodabrew sodabrew merged commit 063f4b2 into brianmario:master Sep 9, 2015
@jconroy77 jconroy77 deleted the no_ver_check branch September 9, 2015 21:12
@arunsr2015
Copy link

Hi We are having a similar problem. We are upgrading to foreman 1.10 and have percona cluster db installed. When trying to bring up foreman, we get this error
[root@centos7 ~]# foreman-rake --trace db:migraterake aborted!

Incorrect MySQL client library version! This gem was compiled for
5.5.35-MariaDB but the client library is 5.6.26-74.0.

We were told to rebuild the foreman tfm-rubygem-mysql2-0.3.19-3.el7.x86_64.rpm using the native libmyslqclient provided by percona.
Do we have mock file to generate this.

@sodabrew
Copy link
Collaborator

sodabrew commented Feb 9, 2016

The RPM packaging is not maintained here, you should be able to get a source RPM from The Foreman repos.

@arunsr2015
Copy link

Thx for replying yes i got the source rpm and tried to build using our libmysqlclient.so, i used the mock file provided by foreman but the build fails with this error

Any help in this regard will be very helpful

RROR: Error installing /builddir/build/SOURCES/mysql2-0.3.19.gem:
ERROR: Failed to build gem native extension.

    /opt/rh/ruby193/root/usr/bin/ruby extconf.rb

checking for ruby/thread.h... no
checking for rb_thread_blocking_region()... yes


checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes

checking for rb_intern3()... yes

Using mysql_config at /usr/bin/mysql_config

checking for mysql.h... yes
checking for errmsg.h... yes

checking for mysqld_error.h... yes

Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load


Setting libpath to /usr/lib64

creating Makefile
gcc -shared -o mysql2.so client.o infile.o mysql2_ext.o result.o -L. -L/opt/rh/ruby193/root/usr/lib64 -L/usr/lib64 -L. -Wl,-z,relro -rdynamic -Wl,-export-dynamic -m64 -lruby -L/usr/lib64 -lmysqlclienlpthread -lm -lrt -lssl -lcrypto -ldl -lpthread -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: cannot find -lmysqlclient
collect2: error: ld returned 1 exit status
make: *** [mysql2.so] Error 1

@sodabrew
Copy link
Collaborator

That's an interesting error. I remember writing it, but I don't remember the scenario that causes it 😨

@arunsr2015
Copy link

I am attaching the mock file I used and the build output files , if you can let me know if anything wrong thx.
state.txt
build.txt
foreman1.10-el7.txt

@arunsr2015
Copy link

Hi Sodabrew, any help u can provide to get over this issue

thx

@sodabrew
Copy link
Collaborator

sodabrew commented Mar 5, 2016

Please paste the full output on your build system for mysql_config --help ?

@arunsr2015
Copy link

[root@spc02 ~]# mysql_config --help
Usage: /bin/mysql_config [OPTIONS]
Options:
--cflags [-I/usr/include/mysql -g -m64 -DWITH_WSREP -DWSREP_PROC_INFO -DMYSQL_MAX_VARIABLE_VALUE_LEN=2048 -DWITH_INNODB_DISALLOW_WRITES -DWITH_INNODB_DISALLOW_WRITES -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing]
--cxxflags [-I/usr/include/mysql -g -fexceptions -m64 -felide-constructors -fno-rtti -DWITH_WSREP -DWSREP_PROC_INFO -DMYSQL_MAX_VARIABLE_VALUE_LEN=2048 -DWITH_INNODB_DISALLOW_WRITES -DWITH_INNODB_DISALLOW_WRITES -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing]
--include [-I/usr/include/mysql]
--libs [-L/usr/lib64 -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl]
--libs_r [-L/usr/lib64 -lmysqlclient_r -lpthread -lz -lm -lrt -lssl -lcrypto -ldl]
--plugindir [/usr/lib64/mysql/plugin]
--socket [/var/lib/mysql/mysql.sock]
--port [0]
--version [5.6.28-76.1]
--libmysqld-libs [-L/usr/lib64 -lmysqld]
--variable=VAR VAR is one of:
pkgincludedir [/usr/include/mysql]
pkglibdir [/usr/lib64]
plugindir [/usr/lib64/mysql/plugin]
[root@spc02 ~]#

@arunsr2015
Copy link

Hi Sodabrew, did the output help, let me know if u want me to try anything on my local.
Appreciate ur help

@arunsr2015
Copy link

Hi Sodabrew, we tried adding LD_PATH, LD_LIB_PATH etc, but still hitting the error,is it possible to comment out the lib version check path if where in code we can do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants