Skip to content

Commit

Permalink
deps: update cel-cpp (envoyproxy#27414)
Browse files Browse the repository at this point in the history
* deps: update cel-cpp

Signed-off-by: Kuat Yessenov <[email protected]>

Signed-off-by: Kuat <[email protected]>
  • Loading branch information
kyessenov authored and phlax committed Oct 9, 2023
1 parent 3d4696f commit 5bdf0bc
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 3 deletions.
131 changes: 131 additions & 0 deletions bazel/cel-cpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
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 <utility>
#include <vector>

+#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 <string>
#include <utility>

+#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<const LegacyTypeInfoApis*> ProvideLegacyTypeInfo(
- absl::string_view name) const {
+ absl::string_view) const {
return absl::nullopt;
}
};
6 changes: 3 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1138,8 +1138,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"],
Expand All @@ -1155,7 +1155,7 @@ REPOSITORY_LOCATIONS_SPEC = dict(
"envoy.stat_sinks.wasm",
"envoy.rbac.matchers.upstream_ip_port",
],
release_date = "2022-09-01",
release_date = "2023-03-08",
cpe = "N/A",
),
com_github_google_flatbuffers = dict(
Expand Down

0 comments on commit 5bdf0bc

Please sign in to comment.