diff options
author | Daniel Black <daniel@mariadb.org> | 2022-11-29 05:21:03 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 18:21:03 +0000 |
commit | 7b44d0ba573c3a07d5fe8b43251c705ec1d63597 (patch) | |
tree | af2014421266e78acd2757e1428313ad3d008303 | |
parent | bd694bb7b28f64eb36704dd795ae351117ebeea4 (diff) | |
download | mariadb-git-7b44d0ba573c3a07d5fe8b43251c705ec1d63597.tar.gz |
MDEV-23230 wsrep files installed when built without WSREP (#2334)
Prevent wsrep files from being installed if WITH_WSREP=OFF.
Reviewed by Daniel Black
Additionally excluded #include wsrep files and galera* files
along with galera/wsrep tests.
mysql-test/include/have_wsrep.inc remainds as its used by
a few isolated tests.
Co-authored-by: Chris Ross <cross2@cisco.com>
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | cmake/install_macros.cmake | 6 | ||||
-rw-r--r-- | cmake/systemd.cmake | 5 | ||||
-rw-r--r-- | include/CMakeLists.txt | 11 | ||||
-rw-r--r-- | man/CMakeLists.txt | 12 | ||||
-rw-r--r-- | sql/CMakeLists.txt | 4 | ||||
-rw-r--r-- | support-files/CMakeLists.txt | 12 |
7 files changed, 45 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b8a420afed4..f530d2abdc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -550,7 +550,10 @@ INSTALL_DOCUMENTATION(README.md CREDITS COPYING THIRDPARTY COMPONENT Readme) # ${CMAKE_BINARY_DIR}/Docs/INFO_BIN) IF(UNIX) - INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY Docs/README-wsrep COMPONENT Readme) + INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY COMPONENT Readme) + IF(WITH_WSREP) + INSTALL_DOCUMENTATION(Docs/README-wsrep COMPONENT Readme) + ENDIF() ENDIF() INCLUDE(build_depends) diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index 765f3be23e0..7814f1dbeac 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -265,6 +265,11 @@ SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug FUNCTION(INSTALL_MYSQL_TEST from to) IF(INSTALL_MYSQLTESTDIR) + IF(NOT WITH_WSREP) + SET(EXCL_GALERA "(suite/(galera|wsrep|sys_vars/[rt]/(sysvars_)?wsrep).*|include/((w.*)?wsrep.*|.*galera.*)\\.inc|std_data/(galera|wsrep).*)") + ELSE() + SET(EXCL_GALERA "^DOES_NOT_EXIST$") + ENDIF() INSTALL( DIRECTORY ${from} DESTINATION "${INSTALL_MYSQLTESTDIR}/${to}" @@ -286,6 +291,7 @@ FUNCTION(INSTALL_MYSQL_TEST from to) PATTERN "*.vcxproj.user" EXCLUDE PATTERN "CTest*" EXCLUDE PATTERN "*~" EXCLUDE + REGEX "${EXCL_GALERA}" EXCLUDE ) ENDIF() ENDFUNCTION() diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index 255abe62351..a093b89f3c8 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -44,7 +44,10 @@ MACRO(CHECK_SYSTEMD) IF(HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF) SET(HAVE_SYSTEMD TRUE) - SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery) + SET(SYSTEMD_SCRIPTS mariadb-service-convert) + IF(WITH_WSREP) + SET(SYSTEMD_SCRIPTS ${SYSTEMD_SCRIPTS} galera_new_cluster galera_recovery) + ENDIF() IF(DEB) SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld") SET(SYSTEMD_EXECSTARTPOST "ExecStartPost=/etc/mysql/debian-start") diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index a7b98a11050..7076d2d88d2 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -74,7 +74,15 @@ FOREACH(f ${HEADERS_GEN_CONFIGURE}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${INSTALL_INCLUDEDIR}/server COMPONENT Development) ENDFOREACH(f) -INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR}/server/mysql COMPONENT Development FILES_MATCHING PATTERN "*.h") +IF(NOT WITH_WSREP) + SET(EXCL_SERVICE_WSREP "service_wsrep.h") + SET(EXCL_WSREP "wsrep.h") +ENDIF() +INSTALL(DIRECTORY mysql/ + DESTINATION ${INSTALL_INCLUDEDIR}/server/mysql COMPONENT Development + FILES_MATCHING PATTERN "*.h" + PATTERN "${EXCL_SERVICE_WSREP}" EXCLUDE +) STRING(REPLACE "." "\\." EXCL_RE "${HEADERS};${HEADERS_GEN_CONFIGURE}") STRING(REPLACE ";" "|" EXCL_RE "${EXCL_RE}") @@ -85,6 +93,7 @@ MACRO(INSTALL_PRIVATE DIR) FILES_MATCHING PATTERN "*.h" PATTERN CMakeFiles EXCLUDE PATTERN mysql EXCLUDE + PATTERN "${EXCL_WSREP}" EXCLUDE REGEX "\\./(${EXCL_RE}$)" EXCLUDE) ENDMACRO() diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index f5ae0a0fb38..975bfd5e887 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -13,6 +13,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA +SET(MAN1_WSREP wsrep_sst_rsync.1 wsrep_sst_common.1 wsrep_sst_mariabackup.1 + wsrep_sst_mysqldump.1 wsrep_sst_rsync_wan.1 galera_recovery.1 galera_new_cluster.1) SET(MAN1_SERVER innochecksum.1 myisam_ftdump.1 myisamchk.1 aria_chk.1 aria_dump_log.1 aria_ftdump.1 aria_pack.1 aria_read_log.1 aria_s3_copy.1 @@ -24,12 +26,12 @@ SET(MAN1_SERVER innochecksum.1 myisam_ftdump.1 myisamchk.1 mysqld_multi.1 mysqld_safe.1 mysqldumpslow.1 mysqlhotcopy.1 perror.1 replace.1 resolve_stack_dump.1 resolveip.1 mariadb-service-convert.1 - mysqld_safe_helper.1 wsrep_sst_common.1 - wsrep_sst_mysqldump.1 wsrep_sst_rsync.1 - galera_recovery.1 galera_new_cluster.1 + mysqld_safe_helper.1 mysql_ldb.1 myrocks_hotbackup.1 - wsrep_sst_mariabackup.1 mbstream.1 mariabackup.1 - wsrep_sst_rsync_wan.1) + mbstream.1 mariabackup.1) +IF(WITH_WSREP) + SET(MAN1_SERVER ${MAN1_SERVER} ${MAN1_WSREP}) +ENDIF() SET(MAN8_SERVER mysqld.8) SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1 mysqlaccess.1 mysqladmin.1 mysqlbinlog.1 mysqlcheck.1 diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 8143136b13b..583fe11b38b 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -495,7 +495,11 @@ IF(WIN32) TARGET_LINK_LIBRARIES(mariadb-upgrade-service mysys winservice) ENDIF(WIN32) +IF(NOT WITH_WSREP) + SET(EXCL_WSREP "wsrep*.h") +ENDIF() INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/server/private COMPONENT Development FILES_MATCHING PATTERN "*.h" PATTERN share EXCLUDE + PATTERN "${EXCL_WSREP}" EXCLUDE PATTERN CMakeFiles EXCLUDE) diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt index ff468dcbe9c..d65408fc4dd 100644 --- a/support-files/CMakeLists.txt +++ b/support-files/CMakeLists.txt @@ -51,7 +51,11 @@ ENDIF() IF(UNIX) SET(prefix ${CMAKE_INSTALL_PREFIX}) - FOREACH(script mysqld_multi.server mysql-log-rotate binary-configure wsrep_notify) + SET(SCRIPTS mysqld_multi.server mysql-log-rotate binary-configure) + IF(WITH_WSREP) + SET(SCRIPTS ${SCRIPTS} wsrep_notify) + ENDIF() + FOREACH(script ${SCRIPTS}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh ${CMAKE_CURRENT_BINARY_DIR}/${script} @ONLY ) INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${script} @@ -126,7 +130,11 @@ IF(UNIX) COMMAND ${CMAKE_COMMAND} -E create_symlink ./mariadb.service mysqld.service WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - INSTALL(FILES use_galera_new_cluster.conf + IF(WITH_WSREP) + INSTALL(FILES use_galera_new_cluster.conf + DESTINATION ${inst_location}/systemd COMPONENT SupportFiles) + ENDIF() + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.service ${CMAKE_CURRENT_BINARY_DIR}/mysql.service ${CMAKE_CURRENT_BINARY_DIR}/mysqld.service |