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

Added support for building the mecab plugin library (JEN-427) #317

Merged
merged 1 commit into from Jan 16, 2016

Conversation

tplavcic
Copy link
Member

BUG:
libpluginmecab.so is missing from 5.7.10-1rc1
https://bugs.launchpad.net/percona-server/+bug/1534617
JEN-427

DOCS:
https://dev.mysql.com/doc/refman/5.7/en/fulltext-search-mecab.html

INFO:
The library is statically built into libpluginmecab.so on centos and dynamically linked on ubuntu (probably because the packages exists in ubuntu/debian repositories) - although MySQL documentation says it's statically linked on all linuxes - seems it's not.
Where system packages exist it can be built with "-DWITH_MECAB=system" and that will do a dynamic link and will not bundle config and other stuff - we do this on ubuntu/debian.
If you do a "-DWITH_MECAB=<path_to_lib>" it will statically link the library into libpluginmecab.so and bundle config - we do this on centos with some included dictionary (but we currently don't have packages on centos so we build from sources every time - link below).
The change in this PR is basically just adding the option to build with -DWITH_MECAB=system|path to build-binary.sh, debian package (built with system). Rpm has optional build from before, now only the jenkins was changed to use it.

The sources for static builds are from here:
http://jenkins.percona.com/downloads/mecab/

TEST BUILDS:
http://jenkins.percona.com/job/percona-server-5.7-redhat-binary/63/
http://jenkins.percona.com/job/percona-server-5.7-debian-binary/32/
http://jenkins.percona.com/job/percona-server-5.7-debian-binary-notokudb/40/
http://jenkins.percona.com/job/percona-server-5.7-binaries-release/28/

TEST:
DEBIAN CONTENT:

plavi@zoidberg  ~/Downloads  dpkg -c percona-server-server-5.7_5.7.10-1rc1-1.trusty_amd64.deb|grep mecab
-rw-r--r-- root/root     85940 2016-01-14 18:52 ./usr/lib/mysql/plugin/debug/libpluginmecab.so
-rw-r--r-- root/root     15128 2016-01-14 19:06 ./usr/lib/mysql/plugin/libpluginmecab.so

TARBALL CONTENT:

plavi@zoidberg  ~/Downloads  tar -tzvf Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100.tar.gz|grep mecab
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/include/have_mecab.inc
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/suite/innodb_fts/include/mecab.inc
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/suite/innodb_fts/r/mecab_utf8.result
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/suite/innodb_fts/r/mecab_sjis.result
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/suite/innodb_fts/r/mecab_ujis.result
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/suite/innodb_fts/t/mecab_utf8.test
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/suite/innodb_fts/t/mecab_utf8-master.opt
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/suite/innodb_fts/t/mecab_sjis.test
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/suite/innodb_fts/t/mecab_sjis-master.opt
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/suite/innodb_fts/t/mecab_ujis.test
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/mysql-test/suite/innodb_fts/t/mecab_ujis-master.opt
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/ipadic/
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/ipadic/sys.dic
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/ipadic/right-id.def
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/ipadic/matrix.bin
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/ipadic/dicrc
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/ipadic/left-id.def
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/ipadic/char.bin
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/ipadic/unk.dic
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/ipadic/pos-id.def
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/dic/ipadic/rewrite.def
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/etc/
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mecab/etc/mecabrc
Percona-Server-5.7.10-1rc1-Linux.x86_64.ssl100/lib/mysql/plugin/libpluginmecab.so

RPM CONTENT:

[root@t-centos7-64 /]# rpm -ql Percona-Server-server-57|grep mecab
/usr/lib64/mysql/mecab
/usr/lib64/mysql/mecab/dic
/usr/lib64/mysql/mecab/dic/ipadic
/usr/lib64/mysql/mecab/dic/ipadic/char.bin
/usr/lib64/mysql/mecab/dic/ipadic/dicrc
/usr/lib64/mysql/mecab/dic/ipadic/left-id.def
/usr/lib64/mysql/mecab/dic/ipadic/matrix.bin
/usr/lib64/mysql/mecab/dic/ipadic/pos-id.def
/usr/lib64/mysql/mecab/dic/ipadic/rewrite.def
/usr/lib64/mysql/mecab/dic/ipadic/right-id.def
/usr/lib64/mysql/mecab/dic/ipadic/sys.dic
/usr/lib64/mysql/mecab/dic/ipadic/unk.dic
/usr/lib64/mysql/mecab/etc
/usr/lib64/mysql/mecab/etc/mecabrc
/usr/lib64/mysql/plugin/debug/libpluginmecab.so
/usr/lib64/mysql/plugin/libpluginmecab.so

RPM INSTALL:
I have setup the following option:
dicdir = /usr/lib64/mysql/mecab/dic/ipadic
in config file: /usr/etc/mecabrc
(otherwise you get an error on installation)

[root@t-centos7-64 etc]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.10-1rc1 Percona Server (GPL), Release 1rc1, Revision ba64673

Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> INSTALL PLUGIN mecab SONAME 'libpluginmecab.so';
Query OK, 0 rows affected (0.07 sec)

@tplavcic
Copy link
Member Author

I am self approving this since the git change is fairly simple, the magic happens in jenkins and that part is already changed.

tplavcic added a commit that referenced this pull request Jan 16, 2016
Added support for building the mecab plugin library (JEN-427)
@tplavcic tplavcic merged commit 396ed36 into percona:5.7 Jan 16, 2016
@laurynas-biveinis
Copy link
Contributor

@tplavcic, " although MySQL documentation says it's statically linked on all linuxes - seems it's not." - is this something that should be reported upstream as a bug?

@tplavcic
Copy link
Member Author

Seems like that they didn't want to go into detail in documentation so they just put all linuxes into one box since they have non-linux builds also. Possibly they use static linking in most linuxes (they have suse, fedora also...). But on ubuntu/debian there are some system packages with shared library so they link their plugin dynamically with that library. I don't think it's a bug in program but maybe documentation could be a little bit more clearer.

@laurynas-biveinis
Copy link
Contributor

Yep, it's a documentation bug I had in mind

@tplavcic tplavcic deleted the jen-427-5.7 branch April 7, 2016 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants