-
Notifications
You must be signed in to change notification settings - Fork 75
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
Tidy build error on Debian bookworm #448
Conversation
eafc5c4
to
786b362
Compare
version.pm is for parsing and comparing Perl versions and is not appropriate to use for general program versions (for example, it would interpret a hypothetical '5.10' incorrectly). You could consider versioncmp from Sort::Versions but it's probably not worth adding a dependency for this. |
if ($opt->{libs} =~ /mariadb/) { | ||
print <<"MSG"; | ||
|
||
The chosen MySQL client library appears to be MariaDB's. Compilation may fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The chosen MySQL client library appears to be MariaDB's. Compilation may fail. | |
The chosen MySQL client library appears to be MariaDB's. DBD::mysql doesn't support building against a MariaDB client library. |
I like this method as it doesn't rely on versions to detect MariaDB (>= 10.0 ) or MySQL (< 10.0) which can be very useful if in the future Oracle would release a MySQL 10.x (Not unlikely, see the diagram on this blog post )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the best text/info is here.
- DBD::mysql requires an Oracle MySQL client library. As the MariaDB client library presents itself as MySQL client library this can be confusing to users. This might get better in the future as
mysql_config
is inlibmariadb-dev-compat
and is optional (at least on Ubuntu 20.04). - DBD::mysql build with a Oracle MySQL client library can be used to connect to MariaDB.
- Alternatives are DBD::MariaDB and DBD::mysql v4.x. I think only listing the first one (as you did) is probably best, but I'm not sure.
- The MySQL client library must be 8.0 or newer
- Maybe return info on how it was determined to be MariaDB (
mysql_config --libs
matchedmariadb
) to make it easier for people to troubleshoot. - On bookworm the MySQL APT Repository can be used. Debian sid has Oracle MySQL iirc. (I know this doesn't help with native Debian packages)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've kept the text descriptive of the behaviour.
Suggesting Oracle's library seems like good advice. Recommending sticking with 4.x might age badly.
It's not unreasonable for someone to want to use this module with MariaDB. DBD::MariaDB has Unicode fixes that might break your application.
Thanks, this is very useful info. If MariaDB is detected based on if As Oracle stayed on 8.0.x for many years and now suddenly has released many new versions like 8.1, 8.2, 8.3, 8.4, 9.0 and 9.1 and is slowly approaching the version range that is used by MariaDB (10.x and up) version checks are becoming more fragile, especially for determining the flavor (MySQL, MariaDB, etc) |
Maybe a simple split instead of a regex? #!/bin/perl
my @versions = ("3.23.40", "4.1.24", "5.7.40", "8.0.11", "9.1.0", "10.0.0", "11.1.0", "8.0.11-TiDB-v8.4.0");
foreach (@versions) {
my @verinfo = split(/\./, $_);
my $verok = @verinfo[0]>=8 ? "ok" : "too old";
print "$_ has major version @verinfo[0] which is $verok.\n"
}
|
Debian no longer supplies libmysqlclient. It provides symlinks from mysql_config to mariadb_config. Unfortunately this gives us an unhelpful compilation error because we are using MySQL exclusive features.
786b362
to
c38d218
Compare
We fail to build on Debian bookworm, it supplies MariaDB rather than MySQL. Unfortunately we fail to build with an unhelpful error message. MariaDB is now up to version 11.