From abbeef7abb4e38e871a7b1e8f52f7a9b1f5bfc63 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 17:27:22 -0700 Subject: [PATCH 01/21] see if we can update cmake --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17185468..07655acc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.27) # set the project name project(substrait-cpp) From 8ed3ba8af499eefca364b737dcb24c2ee91c5cb0 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 17:53:39 -0700 Subject: [PATCH 02/21] removed abseil-cpp submodule --- .gitmodules | 3 --- .licenserc.yaml | 1 - CMakeLists.txt | 17 ++--------------- third_party/CMakeLists.txt | 4 ---- third_party/abseil-cpp | 1 - 5 files changed, 2 insertions(+), 24 deletions(-) delete mode 160000 third_party/abseil-cpp diff --git a/.gitmodules b/.gitmodules index 6a09c571..3fb78da1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,6 @@ [submodule "third_party/fmt"] path = third_party/fmt url = https://github.com/fmtlib/fmt -[submodule "third_party/abseil-cpp"] - path = third_party/abseil-cpp - url = https://github.com/abseil/abseil-cpp.git [submodule "third_party/datetime"] path = third_party/datetime url = https://github.com/HowardHinnant/date.git diff --git a/.licenserc.yaml b/.licenserc.yaml index ceea7649..f2e85bba 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -12,7 +12,6 @@ header: - '.clang-tidy' - '.cmake-format' - '.licenserc.yaml' - - 'third_party/abseil-cpp' - 'third_party/antlr4' - 'third_party/datetime' - 'third_party/fmt' diff --git a/CMakeLists.txt b/CMakeLists.txt index 07655acc..9ad3e15c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,25 +33,12 @@ option( include_directories(include) include_directories(src) -# TODO: Simplify once we can require cmake 3.27 (where CONFIG is default). - -# Due to packaging changes we use the combined protobuf/absl packaging if -# available otherwise we fallback to the older protobuf method. find_package(Protobuf QUIET CONFIG) if(${Protobuf_FOUND}) message(STATUS "Modern protobuf library located.") - set(ABSL_INCLUDED_WITH_PROTOBUF ON) else() - find_package(Protobuf QUIET) - if(${Protobuf_FOUND}) - message(STATUS "Legacy protobuf library located.") - include_directories(${Protobuf_INCLUDE_DIRS}) - set(ABSL_INCLUDED_WITH_PROTOBUF OFF) - else() - message(STATUS "Fetching external protobuf library.") - include(third_party/protobuf.cmake) - set(ABSL_INCLUDED_WITH_PROTOBUF ON) - endif() + message(STATUS "Fetching external protobuf library.") + include(third_party/protobuf.cmake) endif() add_subdirectory(third_party) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 0a5f605b..19bb06d5 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -4,10 +4,6 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) set(ABSL_ENABLE_INSTALL ON) -if(NOT ${ABSL_INCLUDED_WITH_PROTOBUF}) - set(ABSL_PROPAGATE_CXX_STD ON) - add_subdirectory(abseil-cpp) -endif() include(datetime.cmake) diff --git a/third_party/abseil-cpp b/third_party/abseil-cpp deleted file mode 160000 index c2435f83..00000000 --- a/third_party/abseil-cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c2435f8342c2d0ed8101cb43adfd605fdc52dca2 From 1f6a6e9879f582d5e9dc17302460e9409be94cfb Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 18:28:12 -0700 Subject: [PATCH 03/21] Update protobuf library to v24.4 --- third_party/CMakeLists.txt | 4 ++-- third_party/protobuf.cmake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 19bb06d5..a00791c2 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -13,12 +13,12 @@ find_package(GTest QUIET) if(NOT ${GTEST_FOUND}) message(STATUS "Retrieving external GoogleTest library.") include(FetchContent) - fetchcontent_declare( + FetchContent_Declare( GTest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG v1.14.0 OVERRIDE_FIND_PACKAGE) - fetchcontent_makeavailable(GTest) + FetchContent_MakeAvailable(GTest) endif() set(PREVIOUS_BUILD_TESTING ${BUILD_TESTING}) diff --git a/third_party/protobuf.cmake b/third_party/protobuf.cmake index e7942cf3..44309fd4 100644 --- a/third_party/protobuf.cmake +++ b/third_party/protobuf.cmake @@ -12,7 +12,7 @@ FetchContent_Declare(GTest ) FetchContent_Declare(Protobuf GIT_REPOSITORY https://github.com/protocolbuffers/protobuf.git - GIT_TAG v23.4 + GIT_TAG v24.4 OVERRIDE_FIND_PACKAGE ) set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "") From 257cc5594acd0fe85b8499eb63c5591680fc66d4 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 18:33:57 -0700 Subject: [PATCH 04/21] fix check --- third_party/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index a00791c2..19bb06d5 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -13,12 +13,12 @@ find_package(GTest QUIET) if(NOT ${GTEST_FOUND}) message(STATUS "Retrieving external GoogleTest library.") include(FetchContent) - FetchContent_Declare( + fetchcontent_declare( GTest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG v1.14.0 OVERRIDE_FIND_PACKAGE) - FetchContent_MakeAvailable(GTest) + fetchcontent_makeavailable(GTest) endif() set(PREVIOUS_BUILD_TESTING ${BUILD_TESTING}) From 30bd4a459666e1d06dfb842d97d3a6327baa884a Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 18:45:51 -0700 Subject: [PATCH 05/21] try disabling attribute warnings --- scripts/run-clang-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index 293ef869..d4f60d16 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -4,7 +4,7 @@ SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" # Make compile_command.json -rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON +rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON -wattributes # Build substrait protobuf pushd tmp/src/substrait/proto && make -j && popd || exit # Build textplan grammar From 694c24d7a518f463efb991e93f4f8aac173f8979 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 18:46:51 -0700 Subject: [PATCH 06/21] updated --- scripts/run-clang-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index d4f60d16..60c44ecf 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -4,7 +4,7 @@ SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" # Make compile_command.json -rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON -wattributes +rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON -Wattributes # Build substrait protobuf pushd tmp/src/substrait/proto && make -j && popd || exit # Build textplan grammar From 2090c602bdfef96d3bf25b46b35a1b173f480b26 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 18:56:01 -0700 Subject: [PATCH 07/21] updated --- scripts/run-clang-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index 60c44ecf..b3427a97 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -4,7 +4,7 @@ SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" # Make compile_command.json -rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON -Wattributes +rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON -Wno-attributes # Build substrait protobuf pushd tmp/src/substrait/proto && make -j && popd || exit # Build textplan grammar From 9561d1e21cf8c3f35d9873a8d8ea00d1cb4fb05c Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 20:24:31 -0700 Subject: [PATCH 08/21] Use the .clang-tidy file --- .clang-tidy | 1 + scripts/run-clang-tidy.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index b65f4a8e..ae5cc0f8 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -77,6 +77,7 @@ Checks: > -bugprone-implicit-widening-of-multiplication-result, -bugprone-unchecked-optional-access WarningsAsErrors: '*' +ExtraArgs: ['-Wno-assertions'] HeaderFilterRegex: 'io/substrait/*.\\.h$' AnalyzeTemporaryDtors: false FormatStyle: none diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index b3427a97..293ef869 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -4,7 +4,7 @@ SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" # Make compile_command.json -rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON -Wno-attributes +rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON # Build substrait protobuf pushd tmp/src/substrait/proto && make -j && popd || exit # Build textplan grammar From a07fe419ead22950214b990b488caa8591472e95 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 20:30:35 -0700 Subject: [PATCH 09/21] update --- .clang-tidy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index ae5cc0f8..805773ec 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -77,7 +77,7 @@ Checks: > -bugprone-implicit-widening-of-multiplication-result, -bugprone-unchecked-optional-access WarningsAsErrors: '*' -ExtraArgs: ['-Wno-assertions'] +ExtraArgs: ['-Wno-attributes'] HeaderFilterRegex: 'io/substrait/*.\\.h$' AnalyzeTemporaryDtors: false FormatStyle: none From e69177eb3f3e38799629e9d8642b5eef6f64b13c Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 20:55:05 -0700 Subject: [PATCH 10/21] try header filters --- .clang-tidy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 805773ec..da3ed517 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -77,8 +77,7 @@ Checks: > -bugprone-implicit-widening-of-multiplication-result, -bugprone-unchecked-optional-access WarningsAsErrors: '*' -ExtraArgs: ['-Wno-attributes'] -HeaderFilterRegex: 'io/substrait/*.\\.h$' +HeaderFilterRegex: 'io/substrait/.*\\.h$|protobuf/.*\\.h$' AnalyzeTemporaryDtors: false FormatStyle: none CheckOptions: From 603eae23d818701fc0287f9471dbf5215b1cab56 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 21:00:07 -0700 Subject: [PATCH 11/21] try using environment variables --- .clang-tidy | 2 +- scripts/run-clang-tidy.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index da3ed517..973b72d5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -77,7 +77,7 @@ Checks: > -bugprone-implicit-widening-of-multiplication-result, -bugprone-unchecked-optional-access WarningsAsErrors: '*' -HeaderFilterRegex: 'io/substrait/.*\\.h$|protobuf/.*\\.h$' +HeaderFilterRegex: 'io/substrait/.*\\.h$' AnalyzeTemporaryDtors: false FormatStyle: none CheckOptions: diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index 293ef869..211d4458 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -4,6 +4,7 @@ SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" # Make compile_command.json +export CXXFLAGS=-Wno-attributes rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON # Build substrait protobuf pushd tmp/src/substrait/proto && make -j && popd || exit From 3b36743529f3fa2583ccfca1df7fad6abe37436c Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 21:25:40 -0700 Subject: [PATCH 12/21] another attempt --- third_party/protobuf.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/protobuf.cmake b/third_party/protobuf.cmake index 44309fd4..9b23703a 100644 --- a/third_party/protobuf.cmake +++ b/third_party/protobuf.cmake @@ -12,7 +12,7 @@ FetchContent_Declare(GTest ) FetchContent_Declare(Protobuf GIT_REPOSITORY https://github.com/protocolbuffers/protobuf.git - GIT_TAG v24.4 + GIT_TAG v25.4 OVERRIDE_FIND_PACKAGE ) set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "") From 3f2949a451c27a16886a37e8e8bd15156699cd66 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 21:30:58 -0700 Subject: [PATCH 13/21] ignore another warning --- scripts/run-clang-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index 211d4458..d7b29484 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -4,7 +4,7 @@ SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" # Make compile_command.json -export CXXFLAGS=-Wno-attributes +export CXXFLAGS="-Wno-attributes -Wno-deprecated-declaraations" rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON # Build substrait protobuf pushd tmp/src/substrait/proto && make -j && popd || exit From e291f762e8c7eee786bab0982722eeafba6bcd68 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 21:33:57 -0700 Subject: [PATCH 14/21] typo fix --- scripts/run-clang-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index d7b29484..6d88082f 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -4,7 +4,7 @@ SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" # Make compile_command.json -export CXXFLAGS="-Wno-attributes -Wno-deprecated-declaraations" +export CXXFLAGS="-Wno-attributes -Wno-deprecated-declarations" rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON # Build substrait protobuf pushd tmp/src/substrait/proto && make -j && popd || exit From d47fab625066f0b61548260c58a61c70e19341f6 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 21:51:35 -0700 Subject: [PATCH 15/21] adding diagnostics to the clang-tidy script --- scripts/run-clang-tidy.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index 6d88082f..22507261 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -3,14 +3,16 @@ SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" -# Make compile_command.json -export CXXFLAGS="-Wno-attributes -Wno-deprecated-declarations" +echo Checking Python version +which python + +echo Making compile_command.json rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON -# Build substrait protobuf +echo Building substrait protobuf pushd tmp/src/substrait/proto && make -j && popd || exit -# Build textplan grammar +echo Building textplan grammar pushd tmp/src/substrait/textplan/parser/grammar && make -j antlr4_runtime textplan_grammar_headers && popd || exit -# Run clang-tidy +echo Running clang-tidy if [ "$1" == "fix" ]; then python3 scripts/run-clang-tidy.py "$WORKDIR" "tmp" "third_party" "h,hpp,cc,cpp" "--quiet --fix" else From 39af88ecc359939772900a43f65474a691d97369 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 21:52:56 -0700 Subject: [PATCH 16/21] added more detail --- scripts/run-clang-tidy.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index 22507261..d708db50 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -3,9 +3,6 @@ SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" -echo Checking Python version -which python - echo Making compile_command.json rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON echo Building substrait protobuf @@ -18,3 +15,4 @@ if [ "$1" == "fix" ]; then else python3 scripts/run-clang-tidy.py "$WORKDIR" "tmp" "third_party" "h,hpp,cc,cpp" "--quiet" fi +echo Finished running clang-tidy From 0f7072c8ed7ce92253d026496351de27ffd18580 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 25 Jul 2024 21:59:40 -0700 Subject: [PATCH 17/21] reorganized --- scripts/run-clang-tidy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index d708db50..b7a544d6 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -3,10 +3,14 @@ SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" +set -o errexit + echo Making compile_command.json rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON echo Building substrait protobuf -pushd tmp/src/substrait/proto && make -j && popd || exit +pushd tmp/src/substrait/proto +make -j +popd echo Building textplan grammar pushd tmp/src/substrait/textplan/parser/grammar && make -j antlr4_runtime textplan_grammar_headers && popd || exit echo Running clang-tidy From 1526337639eb5b0b37fc4447cf1c8c15838dbfe3 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Fri, 26 Jul 2024 15:55:57 -0700 Subject: [PATCH 18/21] Add a new option to handle clang-tidy builds. --- CMakeLists.txt | 6 ++++++ scripts/run-clang-tidy.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ad3e15c..cfcae79c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,12 @@ if(${SUBSTRAIT_CPP_BUILD_TESTING}) enable_testing() endif() +if(${CLANG_TIDY_BUILD}) + add_compile_options( + "-Wno-attributes;-Wno-deprecated-declarations" + ) +endif() + install(EXPORT SubstraitTargets DESTINATION lib/cmake/Substrait) add_subdirectory(src/substrait) diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index b7a544d6..358044f0 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -6,7 +6,7 @@ WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" set -o errexit echo Making compile_command.json -rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON +rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_BUILD_TESTING=OFF -DCLANG_TIDY_BUILD=ON echo Building substrait protobuf pushd tmp/src/substrait/proto make -j From 5d52aedda3feac05900d2dc3b58a77d6d126c96f Mon Sep 17 00:00:00 2001 From: David Sisson Date: Fri, 26 Jul 2024 15:58:30 -0700 Subject: [PATCH 19/21] tidy --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cfcae79c..e6301372 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,9 +51,7 @@ if(${SUBSTRAIT_CPP_BUILD_TESTING}) endif() if(${CLANG_TIDY_BUILD}) - add_compile_options( - "-Wno-attributes;-Wno-deprecated-declarations" - ) + add_compile_options("-Wno-attributes;-Wno-deprecated-declarations") endif() install(EXPORT SubstraitTargets DESTINATION lib/cmake/Substrait) From 5d02857e4db94021b7c9f3f61f7da4e732cdd531 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Fri, 26 Jul 2024 16:02:15 -0700 Subject: [PATCH 20/21] Move CLANG_TIDY_BUILD settings earlier. --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6301372..e8d6c11c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,10 @@ option( include_directories(include) include_directories(src) +if(${CLANG_TIDY_BUILD}) + add_compile_options("-Wno-attributes;-Wno-deprecated-declarations") +endif() + find_package(Protobuf QUIET CONFIG) if(${Protobuf_FOUND}) message(STATUS "Modern protobuf library located.") @@ -50,10 +54,6 @@ if(${SUBSTRAIT_CPP_BUILD_TESTING}) enable_testing() endif() -if(${CLANG_TIDY_BUILD}) - add_compile_options("-Wno-attributes;-Wno-deprecated-declarations") -endif() - install(EXPORT SubstraitTargets DESTINATION lib/cmake/Substrait) add_subdirectory(src/substrait) From 39c500f492636547792bd9530b041b185742062f Mon Sep 17 00:00:00 2001 From: David Sisson Date: Fri, 26 Jul 2024 17:17:50 -0700 Subject: [PATCH 21/21] try the original protolib version --- third_party/protobuf.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/protobuf.cmake b/third_party/protobuf.cmake index 9b23703a..e7942cf3 100644 --- a/third_party/protobuf.cmake +++ b/third_party/protobuf.cmake @@ -12,7 +12,7 @@ FetchContent_Declare(GTest ) FetchContent_Declare(Protobuf GIT_REPOSITORY https://github.com/protocolbuffers/protobuf.git - GIT_TAG v25.4 + GIT_TAG v23.4 OVERRIDE_FIND_PACKAGE ) set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "")