MErge Master

pull/37786/head
tanvi-jagtap 2 months ago
commit 31af14a4e7
  1. 6
      BUILDING.md
  2. 2
      CMakeLists.txt
  3. 2
      examples/android/helloworld/app/CMakeLists.txt
  4. 2
      examples/cpp/auth/CMakeLists.txt
  5. 2
      examples/cpp/cancellation/CMakeLists.txt
  6. 2
      examples/cpp/cmake/common.cmake
  7. 2
      examples/cpp/compression/CMakeLists.txt
  8. 2
      examples/cpp/deadline/CMakeLists.txt
  9. 2
      examples/cpp/error_details/CMakeLists.txt
  10. 2
      examples/cpp/error_handling/CMakeLists.txt
  11. 2
      examples/cpp/flow_control/CMakeLists.txt
  12. 2
      examples/cpp/generic_api/CMakeLists.txt
  13. 2
      examples/cpp/health/CMakeLists.txt
  14. 2
      examples/cpp/helloworld/CMakeLists.txt
  15. 2
      examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt
  16. 2
      examples/cpp/interceptors/CMakeLists.txt
  17. 2
      examples/cpp/keepalive/CMakeLists.txt
  18. 2
      examples/cpp/load_balancing/CMakeLists.txt
  19. 2
      examples/cpp/metadata/CMakeLists.txt
  20. 2
      examples/cpp/multiplex/CMakeLists.txt
  21. 2
      examples/cpp/otel/CMakeLists.txt
  22. 2
      examples/cpp/otel/codelab/CMakeLists.txt
  23. 2
      examples/cpp/otel/ostream/CMakeLists.txt
  24. 2
      examples/cpp/retry/CMakeLists.txt
  25. 2
      examples/cpp/route_guide/CMakeLists.txt
  26. 2
      examples/cpp/wait_for_ready/CMakeLists.txt
  27. 2
      src/android/test/interop/app/CMakeLists.txt
  28. 20
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  29. 3
      src/core/lib/security/credentials/call_creds_util.cc
  30. 6
      src/core/server/server.cc
  31. 4
      src/cpp/README.md
  32. 2
      templates/CMakeLists.txt.template
  33. 2
      test/distrib/cpp/run_distrib_test_cmake.bat
  34. 2
      test/distrib/cpp/run_distrib_test_cmake_as_externalproject.bat
  35. 2
      test/distrib/cpp/run_distrib_test_cmake_for_dll.bat
  36. 12
      tools/run_tests/run_tests.py
  37. 2
      tools/run_tests/run_tests_matrix.py

