MariaDB 10.x not compiling on FreeBSD 12.1

ChiefZigZag

Verified User
Joined
Feb 17, 2020
Messages
47
I attempted to upgrade from MySQL to MariaDB.. the upgrade to MariaDB 5.5 worked. 10.x doesnt work at all, I tried some options provided from the following post with no luck. Here is where my build keeps stopping on MariaDB 10.4, any ideas?

Code:
...
[ 11%] Building C object plugin/auth_pam/CMakeFiles/pam_user_map.dir/mapper/pam_user_map.c.o
clang: warning: -Wl,-z,relro,-z,now: 'linker' input unused [-Wunused-command-line-argument]
/usr/local/directadmin/custombuild/mariadb-10.4.12/plugin/auth_pam/mapper/pam_user_map.c:42:10: fatal error: 'security/pam_ext.h' file not found
#include <security/pam_ext.h>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.
--- plugin/auth_pam/CMakeFiles/pam_user_map.dir/mapper/pam_user_map.c.o ---
*** [plugin/auth_pam/CMakeFiles/pam_user_map.dir/mapper/pam_user_map.c.o] Error code 1

make[2]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.12
1 error

make[2]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.12
--- plugin/auth_pam/CMakeFiles/pam_user_map.dir/all ---
*** [plugin/auth_pam/CMakeFiles/pam_user_map.dir/all] Error code 2

make[1]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.12
A failure has been detected in another branch of the parallel make

make[2]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.12
--- storage/rocksdb/CMakeFiles/rocksdblib.dir/all ---
*** [storage/rocksdb/CMakeFiles/rocksdblib.dir/all] Error code 2

make[1]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.12
A failure has been detected in another branch of the parallel make

make[2]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.12
--- storage/rocksdb/CMakeFiles/rocksdb_tools.dir/all ---
*** [storage/rocksdb/CMakeFiles/rocksdb_tools.dir/all] Error code 2

make[1]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.12
 
I haven't spent too much time with MariaDB 10.4 yet, but I've read the changelog and will recommend to stick with 10.3 for now. Latest major version has a few breaking changes when it comes to user authentication (PAM being the default). Not sure if DirectAdmin is compatible with it right now.
 
I haven't spent too much time with MariaDB 10.4 yet, but I've read the changelog and will recommend to stick with 10.3 for now. Latest major version has a few breaking changes when it comes to user authentication (PAM being the default). Not sure if DirectAdmin is compatible with it right now.

Thanks for the reply, it seems that MariaDB 10.3 doesn't build either.. similar problem. Seems to be supported by DirectAdmin since it's in the options.. but who knows?
 
Even with the custom cmake file I had outlined previously?

Unfortunately it isn't working..

Code:
...
[ 10%] Building C object plugin/auth_pam/CMakeFiles/pam_user_map.dir/mapper/pam_user_map.c.o
clang: warning: -Wl,-z,relro,-z,now: 'linker' input unused [-Wunused-command-line-argument]
/usr/local/directadmin/custombuild/mariadb-10.3.22/plugin/auth_pam/mapper/pam_user_map.c:42:10: fatal error: 'security/pam_ext.h' file not found
#include <security/pam_ext.h>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.
--- plugin/auth_pam/CMakeFiles/pam_user_map.dir/mapper/pam_user_map.c.o ---
*** [plugin/auth_pam/CMakeFiles/pam_user_map.dir/mapper/pam_user_map.c.o] Error code 1
...

Code:
root@admin:/usr/local/directadmin/custombuild # cat custom/mysql/cmake.mysql
#!/bin/sh
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_ZLIB=system \
-DWITH_EXTRA_CHARSETS=all \
-DPLUGIN_TOKUDB=NO \
-DWITH_JEMALLOC=system \
-DWITH_LIBWRAP=1 \
-DWITHOUT_TOKUDB=YES

Code:
root@admin:/usr/local/directadmin/custombuild # uname -a
FreeBSD admin 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC  amd64
 
Fixed in CB 2.0 rev. 2413.
Thanks smtalk! I went ahead and tested a fresh install of directadmin on FreeBSD 12.1.. using the ./setup.sh in custom mode selecting MariaDB 10.3 instead of mysql.. it again failed during compiling of MariaDB

