From 486ca8135119dcdc2e6cfc411dbde82e5446a0c0 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 10 Apr 2024 09:43:33 +0200 Subject: [PATCH 1/3] PS-9188: Introduce `BUILD_PARAMS_TYPE` in azure-pipelines.yml --- azure-pipelines.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b7a841c84adf..fd8b2e3d7dd7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -73,7 +73,7 @@ jobs: CCACHE_MAXSIZE: 2G OS_NAME: $(Agent.OS) PARENT_BRANCH: 8.0 - INVERTED: OFF + BUILD_PARAMS_TYPE: normal strategy: matrix: @@ -98,13 +98,13 @@ jobs: BuildType: RelWithDebInfo ${{ if or(ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'fullci')) }}: - clang-17 RelWithDebInfo INVERTED=ON [Ubuntu 22.04 Jammy]: + clang-17 RelWithDebInfo INVERTED [Ubuntu 22.04 Jammy]: imageName: 'ubuntu-22.04' UBUNTU_CODE_NAME: jammy Compiler: clang CompilerVer: 17 BuildType: RelWithDebInfo - INVERTED: ON + BUILD_PARAMS_TYPE: inverted ${{ if or(ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'fullci')) }}: clang-17 Debug [Ubuntu 22.04 Jammy]: @@ -114,13 +114,13 @@ jobs: CompilerVer: 17 BuildType: Debug - clang-17 Debug INVERTED=ON [Ubuntu 22.04 Jammy]: + clang-17 Debug INVERTED [Ubuntu 22.04 Jammy]: imageName: 'ubuntu-22.04' UBUNTU_CODE_NAME: jammy Compiler: clang CompilerVer: 17 BuildType: Debug - INVERTED: ON + BUILD_PARAMS_TYPE: inverted ${{ if or(ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'fullci')) }}: clang-16 RelWithDebInfo [Ubuntu 22.04 Jammy]: @@ -391,7 +391,7 @@ jobs: SELECTED_CXX=clang++ fi - echo SELECTED_CC=$SELECTED_CC SELECTED_CXX=$SELECTED_CXX BuildType=$(BuildType) INVERTED=$(INVERTED) imageName=$(imageName) OS_NAME=$OS_NAME + echo SELECTED_CC=$SELECTED_CC SELECTED_CXX=$SELECTED_CXX BuildType=$(BuildType) BUILD_PARAMS_TYPE=$(BUILD_PARAMS_TYPE) imageName=$(imageName) OS_NAME=$OS_NAME echo --- Configure required LLVM and Ubuntu Toolchain repositories if [[ "$OS_NAME" == "Linux" ]] && [[ "$SELECTED_CC" == "clang"* ]]; then PACKAGES="llvm-$(CompilerVer)-dev $PACKAGES" @@ -406,7 +406,7 @@ jobs: sudo -E apt-get -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install $PACKAGES cmake cmake-curses-gui ccache bison libudev-dev libaio-dev libmecab-dev libnuma-dev libssl-dev libreadline-dev libedit-dev libpam-dev libcurl4-openssl-dev libldap2-dev libkrb5-dev libsasl2-dev libsasl2-modules-gssapi-mit || exit 1; `# SYSTEM_LIBRARIES = CURL EDITLINE ICU LIBEVENT LZ4 PROTOBUF SSL ZSTD FIDO (Ubuntu 21.04+)` - if [[ "$(INVERTED)" != "ON" ]]; then + if [[ "$(BUILD_PARAMS_TYPE)" != "inverted" ]]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install libicu-dev libevent-dev liblz4-dev zlib1g-dev protobuf-compiler libprotobuf-dev libprotoc-dev libzstd-dev libfido2-dev || exit 1; else sudo -E apt-get -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install libgflags-dev || exit 1; @@ -436,8 +436,8 @@ jobs: - task: Cache@2 continueOnError: true inputs: - key: '"ccache"| "$(PARENT_BRANCH)" | "$(imageName)-$(Compiler)-$(REAL_COMPILER_VER)-$(BuildType)" | "INVERTED=$(INVERTED)" | "$(Build.SourceVersion)"' - restoreKeys: '"ccache" | "$(PARENT_BRANCH)" | "$(imageName)-$(Compiler)-$(REAL_COMPILER_VER)-$(BuildType)" | "INVERTED=$(INVERTED)"' + key: '"ccache"| "$(PARENT_BRANCH)" | "$(imageName)-$(Compiler)-$(REAL_COMPILER_VER)-$(BuildType)" | "BUILD_PARAMS_TYPE=$(BUILD_PARAMS_TYPE)" | "$(Build.SourceVersion)"' + restoreKeys: '"ccache" | "$(PARENT_BRANCH)" | "$(imageName)-$(Compiler)-$(REAL_COMPILER_VER)-$(BuildType)" | "BUILD_PARAMS_TYPE=$(BUILD_PARAMS_TYPE)"' path: $(CCACHE_DIR) displayName: '*** Download/upload ccached files' @@ -473,7 +473,7 @@ jobs: displayName: '*** System and compiler info' - script: | - echo SELECTED_CC=$SELECTED_CC SELECTED_CXX=$SELECTED_CXX REAL_COMPILER_VER=$REAL_COMPILER_VER BuildType=$(BuildType) INVERTED=$(INVERTED) imageName=$(imageName) OS_NAME=$OS_NAME + echo SELECTED_CC=$SELECTED_CC SELECTED_CXX=$SELECTED_CXX REAL_COMPILER_VER=$REAL_COMPILER_VER BuildType=$(BuildType) BUILD_PARAMS_TYPE=$(BUILD_PARAMS_TYPE) imageName=$(imageName) OS_NAME=$OS_NAME echo --- Set cmake parameters COMPILE_OPT+=( -DCMAKE_C_FLAGS_DEBUG=-g1 @@ -526,7 +526,7 @@ jobs: CMAKE_OPT+=" -DMYSQL_MAINTAINER_MODE=ON " - if [[ "$(INVERTED)" != "ON" ]]; then + if [[ "$(BUILD_PARAMS_TYPE)" != "inverted" ]]; then CMAKE_OPT+=" -DWITH_MECAB=system -DWITH_NUMA=ON From a4d64d02780059524a49e914b2153d400afe6a0c Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 10 Apr 2024 09:47:41 +0200 Subject: [PATCH 2/3] PS-9188: Add clang-18 to Azure Pipelines --- azure-pipelines.yml | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fd8b2e3d7dd7..79a133f023d1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -90,54 +90,69 @@ jobs: BuildType: Debug # clang-6 and newer compilers - clang-17 RelWithDebInfo [Ubuntu 22.04 Jammy]: + clang-18 RelWithDebInfo [Ubuntu 22.04 Jammy]: imageName: 'ubuntu-22.04' UBUNTU_CODE_NAME: jammy Compiler: clang - CompilerVer: 17 + CompilerVer: 18 BuildType: RelWithDebInfo ${{ if or(ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'fullci')) }}: - clang-17 RelWithDebInfo INVERTED [Ubuntu 22.04 Jammy]: + clang-18 RelWithDebInfo INVERTED [Ubuntu 22.04 Jammy]: imageName: 'ubuntu-22.04' UBUNTU_CODE_NAME: jammy Compiler: clang - CompilerVer: 17 + CompilerVer: 18 BuildType: RelWithDebInfo BUILD_PARAMS_TYPE: inverted ${{ if or(ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'fullci')) }}: - clang-17 Debug [Ubuntu 22.04 Jammy]: + clang-18 Debug [Ubuntu 22.04 Jammy]: imageName: 'ubuntu-22.04' UBUNTU_CODE_NAME: jammy Compiler: clang - CompilerVer: 17 + CompilerVer: 18 BuildType: Debug - clang-17 Debug INVERTED [Ubuntu 22.04 Jammy]: + clang-18 Debug INVERTED [Ubuntu 22.04 Jammy]: imageName: 'ubuntu-22.04' UBUNTU_CODE_NAME: jammy Compiler: clang - CompilerVer: 17 + CompilerVer: 18 BuildType: Debug BUILD_PARAMS_TYPE: inverted ${{ if or(ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'fullci')) }}: - clang-16 RelWithDebInfo [Ubuntu 22.04 Jammy]: + clang-17 RelWithDebInfo [Ubuntu 22.04 Jammy]: imageName: 'ubuntu-22.04' UBUNTU_CODE_NAME: jammy Compiler: clang - CompilerVer: 16 + CompilerVer: 17 BuildType: RelWithDebInfo ${{ if or(ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'fullci')) }}: - clang-16 Debug [Ubuntu 22.04 Jammy]: + clang-17 Debug [Ubuntu 22.04 Jammy]: imageName: 'ubuntu-22.04' UBUNTU_CODE_NAME: jammy Compiler: clang - CompilerVer: 16 + CompilerVer: 17 BuildType: Debug + ${{ if or(ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'fullci')) }}: + clang-16 RelWithDebInfo [Ubuntu 22.04 Jammy]: + imageName: 'ubuntu-22.04' + UBUNTU_CODE_NAME: jammy + Compiler: clang + CompilerVer: 16 + BuildType: RelWithDebInfo + + clang-16 Debug [Ubuntu 22.04 Jammy]: + imageName: 'ubuntu-22.04' + UBUNTU_CODE_NAME: jammy + Compiler: clang + CompilerVer: 16 + BuildType: Debug + ${{ if or(ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'fullci')) }}: clang-15 RelWithDebInfo [Ubuntu 22.04 Jammy]: imageName: 'ubuntu-22.04' From 310ccc7ca342c86fdd22d7d2636ebe86079bb0e3 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 10 Apr 2024 13:37:13 +0200 Subject: [PATCH 3/3] PS-9188: Fix clang-18 compilation issues 1. Boost issues: ``` In file included from /data/mysql-server/percona-8.0/sql/gis/line_interpolate.cc:29: In file included from /data/mysql-server/_deps/boost_1_77_0/boost/geometry.hpp:17: In file included from /data/mysql-server/_deps/boost_1_77_0/boost/geometry/geometry.hpp:53: In file included from /data/mysql-server/_deps/boost_1_77_0/boost/geometry/core/radian_access.hpp:26: In file included from /data/mysql-server/_deps/boost_1_77_0/boost/numeric/conversion/cast.hpp:33: In file included from /data/mysql-server/_deps/boost_1_77_0/boost/numeric/conversion/converter.hpp:13: In file included from /data/mysql-server/_deps/boost_1_77_0/boost/numeric/conversion/conversion_traits.hpp:13: In file included from /data/mysql-server/_deps/boost_1_77_0/boost/numeric/conversion/detail/conversion_traits.hpp:18: In file included from /data/mysql-server/_deps/boost_1_77_0/boost/numeric/conversion/detail/int_float_mixture.hpp:19: In file included from /data/mysql-server/_deps/boost_1_77_0/boost/mpl/integral_c.hpp:32: /data/mysql-server/_deps/boost_1_77_0/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'udt_builtin_mixture_enum' [-Wenum-constexpr-conversion] 73 | typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior; | ^ /data/mysql-server/_deps/boost_1_77_0/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST' 24 | # define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast(expr) | ``` 2. Issues with stdc++ library from gcc-13: ``` In file included from /data/mysql-server/percona-8.0/libbinlogevents/src/compression/none_comp.cpp:23: In file included from /data/mysql-server/percona-8.0/libbinlogevents/include/compression/none_comp.h:26: In file included from /data/mysql-server/percona-8.0/libbinlogevents/include/compression/compressor.h:27: In file included from /data/mysql-server/percona-8.0/libbinlogevents/include/compression/base.h:26: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/string:54: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:39: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ext/alloc_traits.h:34: /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:266:8: error: 'construct, mysqlns::buffer::Buffer_view<>>' is deprecated: std::allocator::construct is deprecated in C++17 [-Werror,-Wdeprecated-declarations] 266 | { __a.construct(__p, std::forward<_Args>(__args)...); } | ^ /data/mysql-server/percona-8.0/libbinlogevents/include/resource/allocator.h:139:5: note: 'construct, mysqlns::buffer::Buffer_view<>>' has been explicitly marked deprecated here 139 | [[deprecated("std::allocator::construct is deprecated in C++17")]] void | ^ ``` --- cmake/maintainer.cmake | 5 +++++ sql/CMakeLists.txt | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index 9927d598f846..f99343bd1051 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -118,6 +118,11 @@ IF(MY_COMPILER_IS_CLANG) STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wno-shorten-64-to-32") ENDIF() + # Suppress warnings for clang-18 or newer + IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18) + STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wno-deprecated-declarations") + ENDIF() + STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wextra-semi") STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wheader-hygiene") STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wnon-virtual-dtor") diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index f0c9795534d8..7fc22a7b961a 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -973,6 +973,11 @@ ADD_DEPENDENCIES(sql_gis GenError) TARGET_LINK_LIBRARIES(sql_gis sql_dd sql_main) SET_TARGET_PROPERTIES(sql_gis PROPERTIES LINK_INTERFACE_MULTIPLICITY 3) +# Suppress warnings for clang-18 or newer +IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18) + TARGET_COMPILE_OPTIONS(sql_gis PRIVATE -Wno-enum-constexpr-conversion) +ENDIF() + # This typically saves a few hundred megabytes of disk space. IF(COMPRESS_DEBUG_SECTIONS) MY_CHECK_CXX_COMPILER_FLAG("-gz" HAVE_COMPRESS_GZ_OPTION)