I'm trying to get MariaDB4J working on my new M1 MacBook Pro, and I'm not doing so great.
I am running the Arm versions of both email@example.com and mariadb 10.6.4, both installed with Homebrew.
First I had issues with libssl not finding libssl, it had to have 1.0, so i installed symlinks from the 1.0 path the library expects to the homebrew 1.1 destination. According to various issue threads on the mariadb GitHub page this should work.
So, it indeed resulted in that libssl was found, but now I get another issue in the logs:
"Reason: tried: '/usr/local/opt/openssl/lib/libssl.1.0.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))"
So, I guess that something/mariadb4j expects the x86 version of libssl but I have arm? I'm not sure how to sort this out, so hoping that someone got this to work on M1. Pointers appreciated.
I'm the author of MariaDB4j, and can confirm that currently this is not possible / won't "just work". The reason is that what MariaDB4j does is simply package platform specific MariaDB binaries into JARs, and then natively
mysqld. And nobody has contributed the MariaDB binaries for M1 to MariaDB4j... but contributions to the project are very welcome! ;-) https://github.com/vorburger/MariaDB4j/issues/497 tracks this FR.
If anyone's interested I was able to build the latest MariaDB4j from source with support for Apple Silicon (M1) processors.
Clone the MariaDB4j GitHub repo and switch to the master branch.
Build MariaDB from source with ARM-64 support:
arch -arm64 brew install firstname.lastname@example.org --build-from-source
Go to folder
/opt/homebrew/Cellaremail@example.com/10.2.41 and copy all the required binaries from the
script subfolders to
In a terminal go to
MariaDB4j/DBs/mariaDB4j-db-mac64-10.2.11 and do a
mvn install. This will replace the maven dependency with the Mac x86 binaries with one that contains the ARM-64 binaries.
That's it, now your tests will run in your M1 :)
Note: if your project is not using the latest MariaDB4j version then first switch to the tag that matches your MariaDB4j dependency version.