Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove support for older protobuf versions #105

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ header:
- '.clang-tidy'
- '.cmake-format'
- '.licenserc.yaml'
- 'third_party/abseil-cpp'
- 'third_party/antlr4'
- 'third_party/datetime'
- 'third_party/fmt'
Expand Down
21 changes: 6 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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)
Expand Down
17 changes: 11 additions & 6 deletions scripts/run-clang-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion third_party/abseil-cpp
Submodule abseil-cpp deleted from c2435f
Loading