From ae20481aedbb433fbf6dc7972b86a70868d71e3a Mon Sep 17 00:00:00 2001 From: Leonid Fedorov Date: Thu, 4 Jul 2024 14:56:51 +0000 Subject: [PATCH] fix(build) Remove _GLIBXX flags for Columnstore debug builds --- CMakeLists.txt | 6 ++++++ build/bootstrap_mcs.sh | 22 ++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e56a4a0f2..081b8467c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,12 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.13) PROJECT(Columnstore) INCLUDE (CheckCXXSourceCompiles) +# MariaDB server adds this flags by default for Debug builds, and this makes our external projects +# ABI incompatible with debug STL containers +STRING(REPLACE -D_GLIBCXX_DEBUG "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) +STRING(REPLACE -D_GLIBCXX_ASSERTIONS "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) + + FOREACH(p CMP0135) IF(POLICY ${p}) CMAKE_POLICY(SET ${p} NEW) diff --git a/build/bootstrap_mcs.sh b/build/bootstrap_mcs.sh index c52faa17d..7ba080db3 100755 --- a/build/bootstrap_mcs.sh +++ b/build/bootstrap_mcs.sh @@ -351,15 +351,16 @@ build() check_user_and_group() { - if [ -z "$(grep mysql /etc/passwd)" ]; then - message "Adding user mysql into /etc/passwd" - useradd -r -U mysql -d /var/lib/mysql + user=$1 + if [ -z "$(grep $user /etc/passwd)" ]; then + message "Adding user $user into /etc/passwd" + useradd -r -U $user -d /var/lib/mysql fi - if [ -z "$(grep mysql /etc/group)" ]; then + if [ -z "$(grep $user /etc/group)" ]; then GroupID = `awk -F: '{uid[$3]=1}END{for(x=100; x<=999; x++) {if(uid[x] != ""){}else{print x; exit;}}}' /etc/group` - message "Adding group mysql with id $GroupID" - groupadd -g GroupID mysql + message "Adding group $user with id $GroupID" + groupadd -g $GroupID $user fi } @@ -370,7 +371,7 @@ run_unit_tests() warn "Skipping unittests" else message "Running unittests" - cd $MDB_SOURCE_PATH + cd $MARIA_BUILD_PATH ${CTEST_BIN_NAME} . -R columnstore: -j $(nproc) --progress cd - > /dev/null fi @@ -393,14 +394,12 @@ disable_plugins_for_bootstrap() { find /etc -type f -exec sed -i 's/plugin-load-add=auth_gssapi.so//g' {} + find /etc -type f -exec sed -i 's/plugin-load-add=ha_columnstore.so//g' {} + - find /etc -type f -exec sed -i 's/columnstore_use_import_for_batchinsert = ON//g' {} + } enable_columnstore_back() { echo plugin-load-add=ha_columnstore.so >> $CONFIG_DIR/columnstore.cnf sed -i '/\[mysqld\]/a\plugin-load-add=ha_columnstore.so' $CONFIG_DIR/columnstore.cnf - sed -i '/plugin-load-add=ha_columnstore.so/a\columnstore_use_import_for_batchinsert = ON' $CONFIG_DIR/columnstore.cnf } fix_config_files() @@ -466,7 +465,9 @@ install() make_dir $REPORT_PATH chmod 777 $REPORT_PATH - check_user_and_group + check_user_and_group mysql + check_user_and_group syslog + make_dir $CONFIG_DIR @@ -500,6 +501,7 @@ socket=/run/mysqld/mysqld.sock" > $CONFIG_DIR/socket.cnf fix_config_files + make_dir /etc/my.cnf.d if [ -d "/etc/mysql/mariadb.conf.d/" ]; then message "Copying configs from /etc/mysql/mariadb.conf.d/ to /etc/my.cnf.d" cp -rp /etc/mysql/mariadb.conf.d/* /etc/my.cnf.d