diff --git a/.clang-tidy b/.clang-tidy index b65f4a8e..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$' +HeaderFilterRegex: 'io/substrait/.*\\.h$' AnalyzeTemporaryDtors: false FormatStyle: none CheckOptions: 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 17185468..e8d6c11c 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) @@ -33,25 +33,16 @@ option( include_directories(include) include_directories(src) -# TODO: Simplify once we can require cmake 3.27 (where CONFIG is default). +if(${CLANG_TIDY_BUILD}) + add_compile_options("-Wno-attributes;-Wno-deprecated-declarations") +endif() -# 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/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index 293ef869..358044f0 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -3,15 +3,20 @@ 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 -# Build substrait protobuf -pushd tmp/src/substrait/proto && make -j && popd || exit -# Build textplan grammar +set -o errexit + +echo Making compile_command.json +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 +popd +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 python3 scripts/run-clang-tidy.py "$WORKDIR" "tmp" "third_party" "h,hpp,cc,cpp" "--quiet" fi +echo Finished running clang-tidy 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