@ -55,7 +55,7 @@ installed by `brew` is being used:
## Windows
To prepare for cmake + Microsoft Visual C++ compiler build
- Install Visual Studio 2019 or later (Visual C++ compiler will be used).
- Install Visual Studio 2022 or later (Visual C++ compiler will be used).
- Install [Git](https://git-scm.com/).
- Install [CMake](https://cmake.org/download/).
- Install [nasm](https://www.nasm.us/) and add it to `PATH` (`choco install nasm`) - *required by boringssl*
@ -132,7 +132,7 @@ $ make
If you want to build shared libraries (`.so` files), run `cmake` with `-DBUILD_SHARED_LIBS=ON`.
### Windows, Using Visual Studio 2019 or later
### Windows, Using Visual Studio 2022 or later
When using the "Visual Studio" generator,
cmake will generate a solution (`grpc.sln`) that contains a VS project for
@ -143,7 +143,7 @@ you will be able to browse and build the code.
> @rem Run from grpc directory after cloning the repo with --recursive or updating submodules.
> md .build
> cd .build
> cmake .. -G "Visual Studio 16 2019"
> cmake .. -G "Visual Studio 17 2022"
> cmake --build . --config Release
```

2
CMakeLists.txt generated

@ -22,7 +22,7 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
set(PACKAGE_NAME "grpc")
set(PACKAGE_VERSION "1.68.0-dev")

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
set(helloworld_PROTOBUF_PROTOC_EXECUTABLE "/usr/local/bin/protoc" CACHE STRING "Protoc binary on host")
set(helloworld_GRPC_CPP_PLUGIN_EXECUTABLE "/usr/local/bin/grpc_cpp_plugin" CACHE STRING "gRPC CPP plugin binary on host")

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building keyvaluestore.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(Cancellation C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building keyvaluestore.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(Cancellation C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building route_guide.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
if(MSVC)
add_definitions(-D_WIN32_WINNT=0x600)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(Compression C CXX)

@ -16,7 +16,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building this example.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(Deadline C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(ErrorDetails C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(ErrorHandling C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building example.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(HelloWorld C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(GenericAPI C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(HelloWorld C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(HelloWorld C CXX)

@ -20,7 +20,7 @@
# including the "helloworld" project itself.
# See https://blog.kitware.com/cmake-superbuilds-git-submodules/
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
# Project
project(HelloWorld-SuperBuild C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building keyvaluestore.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(KeyValueStore C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(HelloWorld C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(LoadBalancing C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(Metadata C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(Multiplex C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
project(grpc_opentelemetry_example C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
project(grpc_opentelemetry_example C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
project(grpc_opentelemetry_example C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building retry.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(Retry C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building route_guide.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(RouteGuide C CXX)

@ -17,7 +17,7 @@
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(HelloWorld C CXX)

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
set(PROTOBUF_PROTOC_EXECUTABLE "/usr/local/bin/protoc" CACHE STRING "Protoc binary on host")
set(gRPC_CPP_PLUGIN_EXECUTABLE "/usr/local/bin/grpc_cpp_plugin" CACHE STRING "gRPC CPP plugin binary on host")

@ -414,7 +414,7 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
static void read_channel_args(grpc_chttp2_transport* t,
const grpc_core::ChannelArgs& channel_args,
bool is_client) {
const bool is_client) {
const int initial_sequence_number =
channel_args.GetInt(GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER).value_or(-1);
if (initial_sequence_number > 0) {
@ -584,7 +584,7 @@ using grpc_event_engine::experimental::TcpTraceExtension;
grpc_chttp2_transport::grpc_chttp2_transport(
const grpc_core::ChannelArgs& channel_args,
grpc_core::OrphanablePtr<grpc_endpoint> endpoint, bool is_client)
grpc_core::OrphanablePtr<grpc_endpoint> endpoint, const bool is_client)
: ep(std::move(endpoint)),
peer_string(
grpc_core::Slice::FromCopiedString(grpc_endpoint_get_peer(ep.get()))),
@ -908,7 +908,7 @@ grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t,
// OUTPUT PROCESSING
//
static const char* write_state_name(grpc_chttp2_write_state st) {
static const char* get_write_state_name(grpc_chttp2_write_state st) {
switch (st) {
case GRPC_CHTTP2_WRITE_STATE_IDLE:
return "IDLE";
@ -925,8 +925,8 @@ static void set_write_state(grpc_chttp2_transport* t,
GRPC_TRACE_LOG(http, INFO)
<< "W:" << t << " " << (t->is_client ? "CLIENT" : "SERVER") << " ["
<< t->peer_string.as_string_view() << "] state "
<< write_state_name(t->write_state) << " -> " << write_state_name(st)
<< " [" << reason << "]";
<< get_write_state_name(t->write_state) << " -> "
<< get_write_state_name(st) << " [" << reason << "]";
t->write_state = st;
// If the state is being reset back to idle, it means a write was just
// finished. Make sure all the run_after_write closures are scheduled.
@ -1288,7 +1288,7 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
<< " flags="
<< (closure->next_data.scratch % CLOSURE_BARRIER_FIRST_REF_BIT)
<< " desc=" << desc << " err=" << grpc_core::StatusToString(error)
<< " write_state=" << write_state_name(t->write_state)
<< " write_state=" << get_write_state_name(t->write_state)
<< " whence=" << whence.file() << ":" << whence.line();
if (!error.ok()) {
@ -1297,7 +1297,7 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
if (cl_err.ok()) {
cl_err = GRPC_ERROR_CREATE(absl::StrCat(
"Error in HTTP transport completing operation: ", desc,
" write_state=", write_state_name(t->write_state),
" write_state=", get_write_state_name(t->write_state),
" refs=", closure->next_data.scratch / CLOSURE_BARRIER_FIRST_REF_BIT,
" flags=", closure->next_data.scratch % CLOSURE_BARRIER_FIRST_REF_BIT,
" peer_address=", t->peer_string.as_string_view()));
@ -1326,7 +1326,7 @@ static bool contains_non_ok_status(grpc_metadata_batch* batch) {
}
static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id,
bool is_client, bool is_initial) {
const bool is_client, const bool is_initial) {
VLOG(2) << "--metadata--";
const std::string prefix = absl::StrCat(
"HTTP:", id, is_initial ? ":HDR" : ":TRL", is_client ? ":CLI:" : ":SVR:");
@ -1909,7 +1909,7 @@ class GracefulGoaway : public grpc_core::RefCounted<GracefulGoaway> {
} // namespace
static void send_goaway(grpc_chttp2_transport* t, grpc_error_handle error,
bool immediate_disconnect_hint) {
const bool immediate_disconnect_hint) {
grpc_http2_error_code http_error;
std::string message;
grpc_error_get_status(error, grpc_core::Timestamp::InfFuture(), nullptr,
@ -3235,7 +3235,7 @@ grpc_chttp2_transport_get_socket_node(grpc_core::Transport* transport) {
grpc_core::Transport* grpc_create_chttp2_transport(
const grpc_core::ChannelArgs& channel_args,
grpc_core::OrphanablePtr<grpc_endpoint> ep, bool is_client) {
grpc_core::OrphanablePtr<grpc_endpoint> ep, const bool is_client) {
return new grpc_chttp2_transport(channel_args, std::move(ep), is_client);
}

@ -18,6 +18,7 @@
#include <string.h>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@ -42,6 +43,7 @@ struct ServiceUrlAndMethod {
ServiceUrlAndMethod MakeServiceUrlAndMethod(
const ClientMetadataHandle& initial_metadata,
const grpc_call_credentials::GetRequestMetadataArgs* args) {
DCHECK(initial_metadata->get_pointer(HttpPathMetadata()) != nullptr);
auto service =
initial_metadata->get_pointer(HttpPathMetadata())->as_string_view();
auto last_slash = service.find_last_of('/');
@ -56,6 +58,7 @@ ServiceUrlAndMethod MakeServiceUrlAndMethod(
method_name = service.substr(last_slash + 1);
service = service.substr(0, last_slash);
}
DCHECK(initial_metadata->get_pointer(HttpAuthorityMetadata()) != nullptr);
auto host_and_port =
initial_metadata->get_pointer(HttpAuthorityMetadata())->as_string_view();
absl::string_view url_scheme = args->security_connector->url_scheme();

@ -869,8 +869,10 @@ auto Server::MatchAndPublishCall(CallHandler call_handler) {
absl::StatusOr<RefCountedPtr<UnstartedCallDestination>>
Server::MakeCallDestination(const ChannelArgs& args) {
InterceptionChainBuilder builder(args);
builder.AddOnClientInitialMetadata(
[this](ClientMetadata& md) { SetRegisteredMethodOnMetadata(md); });
// TODO(ctiller): find a way to avoid adding a server ref per call
builder.AddOnClientInitialMetadata([self = Ref()](ClientMetadata& md) {
self->SetRegisteredMethodOnMetadata(md);
});
CoreConfiguration::Get().channel_init().AddToInterceptionChainBuilder(
GRPC_SERVER_CHANNEL, builder);
return builder.Build(

@ -31,7 +31,7 @@ Therefore, gRPC supports several major build systems, which should satisfy most
| Operating System | Architectures | Versions | Support Level |
|------------------|---------------|----------|---------------|
| Linux - Debian, Ubuntu, CentOS | x86, x64 | clang 7+, GCC 7.3+ | Officially Supported |
| Windows 10+ | x86, x64 | Visual Studio 2019+ | Officially Supported |
| Windows 10+ | x86, x64 | Visual Studio 2022+ | Officially Supported |
| MacOS | x64, ARM64 | XCode 12+ | Officially Supported |
| Linux - Others | x86, x64 | clang 7+, GCC 7.3+ | Best Effort |
| Linux | ARM64 | | Best Effort |
@ -107,7 +107,7 @@ also sets up an `add_subdirectory()` rule for you. This causes gRPC to be
built as part of your project.
```cmake
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.16)
project(my_project)
include(FetchContent)

@ -275,7 +275,7 @@
protobuf_gen_files.add(src)
%>
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
set(PACKAGE_NAME "grpc")
set(PACKAGE_VERSION "${settings.cpp_version}")

@ -31,7 +31,7 @@ set OPENSSL_DIR=%cd:\=/%/OpenSSL-Win32
@rem TODO(jtattermusch): add support for GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS env variable
set VS_GENERATOR="Visual Studio 16 2019"
set VS_GENERATOR="Visual Studio 17 2022"
@rem TODO(jtattermusch): switch to x64 build (will require pulling a x64 build of openssl)
set VS_ARCHITECTURE="Win32"

@ -28,7 +28,7 @@ set OPENSSL_DIR=%cd:\=/%/OpenSSL-Win32
@rem TODO(jtattermusch): add support for GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS env variable
set VS_GENERATOR="Visual Studio 16 2019"
set VS_GENERATOR="Visual Studio 17 2022"
@rem TODO(jtattermusch): switch to x64 build (will require pulling a x64 build of openssl)
set VS_ARCHITECTURE="Win32"

@ -31,7 +31,7 @@ set OPENSSL_DIR=%cd:\=/%/OpenSSL-Win32
@rem TODO(jtattermusch): add support for GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS env variable
set VS_GENERATOR="Visual Studio 16 2019"
set VS_GENERATOR="Visual Studio 17 2022"
@rem TODO(jtattermusch): switch to x64 build (will require pulling a x64 build of openssl)
set VS_ARCHITECTURE="Win32"

@ -283,9 +283,7 @@ class CLanguage(object):
[
"default",
"cmake",
"cmake_ninja_vs2019",
"cmake_ninja_vs2022",
"cmake_vs2019",
"cmake_vs2022",
],
)
@ -293,19 +291,13 @@ class CLanguage(object):
activate_vs_tools = ""
if (
self.args.compiler == "cmake_ninja_vs2019"
self.args.compiler == "cmake_ninja_vs2022"
or self.args.compiler == "cmake"
or self.args.compiler == "default"
):
# cmake + ninja build is the default because it is faster and supports boringssl assembly optimizations
# the compiler used is exactly the same as for cmake_vs2017
cmake_generator = "Ninja"
activate_vs_tools = "2019"
elif self.args.compiler == "cmake_ninja_vs2022":
cmake_generator = "Ninja"
activate_vs_tools = "2022"
elif self.args.compiler == "cmake_vs2019":
cmake_generator = "Visual Studio 16 2019"
elif self.args.compiler == "cmake_vs2022":
cmake_generator = "Visual Studio 17 2022"
else:
@ -1698,9 +1690,7 @@ argp.add_argument(
"all_the_cpythons",
"coreclr",
"cmake",
"cmake_ninja_vs2019",
"cmake_ninja_vs2022",
"cmake_vs2019",
"cmake_vs2022",
"mono",
],

@ -383,7 +383,7 @@ def _create_portability_test_jobs(
configs=["dbg"],
platforms=["windows"],
arch="default",
compiler="cmake_ninja_vs2019",
compiler="cmake_ninja_vs2022",
labels=["portability", "corelang"],
extra_args=extra_args,
inner_jobs=inner_jobs,

Loading…
Cancel
Save