13 Commits

Author SHA1 Message Date
Esun Kim 232dceb3a3 [Dep] Small changes to how to pull in Protobuf (#38884)
Two changes are made to accept upcoming Protobuf v30
- Protobuf v30 will introduce a change that removes Bazel+MSVC support unless the `protobuf_allow_msvc option` is explicitly enabled. Therefore, to maintain compatibility, CI needs to define this option.
- CMake file for `protobuf/upb` now depends on the `protobuf_VERSION` variable, which is set in the main protobuf CMake file. A specific `cmake_externalproject` test includes `protobuf/upb` directly and therefore misses the opportunity to define this variable. To address this, the test now defines `protobuf_VERSION` directly.

Closes #38884

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38884 from veblush:protobuf-v30-misc fd0154452db4e21a3df0c47763529272e181bec1
PiperOrigin-RevId: 732251635
2025-02-28 14:00:55 -08:00
Esun Kim dc65036957 [C++] Transition to C++17 (CMake) (#38335)
CMake needs following two changes which were missed part from https://github.com/grpc/grpc/pull/37919 to make CMake use C++17.
- **Explicitly require C++17 for gRPC targets using `cxx_std_17`**: This ensures that gRPC build targets are built with the correct C++17 support.
- **Enforce C++17 for all CMake invocations using `CMAKE_CXX_STANDARD=17`**: This is necessary due to Abseil's API changes depending on the C++ standard used. (e.g. Abseil's `absl::string_view` is implemented differently depending on the C++ standard. Before C++17, it's a distinct type. From C++17 onwards, it's simply an alias for `std::string_view`.) To maintain consistency and avoid build errors, all CMake builds (except particular build tests targetting C++20 or C++23) are now configured to use C++17.

The requirement of C++17 for building gRPC should be documented in the release notes and build instructions.

Closes #38335

PiperOrigin-RevId: 712926964
2025-01-07 08:48:11 -08:00
Esun Kim a49d450a54 [Build] Bumped the minimum version of cmake (#37702)
Per https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md, the minimum version of cmake to support is 3.16 so let's change our cmake builds' requirements accordingly.

Closes #37702

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37702 from veblush:cmake316 bb4ed1a1be5e9374980c922aac3dc1ccd27d1266
PiperOrigin-RevId: 680639191
2024-09-30 10:55:14 -07:00
Esun Kim e4a422ba43 [Deps] Upgrade protobuf to 28.1 (#37682)
Regular protobuf upgrade from 27.2 to 28.1 along with the required change to accommodate https://github.com/protocolbuffers/protobuf/pull/17285

Closes #37682

PiperOrigin-RevId: 678428936
2024-09-24 16:03:14 -07:00
Esun Kim 303e568f27 [Build] Removed gRPC_PROTOBUF_PACKAGE_TYPE, supporting config only (#32988)
`FindProtobuf` isn't working as Protobuf began to use Abseil so gRPC is
now using `CONFIG` mode for protobuf module
(Context: https://gitlab.kitware.com/cmake/cmake/-/issues/24321)
2023-05-04 13:55:42 -07:00
Jan Tattermusch 0f1afec5a8 [protobuf] Upgrade third_party/protobuf to 22.x (#32606)
The very non-trivial upgrade of third_party/protobuf to 22.x
This PR strives to be as small as possible and many changes that were
compatible with protobuf 21.x and didn't have to be merged atomically
with the upgrade were already merged.
Due to the complexity of the upgrade, this PR wasn't created
automatically by a tool, but manually. Subsequent upgraded of
third_party/protobuf with our OSS release script should work again once
this change is merged.

This is best reviewed commit-by-commit, I tried to group changes in
logical areas.

Notable changes:
- the upgrade of third_party/protobuf submodule, the bazel protobuf
dependency itself
- upgrade of UPB dependency to 22.x (in the past, we used to always
upgrade upb to "main", but upb now has release branch as well). UPB
needs to be upgraded atomically with protobuf since there's a de-facto
circular dependency (new protobuf depends on new upb, which depends on
new protobuf for codegen).
- some protobuf and upb bazel rules are now aliases, so `
extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py`
had to be modified to be able to follow aliases and reach the actual
aliased targets.
- some protobuf public headers were renamed, so especially
`src/compiler` needed to be updated to use the new headers.
- protobuf and upb now both depend on utf8_range project, so since we
bundle upb with grpc in some languages, we now have to bundle utf8_range
as well (hence changes in build for python, PHP, objC, cmake etc).
- protoc now depends on absl and utf8_range (previously protobuf had
absl dependency, but not for the codegen part), so python's
make_grpcio_tools.py required partial rewrite to be able to handle those
dependencies in the grpcio_tools build.
- many updates and fixes required for C++ distribtests (currently they
all pass, but we'll probably need to follow up, make protobuf's and
grpc's handling of dependencies more aligned and revisit the
distribtests)
- bunch of other changes mostly due to overhaul of protobuf's and upb's
internal build layout.

TODOs:
- [DONE] make sure IWYU and clang_tidy_code pass
- create a list of followups (e.g. work to reenable the few tests I had
to disable and to remove workaround I had to use)
- [DONE in cl/523706129] figure out problem(s) with internal import

---------

Co-authored-by: Craig Tiller <ctiller@google.com>
2023-04-12 18:43:58 +02:00
Jan Tattermusch 3fde13929b Switch to protobuf's /CMakeLists.txt instead of /cmake/CMakeLists.txt (#32678)
Try to react to https://github.com/protocolbuffers/protobuf/issues/12263
and https://github.com/protocolbuffers/protobuf/pull/12295

Protobuf's /cmake/CMakeLists.txt is now deprecated if favor of
/CMakeLists.txt


https://github.com/protocolbuffers/protobuf/blob/58ecf38aa521ba812a0c1a0ae9f108dd311c739c/cmake/CMakeLists.txt#L3

In this PR:
- Adjust `cmake/protobuf.cmake` to use the right CMakeLists.txt
- adjust the C++ distribtests accordingly
2023-03-22 09:14:04 -07:00
Esun Kim b64d623f24 CMake's better handling c++14 requirement (#31916)
* Bumped the cmake version version to 3.8

* Switch to target_compile_features for cxx_std_14

* Regen
2023-01-27 09:51:31 -08:00
Esun Kim 192928c997 Use gRPC_BUILD_MSVC_MP_COUNT for windows cmake distrib tests (#28202) 2021-11-29 11:22:07 -08:00
Donna Dionne 8dd0cb4712 Add support for xDS regex matchers. 2020-07-07 13:17:25 -07:00
Esun Kim 5207eba9ff Add abseil 2020-01-03 19:29:55 -08:00
Christopher Warrington 4be4df3624 Bump min CMake to 3.5.1 to match Google benchmark
The Google Benchmark CMake build needs CMake 3.5.1 or newer. CMake 3.5.1
was released May 24, 2016 and is available in Debian stable and Ubuntu
16.04 and 18.04.
2019-07-02 23:02:47 +00:00
Jan Tattermusch 2286c633c2 cmake "superbuild" example using externalprojects 2018-03-28 19:30:44 +02:00