-
Notifications
You must be signed in to change notification settings - Fork 7.9k
travis-ci: mysqli test native driver #6126
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
travis-ci: mysqli test native driver #6126
Conversation
The mysqlclient_r library exists in mysql-5.6 for compatibility only. Later versions have it removed.
This returns 127.0.1.1 on travis bionic.
281d682
to
82f1792
Compare
In looking forward I see that 7.4 has moved to azure and a CI pipeline. I tried to get this back to a simpler trusty based build however failed. I've pulled the test cases from the master branch just to get maximum test successes. Combining this with #6127 results in https://travis-ci.org/github/grooverdan/php-src/builds/727264652, all supported mysql latest versions being able to be compiled and passing most tests. |
Thanks for working on this! As the libmysqlclient backend is not typically used, nobody has really put effort into maintaining it in recent times. As you have already found out, PHP 7.4 upwards uses a completely different CI setup running on Azure Pipelines. We try to avoid making changes to the CI setup on PHP 7.3 for that reason, as higher branches will need a different implementation and 7.3 only has a couple months of active support left at this point. The second problem here is that we don't have the CI capacity to run multiple mysql drivers on each build (this would add three additional jobs to each commit and PR build). The way we usually handle this is to create a separate job for this on Azure Pipelines that only runs for scheduled nightly builds. In this case, the job would just repeatedly build PHP against different libraries and run the relevant parts of the tests (ext/mysqli, ext/pdo_mysql). Another thing that will turn up as a problem when targeting 7.4 upwards is that builds use |
I started looking at this because someone reported a fault that could have only happened with libmysqlclient. Given the feature difference listed https://www.php.net/manual/en/mysqlinfo.library.choosing.php I'm still don't understand why it was chosen (which I'm sure you'd find interesting too). Given the current state of not compiling against mysql-8.0 I certainly see its less maintained which was easy enough to fix (#6127). If nothing else this was a useful exercise in proving what works/doesn't work. On CI resource minimization I was looking at something like the following as the criteria to extend(/switch from) mysqlnd in the build. for file in $(git diff --name-only $TRAVIS_COMMIT_RANGE) do case "$file" in ext/mysqli/*) mysqli=1 mysqlpdo=1 ;; ext/pdo_mysql/*) mysqlpdo=1 ;; esac done This doesn't address that even with this change, even on azure, you're only testing against 1 mysql version (and one postgres version too). I fully understand the CI resource contraints and the labour effort that goes into them at MariaDB. On
Overall not too hard. Tougher is the 33-46 test failures including memory leaks. I suspect some will be rather simple server configuration or assuming mysqlnd type conversion. So my deeper, possibly blunt question but not in an intentionally offensive way, is the libmysqlclient really supported? |
libmysql doesn't have a maintainer (like a lot of bundled extensions tbh) and there was an email thread last year (see: https://externals.io/message/106086) about dropping support but nothing got enacted. Worst case about the tests which leak is that you mark them as XFAIL (see: https://qa.php.net/phpt_details.php#xfail_section) just so that it passes CI |
That's a good question :) I think the current state of libmysqlclient support is basically "the code is there" and will get occasionally fixed to continue working. I'd be happy to move it towards being more actively maintained though, as I don't like the idea of dropping support altogether. Mysqlnd might not support something that libmysqlclient does (especially if it's new), and this offers an escape hatch. I also used the support just yesterday to compare wireshark traces between libmysqlclient and mysqlnd to track down a bug, though I guess that's one of the more exotic use-cases :) I've fixed the build warnings against the 8.0 client in b0661a9 and a small number of tests in 86e0027 just to get a feeling for how things stand now. Many of the test failures are fairly superficial, but there are definitely some genuine issues in there. In particular php-src/ext/mysqli/mysqli_api.c Line 476 in 86e0027
|
And then there is this gem: c3944c4 Mysqlnd implementation was broken, and the test expected the wrong result... |
Thanks @nikic for the test/warning fixed and showing how its still useful. closing this as a pr against travis. Its usefulness in testing was as good as the discussion generated. |
In testing how well the libmysqlclient performs in mysqli and the pdo_mysql I've made the following changes to get them running on travis.
There are about 33 test failures in the mysqli/pdo_mysql test suites associated with these so I've left the as travis 'allow_failure" jobs for now. Marking these as XFAIL was going to be detrimental to the mysqlnd coverage.
I've included a bump from trusty to bionic. As I was looking at running docker container version of the mysql major versions on the server side. With the existing failures, and bionic running a 5.7 MySQL version, I thought I'd wait off adding more complexity.
A few other minor tests needed small corrections to run on bionic/the travis environment.
libmysqlclient_r was replaces with libmysqlclient consistent with Oracle upstream. The libmysqlclient_r symlink is only in mysql-5.6, the currently earliest support upstream version.