Added a temporary trap to prevent Abseil-Status breakages. (#28766)

* Added a new trap to prevent build errors with use_abseil_status enabled

* Fix build errors.
pull/28785/head
Esun Kim 3 years ago committed by GitHub
parent 3857b07577
commit 342cb4457c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      BUILD
  2. 4
      bazel/grpc_build_system.bzl
  3. 2
      include/grpc/impl/codegen/port_platform.h
  4. 4
      src/core/ext/filters/client_channel/lb_policy/rls/rls.cc
  5. 2
      src/core/ext/filters/rbac/rbac_filter.cc
  6. 4
      src/core/lib/transport/transport_op_string.cc
  7. 4
      test/core/transport/binder/end2end/fuzzers/server_fuzzer.cc
  8. 2
      test/core/util/passthru_endpoint.cc
  9. 7
      tools/internal_ci/linux/grpc_bazel_build_in_docker.sh

@ -143,6 +143,11 @@ config_setting(
values = {"define": "use_strict_warning=true"},
)
config_setting(
name = "use_abseil_status",
values = {"define": "use_abseil_status=true"},
)
python_config_settings()
# This should be updated along with build_handwritten.yaml

@ -177,6 +177,10 @@ def grpc_cc_library(
"//:grpc_allow_exceptions": ["GRPC_ALLOW_EXCEPTIONS=1"],
"//:grpc_disallow_exceptions": ["GRPC_ALLOW_EXCEPTIONS=0"],
"//conditions:default": [],
}) +
select({
"//:use_abseil_status": ["GRPC_ERROR_IS_ABSEIL_STATUS=1"],
"//conditions:default": [],
}),
hdrs = hdrs + public_hdrs,
deps = deps + _get_external_deps(external_deps),

@ -51,7 +51,9 @@
/*
* Defines GRPC_ERROR_IS_ABSEIL_STATUS to use absl::Status for grpc_error_handle
*/
#ifndef GRPC_ERROR_IS_ABSEIL_STATUS
// #define GRPC_ERROR_IS_ABSEIL_STATUS 1
#endif
/* Get windows.h included everywhere (we need it) */
#if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)

@ -1377,7 +1377,7 @@ void RlsLb::Cache::Shutdown() {
void RlsLb::Cache::OnCleanupTimer(void* arg, grpc_error_handle error) {
Cache* cache = static_cast<Cache*>(arg);
GRPC_ERROR_REF(error);
(void)GRPC_ERROR_REF(error);
cache->lb_policy_->work_serializer()->Run(
[cache, error]() {
RefCountedPtr<RlsLb> lb_policy(cache->lb_policy_);
@ -1713,7 +1713,7 @@ void RlsLb::RlsRequest::StartCallLocked() {
void RlsLb::RlsRequest::OnRlsCallComplete(void* arg, grpc_error_handle error) {
auto* request = static_cast<RlsRequest*>(arg);
GRPC_ERROR_REF(error);
(void)GRPC_ERROR_REF(error);
request->lb_policy_->work_serializer()->Run(
[request, error]() {
request->OnRlsCallCompleteLocked(error);

@ -96,7 +96,7 @@ void RbacFilter::CallData::RecvInitialMetadataReady(void* user_data,
GRPC_STATUS_PERMISSION_DENIED);
}
} else {
GRPC_ERROR_REF(error);
(void)GRPC_ERROR_REF(error);
}
grpc_closure* closure = calld->original_recv_initial_metadata_ready_;
calld->original_recv_initial_metadata_ready_ = nullptr;

@ -87,9 +87,7 @@ std::string grpc_transport_stream_op_batch_string(
if (op->cancel_stream) {
out.push_back(absl::StrCat(
" CANCEL:",
absl::StrFormat(
"%p", static_cast<void*>(op->payload->cancel_stream.cancel_error)),
":", grpc_error_std_string(op->payload->cancel_stream.cancel_error)));
grpc_error_std_string(op->payload->cancel_stream.cancel_error)));
}
return absl::StrJoin(out, "");

@ -54,8 +54,8 @@ DEFINE_PROTO_FUZZER(const binder_transport_fuzzer::Input& input) {
grpc_core::CoreConfiguration::Get()
.channel_args_preconditioning()
.PreconditionChannelArgs(nullptr);
grpc_core::Server::FromC(server)->SetupTransport(server_transport, nullptr,
channel_args, nullptr);
(void)grpc_core::Server::FromC(server)->SetupTransport(
server_transport, nullptr, channel_args, nullptr);
grpc_channel_args_destroy(channel_args);
grpc_call* call1 = nullptr;
grpc_call_details call_details1;

@ -476,7 +476,7 @@ static void do_next_sched_channel_action(void* arg, grpc_error_handle error) {
static void sched_next_channel_action_locked(half* m) {
if (m->parent->channel_effects->actions.empty()) {
auto* err =
grpc_error_handle err =
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel actions complete");
shutdown_locked(m, err);
GRPC_ERROR_UNREF(err);

@ -38,6 +38,13 @@ bazel build --define=use_strict_warning=true \
//examples/... \
-//examples/android/binder/...
# TODO(veblush): Remove this test after migration to abseil-status is done.
bazel build --define=use_strict_warning=true --define=use_abseil_status=true \
-- \
//src/core/... \
//src/compiler/... \
//test/...
# TODO(jtattersmusch): Adding a build here for --define=grpc_no_xds is not ideal
# and we should find a better place for this. Refer
# https://github.com/grpc/grpc/pull/24536#pullrequestreview-517466531 for more

Loading…
Cancel
Save