Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716308 - dev-db/mysql-init-scripts add USE="mariadb" to get rid of mysql-connector-c dependency
Summary: dev-db/mysql-init-scripts add USE="mariadb" to get rid of mysql-connector-c d...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-05 11:48 UTC by Tiger
Modified: 2020-11-30 21:11 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
init script patch (initd-mysql-msqlconn.patch,631 bytes, patch)
2020-04-05 11:51 UTC, Tiger
Details | Diff
ebuild mysql-init-scripts patch (mysql-init-scripts-2.3.patch,376 bytes, patch)
2020-04-05 11:51 UTC, Tiger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tiger 2020-04-05 11:48:16 UTC
Hello,

I have experienced this while installing MariaDB for testing on my desktop :
Latests packages of dev-db/mariadb pulls dev-db/mysql-init-scripts which pulls dev-db/mysql-connector-c as dependency which looks to be required only for the /etc/init.d/mysql script (eg : my_print_defaults --defaults-file="$1" mysqld server mariadb | sed -n -e "s/^--$2=//p" line).

How can this justify the download of a 258 Mb packaged (provided by Oracle..?) ?

I have removed the mysql-connector-c from RDDEPEND and modified (quickly) the init script as below :

-	my_print_defaults --defaults-file="$1" mysqld server mariadb |
-	sed -n -e "s/^--$2=//p"
+	echo `grep ^$2 $1| sed "s/^.*\ //"`

@@

-			"${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+			"`whereis -b mysqld|sed s/^.*\ //`" --defaults-file="${my_cnf}" --help --verbose > /dev/null

This can of course be improved.

Shouldn't mysql-init-script be modified and handles an USE="mariadb" to fix this dependency ?

I can't say for other more complexes configurations but it works fine here with the quick fix above.

Best Regards.

Reproducible: Always
Comment 1 Tiger 2020-04-05 11:51:02 UTC
Created attachment 630430 [details, diff]
init script patch
Comment 2 Tiger 2020-04-05 11:51:36 UTC
Created attachment 630432 [details, diff]
ebuild mysql-init-scripts patch
Comment 3 Mike Limansky 2020-11-30 06:25:34 UTC
Actually my_print_defaults is provided by dev-db/mariadb and located in /usr/libexec/mariadb/my_print_defaults mysqld server mariadb

So the only difference in init script should be a location of my_print_defaults.
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2020-11-30 15:03:30 UTC
In Gentoo, each mysqld has been patched to build without 'client libs and tools' and we consider my_print_defaults to be part of this set (for current stable mariadb-10.4.x see https://github.com/Whissi/gentoo-mariadb/commit/d8a70f073f1bd1842f3d60c236358b190576f06f#diff-d690fe9ab4c0af9f6c178e95db9e242b819ec7791aebadf88ebae0aaa3cc05a6R49).

Therefore the only valid and supported provider for my_print_defaults in Gentoo is dev-db/mysql-connector-c.

Please also note that MariaDB's my_print_defaults has diverged from original MySQL implementation (https://jira.mariadb.org/browse/MDEV-22659?focusedCommentId=167117#comment-167117) so we stick to the version which is supported everywhere.
Comment 5 Mike Limansky 2020-11-30 15:32:04 UTC
Well, for me it doesn't make any sense to have mysql-connector-c and mariadb-connector-c because of tools.  Should't it be a separate package mysql-tools (possible virtual) or something like that?
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2020-11-30 16:23:55 UTC
You only have a copy of my_print_defaults in /usr/libexec at all because of compatibility with galera.

Please read more about the difference between the two mysql client lib providers and why we did the split, https://archives.gentoo.org/gentoo-dev/message/63351418568891b35409035d9bfc8f6a

Because my_print_defaults from MariaDB has diverged and is no longer 100% compatible with dev-db/{mysql,percona-server}, it wouldn't be a valid virtual.
Comment 7 Mike Limansky 2020-11-30 16:40:09 UTC
Thank you for clarification. I've got the point about the library, so, I see why only two packages in my system depends on mariadb-connector-c and most of the packages depends on mysql-connector-c.

But, I don't really get about tools. Since each MySQL implementation has it's own tools version, and this versions partially compatible, why we need to use tools from "vanilla" MySQL with MariaDB or Percona? Wouldn't it be safer to use the same tools implementation with the server installed?
Comment 8 Thomas Deutschmann (RETIRED) gentoo-dev 2020-11-30 18:35:58 UTC
'Safer' is a tough word. I don't know what future will bring us. Given that MariaDB is already diverging my_print_defaults... who knows. On the other hand they released an 'emergency' update (https://mariadb.org/mariadb-10-5-8-10-4-17-10-3-27-and-10-2-36-now-available/) when they accidentally broke normal interface with common tools.

For now I hope that our plan was correct and will work for some time. Keep in mind that I am also the only one left in Gentoo's mysql project for now and I really don't want to maintain multiple different tools provider just because you can.

This is Gentoo. If you care that much, you also have to opportunity to fork dev-db/mysql-init-scripts in your own overlay and make it work with just dev-db/mariadb (don't forget about things like logrotate). However, it is not guaranteed that /usr/libexec will stay.
Comment 9 Mike Limansky 2020-11-30 21:11:51 UTC
Sure I can. And that's one of the reasons I'm using Gentoo since 2004. And I really appreciate what all maintainers do all of these years.  I just want to understand what's going on and why.