From 1261af7105bbdb53173d7d059857b6ad0db143f5 Mon Sep 17 00:00:00 2001 From: Kuat Date: Wed, 17 May 2023 12:01:30 -0700 Subject: [PATCH] deps: update cel-cpp (#27414) * deps: update cel-cpp Signed-off-by: Kuat Yessenov Signed-off-by: Ryan Eskin --- bazel/cel-cpp.patch | 146 +++++++++++++++++++++++++++++---- bazel/repository_locations.bzl | 6 +- 2 files changed, 134 insertions(+), 18 deletions(-) diff --git a/bazel/cel-cpp.patch b/bazel/cel-cpp.patch index 677ea33fa5a8..ac7d82733c0f 100644 --- a/bazel/cel-cpp.patch +++ b/bazel/cel-cpp.patch @@ -1,15 +1,131 @@ -# -# Temporary patch to cel-cpp to accomodate switch from ABSL types to STL types. -# -# Patch will be removed once build issues in new cel-cpp are addressed. -# ---- a/eval/public/ast_traverse.cc 2023-01-23 17:38:48.730240356 +0000 -+++ b/eval/public/ast_traverse.cc 2023-01-23 17:39:27.182207871 +0000 -@@ -17,6 +17,7 @@ - #include - - #include "google/api/expr/v1alpha1/syntax.pb.h" -+#include "absl/base/attributes.h" - #include "absl/types/variant.h" - #include "eval/public/ast_visitor.h" - #include "eval/public/source_position.h" +diff --git a/eval/eval/evaluator_stack.h b/eval/eval/evaluator_stack.h +index 1ecab27..9df65d7 100644 +--- a/eval/eval/evaluator_stack.h ++++ b/eval/eval/evaluator_stack.h +@@ -5,6 +5,7 @@ + #include + #include + ++#include "absl/log/log.h" + #include "absl/types/span.h" + #include "eval/eval/attribute_trail.h" + #include "eval/public/cel_value.h" +diff --git a/eval/public/cel_expr_builder_factory.h b/eval/public/cel_expr_builder_factory.h +index 7321e29..0d0d5e6 100644 +--- a/eval/public/cel_expr_builder_factory.h ++++ b/eval/public/cel_expr_builder_factory.h +@@ -1,6 +1,7 @@ + #ifndef THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_CEL_EXPR_BUILDER_FACTORY_H_ + #define THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_CEL_EXPR_BUILDER_FACTORY_H_ + ++#include "absl/log/log.h" + #include "google/protobuf/descriptor.h" + #include "eval/public/cel_expression.h" + #include "eval/public/cel_options.h" +diff --git a/eval/public/cel_value.h b/eval/public/cel_value.h +index b2d13f8..73e1909 100644 +--- a/eval/public/cel_value.h ++++ b/eval/public/cel_value.h +@@ -25,7 +25,6 @@ + #include "absl/base/attributes.h" + #include "absl/base/macros.h" + #include "absl/base/optimization.h" +-#include "absl/log/log.h" + #include "absl/status/status.h" + #include "absl/status/statusor.h" + #include "absl/strings/str_cat.h" +@@ -481,8 +480,8 @@ class CelValue { + } + + // Crashes with a null pointer error. +- static void CrashNullPointer(Type type) ABSL_ATTRIBUTE_COLD { +- LOG(FATAL) << "Null pointer supplied for " << TypeName(type); // Crash ok ++ static void CrashNullPointer(Type) ABSL_ATTRIBUTE_COLD { ++ ABSL_ASSERT(false); + } + + // Null pointer checker for pointer-based types. +@@ -493,11 +492,9 @@ class CelValue { + } + + // Crashes with a type mismatch error. +- static void CrashTypeMismatch(Type requested_type, +- Type actual_type) ABSL_ATTRIBUTE_COLD { +- LOG(FATAL) << "Type mismatch" // Crash ok +- << ": expected " << TypeName(requested_type) // Crash ok +- << ", encountered " << TypeName(actual_type); // Crash ok ++ static void CrashTypeMismatch(Type, ++ Type) ABSL_ATTRIBUTE_COLD { ++ ABSL_ASSERT(false); + } + + // Gets value of type specified +diff --git a/eval/public/portable_cel_expr_builder_factory.cc b/eval/public/portable_cel_expr_builder_factory.cc +index 80ac45c..7dceb93 100644 +--- a/eval/public/portable_cel_expr_builder_factory.cc ++++ b/eval/public/portable_cel_expr_builder_factory.cc +@@ -20,6 +20,7 @@ + #include + #include + ++#include "absl/log/log.h" + #include "absl/status/status.h" + #include "eval/compiler/flat_expr_builder.h" + #include "eval/public/cel_options.h" +diff --git a/eval/public/structs/BUILD b/eval/public/structs/BUILD +index 9187518..5151bb0 100644 +--- a/eval/public/structs/BUILD ++++ b/eval/public/structs/BUILD +@@ -192,7 +192,6 @@ cc_library( + hdrs = ["legacy_type_provider.h"], + deps = [ + ":legacy_type_adapter", +- "//base:type_provider", + "@com_google_absl//absl/types:optional", + ], + ) +diff --git a/eval/public/structs/field_access_impl.cc b/eval/public/structs/field_access_impl.cc +index 788a476..e4b70b3 100644 +--- a/eval/public/structs/field_access_impl.cc ++++ b/eval/public/structs/field_access_impl.cc +@@ -25,6 +25,7 @@ + #include "google/protobuf/arena.h" + #include "google/protobuf/map_field.h" + #include "absl/container/flat_hash_set.h" ++#include "absl/log/log.h" + #include "absl/status/status.h" + #include "absl/status/statusor.h" + #include "absl/strings/str_cat.h" +diff --git a/eval/public/structs/legacy_type_provider.h b/eval/public/structs/legacy_type_provider.h +index b1623fc..d3d88d6 100644 +--- a/eval/public/structs/legacy_type_provider.h ++++ b/eval/public/structs/legacy_type_provider.h +@@ -16,7 +16,6 @@ + #define THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_STRUCTS_TYPE_PROVIDER_H_ + + #include "absl/types/optional.h" +-#include "base/type_provider.h" + #include "eval/public/structs/legacy_type_adapter.h" + + namespace google::api::expr::runtime { +@@ -25,8 +24,10 @@ namespace google::api::expr::runtime { + // + // Note: This API is not finalized. Consult the CEL team before introducing new + // implementations. +-class LegacyTypeProvider : public cel::TypeProvider { ++class LegacyTypeProvider { + public: ++ virtual ~LegacyTypeProvider() = default; ++ + // Return LegacyTypeAdapter for the fully qualified type name if available. + // + // nullopt values are interpreted as not present. +@@ -45,7 +46,7 @@ class LegacyTypeProvider : public cel::TypeProvider { + // created ones, the TypeInfoApis returned from this method should be the same + // as the ones used in value creation. + virtual absl::optional ProvideLegacyTypeInfo( +- absl::string_view name) const { ++ absl::string_view) const { + return absl::nullopt; + } + }; diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 76868a57b1a4..f8a3198ab427 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -1085,8 +1085,8 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "Common Expression Language (CEL) C++ library", project_desc = "Common Expression Language (CEL) C++ library", project_url = "https://opensource.google/projects/cel", - version = "11f9d662e71f73b28f4104ef2cf0550d96e677ae", - sha256 = "3d00e3fa9def360da18ccd077f261c1dea2f725c046692cc55ecc4d3b15bb390", + version = "da0aba702f44a41ec6d2eb4bbf6a9f01efc2746d", + sha256 = "d62b93fd07c6151749e83855157f3f2778d62c168318f9c40dfcfe1c336c496f", strip_prefix = "cel-cpp-{version}", urls = ["https://github.com/google/cel-cpp/archive/{version}.tar.gz"], use_category = ["dataplane_ext"], @@ -1103,7 +1103,7 @@ REPOSITORY_LOCATIONS_SPEC = dict( "envoy.rbac.matchers.upstream_ip_port", "envoy.formatter.cel", ], - release_date = "2022-09-01", + release_date = "2023-03-08", cpe = "N/A", ), com_github_google_flatbuffers = dict(