Code:
[ 92%] Building CXX object storage/connect/CMakeFiles/connect.dir/blkfil.cpp.o
clang++: warning: -Wl,-z,relro,-z,now: 'linker' input unused [-Wunused-command-line-argument]
In file included from /usr/local/directadmin/custombuild/mariadb-10.3.22/storage/mroonga/ha_mroonga.cpp:23:
In file included from /usr/local/directadmin/custombuild/mariadb-10.3.22/storage/mroonga/mrn_mysql.h:51:
In file included from /usr/local/directadmin/custombuild/mariadb-10.3.22/sql/sql_class.h:30:
In file included from /usr/local/directadmin/custombuild/mariadb-10.3.22/sql/field.h:34:
In file included from /usr/local/directadmin/custombuild/mariadb-10.3.22/sql/sql_type.h:28:
In file included from /usr/local/directadmin/custombuild/mariadb-10.3.22/sql/sql_type_real.h:19:
In file included from /usr/include/c++/v1/cmath:306:
/usr/local/directadmin/custombuild/mariadb-10.3.22/storage/mroonga/version:1:1: error: expected unqualified-id
7.07
^
[ 92%] Built target mariabackup
Scanning dependencies of target spider
[ 92%] Building CXX object storage/spider/CMakeFiles/spider.dir/spd_param.cc.o
clang++: warning: -Wl,-z,relro,-z,now: 'linker' input unused [-Wunused-command-line-argument]
15 errors generated.
--- storage/mroonga/CMakeFiles/mroonga.dir/ha_mroonga.cpp.o ---
*** [storage/mroonga/CMakeFiles/mroonga.dir/ha_mroonga.cpp.o] Error code 1

make[2]: stopped in /usr/local/directadmin/custombuild/mariadb-10.3.22
1 error

I went ahead for a test and I made a custom cmake to work around this and I went ahead and did a "./build all d" with some success.
Code:
root@admin:~ # cat /usr/local/directadmin/custombuild/custom/mysql/cmake.mysql
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DWITHOUT_MROONGA=YES

It appears I am using the latest version of custombuild..

Code:
root@admin:/usr/local/directadmin # md5 custombuild.tar.gz                      MD5 (custombuild.tar.gz) = 11c58b3d7028f7052993b4b84b23b83d
root@admin:/usr/local/directadmin # grep 11c58b3d7028f7052993b4b84b23b83d custombuild_md5.txt
11c58b3d7028f7052993b4b84b23b83d
 
Added -DWITHOUT_MROONGA=YES to CB 2.0 rev. 2414, thank you for the report!
 
Last edited:
Added [icocde]-DWITHOUT_MROONGA=YES[/icode] to CB 2.0 rev. 2414, thank you for the report!
Excellent I will test!

Also, In my testing this morning I have tried MariaDB 10.4 as well.. I received the following error:
Code:
[ 56%] Building CXX object storage/tokudb/PerconaFT/locktree/CMakeFiles/locktree.dir/keyrange.cc.o
In file included from /usr/local/directadmin/custombuild/mariadb-10.4.12/storage/rocksdb/rocksdb/db/malloc_stats.cc:16:
/usr/local/directadmin/custombuild/mariadb-10.4.12/storage/rocksdb/rocksdb/port/jemalloc_helper.h:44:19: error: redefinition of 'malloc_usable_size' as different kind of symbol
extern "C" size_t malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void*)
                  ^
/usr/include/malloc_np.h:71:8: note: previous definition is here
size_t  malloc_usable_size(const void *ptr);
        ^
In file included from /usr/local/directadmin/custombuild/mariadb-10.4.12/storage/rocksdb/rocksdb/db/malloc_stats.cc:16:
/usr/local/directadmin/custombuild/mariadb-10.4.12/storage/rocksdb/rocksdb/port/jemalloc_helper.h:44:38: error: use of undeclared identifier 'JEMALLOC_USABLE_SIZE_CONST'
extern "C" size_t malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void*)
                                     ^
/usr/local/directadmin/custombuild/mariadb-10.4.12/storage/rocksdb/rocksdb/port/jemalloc_helper.h:44:71: error: expected ';' after top level declarator
extern "C" size_t malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void*)
                                                                      ^
                                                                      ;
/usr/local/directadmin/custombuild/mariadb-10.4.12/storage/rocksdb/rocksdb/port/jemalloc_helper.h:45:24: warning: declaration does not declare anything [-Wmissing-declarations]
    JEMALLOC_CXX_THROW __attribute__((__weak__));
                       ^
/usr/local/directadmin/custombuild/mariadb-10.4.12/storage/rocksdb/rocksdb/port/jemalloc_helper.h:58:43: warning: comparison of function 'malloc_usable_size' not equal to a null pointer is always true [-Wtautological-pointer-compare]
         malloc_stats_print != nullptr && malloc_usable_size != nullptr;
                                          ^~~~~~~~~~~~~~~~~~    ~~~~~~~
/usr/local/directadmin/custombuild/mariadb-10.4.12/storage/rocksdb/rocksdb/port/jemalloc_helper.h:58:43: note: prefix with the address-of operator to silence this warning
         malloc_stats_print != nullptr && malloc_usable_size != nullptr;
                                          ^
                                          &
clang++: warning: -Wl,-z,relro,-z,now: 'linker' input unused [-Wunused-command-line-argument]
2 warnings and 3 errors generated.

I am uncertain to what the solution is for this and i'll try again with the latest revision you provided with MariaDB 10.3.
 
