You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
Deep build refactoring phase 1 (#3562)
* configcpp refactored * logging and datatypes refactored * more dataconvert * chore(build): massive removals, auto add files to debian install file * chore(codemanagement): nodeps headers, potentioal library * chore(build): configure before autobake * chore(build): use custom cmake commands for components, mariadb-plugin-columnstore.install generated * chore(build): install deps as separate step for build-packages * more deps * check debian/mariadb-plugin-columnstore.install automatically * chore(build): add option for multibracnh compilation * Fix warning
This commit is contained in:
@ -19,6 +19,9 @@ CONFIG_DIR=$RPM_CONFIG_DIR
|
||||
|
||||
SCRIPT_LOCATION=$(dirname "$0")
|
||||
MDB_SOURCE_PATH=$(realpath "$SCRIPT_LOCATION"/../../../..)
|
||||
COLUMSNTORE_SOURCE_PATH=$(realpath "$SCRIPT_LOCATION"/../)
|
||||
|
||||
DEFAULT_MARIA_BUILD_PATH=$(realpath "$MDB_SOURCE_PATH"/../BuildOf_$(basename "$MDB_SOURCE_PATH"))
|
||||
|
||||
BUILD_TYPE_OPTIONS=("Debug" "RelWithDebInfo")
|
||||
DISTRO_OPTIONS=("ubuntu:20.04" "ubuntu:22.04" "ubuntu:24.04" "debian:11" "debian:12" "rockylinux:8" "rockylinux:9")
|
||||
@ -28,21 +31,10 @@ MDB_CMAKE_FLAGS=()
|
||||
|
||||
source "$SCRIPT_LOCATION"/utils.sh
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
error "Please run script as root to install MariaDb to system paths"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $SCRIPT_LOCATION
|
||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
message "Columnstore will be built from $color_yellow$CURRENT_BRANCH$color_cyan branch"
|
||||
cd - >/dev/null
|
||||
|
||||
echo "Arguments received: $@"
|
||||
message "Building Mariadb Server from $color_yellow$MDB_SOURCE_PATH$color_normal"
|
||||
|
||||
optparse.define short=A long=asan desc="Build with ASAN" variable=ASAN default=false value=true
|
||||
optparse.define short=a long=build-path variable=MARIA_BUILD_PATH default=$(realpath "$MDB_SOURCE_PATH"/../BuildOf_$(basename "$MDB_SOURCE_PATH"))
|
||||
optparse.define short=a long=build-path desc="Path for build output" variable=MARIA_BUILD_PATH default=$DEFAULT_MARIA_BUILD_PATH
|
||||
optparse.define short=B long=run-microbench desc="Compile and run microbenchmarks " variable=RUN_BENCHMARKS default=false value=true
|
||||
optparse.define short=c long=cloud desc="Enable cloud storage" variable=CLOUD_STORAGE_ENABLED default=false value=true
|
||||
optparse.define short=C long=force-cmake-reconfig desc="Force cmake reconfigure" variable=FORCE_CMAKE_CONFIG default=false value=true
|
||||
@ -68,10 +60,26 @@ optparse.define short=T long=tsan desc="Build with TSAN" variable=TSAN default=f
|
||||
optparse.define short=u long=skip-unit-tests desc="Skip UnitTests" variable=SKIP_UNIT_TESTS default=false value=true
|
||||
optparse.define short=U long=ubsan desc="Build with UBSAN" variable=UBSAN default=false value=true
|
||||
optparse.define short=v long=verbose desc="Verbose makefile commands" variable=MAKEFILE_VERBOSE default=false value=true
|
||||
optparse.define short=V long=add-branch-name-to-outdir desc="Add branch name to build output directory" variable=BRANCH_NAME_TO_OUTDIR default=false value=true
|
||||
optparse.define short=W long=without-core-dumps desc="Do not produce core dumps" variable=WITHOUT_COREDUMPS default=false value=true
|
||||
|
||||
source $(optparse.build)
|
||||
|
||||
message "Building MariaDB Server from $color_yellow$MDB_SOURCE_PATH$color_normal"
|
||||
|
||||
cd $COLUMSNTORE_SOURCE_PATH
|
||||
COLUMNSTORE_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
message "Columnstore will be built from $color_yellow$COLUMNSTORE_BRANCH$color_cyan branch"
|
||||
|
||||
cd $MDB_SOURCE_PATH
|
||||
MARIADB_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
message "MariaDB will be built from $color_yellow$MARIADB_BRANCH$color_cyan branch"
|
||||
cd - >/dev/null
|
||||
|
||||
if [[ ${BRANCH_NAME_TO_OUTDIR} = true ]]; then
|
||||
MARIA_BUILD_PATH="${MARIA_BUILD_PATH}_${MARIADB_BRANCH}_${COLUMNSTORE_BRANCH}"
|
||||
fi
|
||||
|
||||
if [[ ! " ${BUILD_TYPE_OPTIONS[*]} " =~ " ${MCS_BUILD_TYPE} " ]]; then
|
||||
getChoice -q "Select your Build Type" -o BUILD_TYPE_OPTIONS
|
||||
MCS_BUILD_TYPE=$selectedChoice
|
||||
@ -104,7 +112,7 @@ install_deps() {
|
||||
cppunit-devel cmake3 libxcrypt-devel xz-devel zlib-devel libzstd-devel glibc-devel"
|
||||
|
||||
DEB_BUILD_DEPS="apt-get -y update && apt-get -y install build-essential automake libboost-all-dev \
|
||||
bison cmake libncurses5-dev libaio-dev libsystemd-dev libpcre2-dev libperl-dev libssl-dev libxml2-dev \
|
||||
bison cmake libncurses5-dev python3 libaio-dev libsystemd-dev libpcre2-dev libperl-dev libssl-dev libxml2-dev \
|
||||
libkrb5-dev flex libpam-dev git libsnappy-dev libcurl4-openssl-dev libgtest-dev libcppunit-dev googletest \
|
||||
libjemalloc-dev liblz-dev liblzo2-dev liblzma-dev liblz4-dev libbz2-dev libbenchmark-dev libdistro-info-perl \
|
||||
graphviz devscripts ccache equivs eatmydata curl"
|
||||
@ -259,8 +267,9 @@ construct_cmake_flags() {
|
||||
-DWITH_WSREP=NO
|
||||
)
|
||||
|
||||
if [[ MAINTAINER_MODE = true ]]; then
|
||||
if [[ $MAINTAINER_MODE = true ]]; then
|
||||
MDB_CMAKE_FLAGS+=(-DCOLUMNSTORE_MAINTAINER=YES)
|
||||
message "Columnstore mainteiner mode on"
|
||||
else
|
||||
warn "Maintainer mode is disabled, be careful, alien"
|
||||
fi
|
||||
@ -406,9 +415,15 @@ generate_svgs() {
|
||||
}
|
||||
|
||||
build_package() {
|
||||
cd $MDB_SOURCE_PATH
|
||||
|
||||
if [[ $pkg_format == "rpm" ]]; then
|
||||
command="cmake ${MDB_CMAKE_FLAGS[@]} && make -j\$(nproc) package"
|
||||
else
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
export DEB_BUILD_OPTIONS="parallel=$(nproc)"
|
||||
export DH_BUILD_DDEBS="1"
|
||||
export BUILDPACKAGE_FLAGS="-b"
|
||||
command="mk-build-deps debian/control -t 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' -r -i && \
|
||||
CMAKEFLAGS=\"${MDB_CMAKE_FLAGS[@]}\" debian/autobake-deb.sh"
|
||||
fi
|
||||
@ -420,6 +435,14 @@ build_package() {
|
||||
check_errorcode
|
||||
}
|
||||
|
||||
check_debian_install_file() {
|
||||
message "checking debian/mariadb-plugin-columnstore.install"
|
||||
message_split
|
||||
python3 $COLUMSNTORE_SOURCE_PATH/build/debian_install_file_compare.py \
|
||||
${COLUMSNTORE_SOURCE_PATH}/debian/mariadb-plugin-columnstore.install \
|
||||
$MARIA_BUILD_PATH/mariadb-plugin-columnstore.install.generated
|
||||
}
|
||||
|
||||
build_binary() {
|
||||
MARIA_BUILD_PATH=$(realpath "$MARIA_BUILD_PATH")
|
||||
message_split
|
||||
@ -438,7 +461,7 @@ build_binary() {
|
||||
message "Configuring cmake silently"
|
||||
${CMAKE_BIN_NAME} "${MDB_CMAKE_FLAGS[@]}" -S"$MDB_SOURCE_PATH" -B"$MARIA_BUILD_PATH" | spinner
|
||||
message_split
|
||||
|
||||
check_debian_install_file
|
||||
generate_svgs
|
||||
|
||||
${CMAKE_BIN_NAME} --build "$MARIA_BUILD_PATH" -j "$CPUS" | onelinearizator &&
|
||||
@ -553,6 +576,12 @@ make_dir() {
|
||||
|
||||
install() {
|
||||
if [[ $RECOMPILE_ONLY = false ]]; then
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
error "Please run script as root to install MariaDb to system paths"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
message_split
|
||||
message "Installing MariaDB"
|
||||
disable_plugins_for_bootstrap
|
||||
@ -636,7 +665,7 @@ smoke() {
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $INSTALL_DEPS = true || $BUILD_PACKAGES = true ]]; then
|
||||
if [[ $INSTALL_DEPS = true ]]; then
|
||||
install_deps
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user