Mine fails on 12.1-release p10 at setup.sh. Seems to fail around
/usr/local/directadmin/custombuild/mariadb-10.4.14/plugin/auth_gssapi/gssapi_server.cc:79:5: error: use of undeclared identifier 'krb5_xfree'
krb5_free_unparsed_name(context, unparsed_name);
^
/usr/local/directadmin/custombuild/mariadb-10.4.14/plugin/auth_gssapi/gssapi_server.cc:34:38: note: expanded from macro 'krb5_free_unparsed_name'
#define krb5_free_unparsed_name(a,b) krb5_xfree(b)
^
1 error generated.
*** [plugin/auth_gssapi/CMakeFiles/auth_gssapi.dir/gssapi_server.cc.o] Error code 1

make[2]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.14
1 error

make[2]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.14
*** [plugin/auth_gssapi/CMakeFiles/auth_gssapi.dir/all] Error code 2

make[1]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.14
1 error

make[1]: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.14
*** [all] Error code 2

make: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.14
1 error

make: stopped in /usr/local/directadmin/custombuild/mariadb-10.4.14

Trying ./setup.sh auto seeing if that does anything or if it still fails. Still fails

looks like it relates to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248114


I tried 10.4, 10.3 and 10.5

All-cause setup.sh to fail.

I tried with Custom info from @mmx and @ChiefZigZag
I also tried it in the non-custom way.
All fail.

Funny thing is this seemed to work a week ago.

Any thoughts are welcome. I would really like to keep testing FreeBSD.
 
Last edited:
Mine fails on 12.1-release p10 at setup.sh. Seems to fail around

Trying ./setup.sh auto seeing if that does anything or if it still fails. Still fails

looks like it relates to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248114


I tried 10.4, 10.3 and 10.5

All-cause setup.sh to fail.

I tried with Custom info from @mmx and @ChiefZigZag
I also tried it in the non-custom way.
All fail.

Funny thing is this seemed to work a week ago.

Any thoughts are welcome. I would really like to keep testing FreeBSD.
Ok I tried the
Custom version route to see if that helped. https://help.directadmin.com/item.php?id=565
Failed

I looked on the file server and only the current one is kept. Might want to revise that since the current version might be unstable. :cool:

I guess for fun I will wipe my test server and try freebsd 11 and see if that helps.
 
Ok starting a completely vanilla install on Freebsd 11.2. I assume this will install Mysql vs Mariadb.
Least it will give me a good idea if it is mariadb causing issues.
 
Well even a standard install fails on FreeBSD 11.2. I think I will make a new post as this isn't just MariaDB.

Make complete
Packaging mysql-5.7.31...
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: MySQL
CPack: - Install project: MySQL []
CPack: Create package
CPack: - package: /usr/local/directadmin/custombuild/mysql-5.7.31/mysql-5.7.31-freebsd11.2-x86_64.tar.gz generated.
Moving mysql-5.7.31-*.tar.gz to /usr/local/directadmin/custombuild ...
Done.
Cannot find mysql-5.7.31-freebsd11-x86_64.tar.gz for installation
Could not find /usr/local/directadmin/scripts/directadmin_cron or it is empty
 
For MariaDB:

1. touch /usr/local/directadmin/custombuild/custom/mysql/cmake.mysql

2. Put this inside:

Code:
#!/bin/sh
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_ZLIB=system \
-DWITH_EXTRA_CHARSETS=all \
-DPLUGIN_TOKUDB=NO \
-DWITH_JEMALLOC=system \
-DWITH_LIBWRAP=1 \
-DWITHOUT_ROCKSDB=YES \
-DWITHOUT_TOKUDB=YES \
-DWITHOUT_MROONGA=YES

and versions <=10.4.* will build fine.
 
For MariaDB:

1. touch /usr/local/directadmin/custombuild/custom/mysql/cmake.mysql

2. Put this inside:

Code:
#!/bin/sh
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_ZLIB=system \
-DWITH_EXTRA_CHARSETS=all \
-DPLUGIN_TOKUDB=NO \
-DWITH_JEMALLOC=system \
-DWITH_LIBWRAP=1 \
-DWITHOUT_ROCKSDB=YES \
-DWITHOUT_TOKUDB=YES \
-DWITHOUT_MROONGA=YES

and versions <=10.4.* will build fine.
I will try this again in a bit. I must have put it in wrong before.
 
Ok here is the latest.

it kept failing at "error: use of undeclared identifier 'krb5_xfree'"
So there is some bug there in the krb5 package

So I put in Watties CMake above
ran the setup.sh it failed at error: use of undeclared identifier 'krb5_xfree'
so then I removed the package krb5 which is in the Preinstall commands from the system with
Code:
pkg delete krb5

then reran ./build mariadb
it succeeds fully without krb5

So must be related to krb5
I found this https://github.com/MariaDB/server/commit/93cee30309588b62312debba714eec06ea5b2063
and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248114
 
I wanted to say I was able to fully install on FreeBSD 12 R p10 by using Mysql 8. I never could get MariaDB of any flavor to install.
 
I can confirm this. I was not able to update to a recent MariaDB version without removing krb5. Sadly krb5 is required by PHP7... so I had to deinstall it, update MariaDB, then install it back.
 
Last edited:
Back
Top