Skip to content

Commit

Permalink
deps: update cel, absl, googleapis
Browse files Browse the repository at this point in the history
Change-Id: Ie3a82096c5ccfd1212ec226d6c30e9434a6f2623
Signed-off-by: Kuat Yessenov <[email protected]>
  • Loading branch information
kyessenov committed Mar 18, 2024
1 parent ea0e531 commit 25119dd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 156 deletions.
171 changes: 17 additions & 154 deletions bazel/cel-cpp.patch
Original file line number Diff line number Diff line change
@@ -1,159 +1,22 @@
diff --git a/base/memory.h b/base/memory.h
index 3552e19..0fbe618 100644
--- a/base/memory.h
+++ b/base/memory.h
@@ -166,8 +166,8 @@ std::enable_if_t<IsDerivedHeapDataV<F>, Handle<T>> HandleFactory<T>::Make(
#if defined(__cpp_lib_is_pointer_interconvertible) && \
__cpp_lib_is_pointer_interconvertible >= 201907L
// Only available in C++20.
- static_assert(std::is_pointer_interconvertible_base_of_v<Data, F>,
- "F must be pointer interconvertible to Data");
+// static_assert(std::is_pointer_interconvertible_base_of_v<Data, F>,
+// "F must be pointer interconvertible to Data");
#endif
if (memory_manager.memory_management() == MemoryManagement::kPooling) {
void* addr;
diff --git a/eval/internal/interop.cc b/eval/internal/interop.cc
index 3acde6c..20f8ea3 100644
--- a/eval/internal/interop.cc
+++ b/eval/internal/interop.cc
@@ -729,13 +729,14 @@ absl::StatusOr<CelValue> ToLegacyValue(google::protobuf::Arena* arena,
return CelValue::CreateMessageWrapper(
MessageWrapperAccess::Make(message, type_info));
}
- if (ProtoStructValueToMessageWrapper) {
+ // This weak symbol is never defined in Envoy, and checking it causes linker failures on macOS
+ /*if (ProtoStructValueToMessageWrapper) {
auto maybe_message_wrapper = ProtoStructValueToMessageWrapper(*value);
if (maybe_message_wrapper.has_value()) {
return CelValue::CreateMessageWrapper(
std::move(maybe_message_wrapper).value());
}
- }
+ }*/
return absl::UnimplementedError(
"only legacy struct types and values can be used for interop");
}
diff --git a/eval/public/cel_value.cc b/eval/public/cel_value.cc
index 6aeff6d..c43864c 100644
--- a/eval/public/cel_value.cc
+++ b/eval/public/cel_value.cc
@@ -107,7 +107,7 @@ struct DebugStringVisitor {

} // namespace

-const absl::string_view kPayloadUrlMissingAttributePath =
+ABSL_CONST_INIT const absl::string_view kPayloadUrlMissingAttributePath =
cel::runtime_internal::kPayloadUrlMissingAttributePath;

CelValue CelValue::CreateDuration(absl::Duration value) {
diff --git a/eval/public/containers/container_backed_map_impl.h b/eval/public/containers/container_backed_map_impl.h
index 6092eef..7548bbf 100644
--- a/eval/public/containers/container_backed_map_impl.h
+++ b/eval/public/containers/container_backed_map_impl.h
@@ -30,6 +30,7 @@ class CelMapBuilder : public CelMap {
return values_map_.contains(cel_key);
}

+ using CelMap::ListKeys;
absl::StatusOr<const CelList*> ListKeys() const override {
return &key_list_;
}
diff --git a/eval/public/containers/internal_field_backed_map_impl.h b/eval/public/containers/internal_field_backed_map_impl.h
index ec773d9..caa2f3a 100644
--- a/eval/public/containers/internal_field_backed_map_impl.h
+++ b/eval/public/containers/internal_field_backed_map_impl.h
@@ -43,6 +43,7 @@ class FieldBackedMapImpl : public CelMap {
// Presence test function.
absl::StatusOr<bool> Has(const CelValue& key) const override;

+ using CelMap::ListKeys;
absl::StatusOr<const CelList*> ListKeys() const override;

protected:
diff --git a/eval/public/structs/cel_proto_lite_wrap_util.cc b/eval/public/structs/cel_proto_lite_wrap_util.cc
index 4cb21e5..35fdf7f 100644
--- a/eval/public/structs/cel_proto_lite_wrap_util.cc
+++ b/eval/public/structs/cel_proto_lite_wrap_util.cc
@@ -172,6 +172,7 @@ class DynamicMap : public CelMap {

int size() const override { return values_->fields_size(); }

+ using CelMap::ListKeys;
absl::StatusOr<const CelList*> ListKeys() const override {
return &key_list_;
}
diff --git a/eval/public/structs/cel_proto_wrap_util.cc b/eval/public/structs/cel_proto_wrap_util.cc
index fabb594..86a314c 100644
--- a/eval/public/structs/cel_proto_wrap_util.cc
+++ b/eval/public/structs/cel_proto_wrap_util.cc
@@ -137,6 +137,7 @@ class DynamicMap : public CelMap {

int size() const override { return values_->fields_size(); }

+ using CelMap::ListKeys;
absl::StatusOr<const CelList*> ListKeys() const override {
return &key_list_;
diff --git a/common/types/optional_type.h b/common/types/optional_type.h
index 9af82db..5134af0 100644
--- a/common/types/optional_type.h
+++ b/common/types/optional_type.h
@@ -66,7 +66,7 @@ class OptionalType final : public OpaqueType {

absl::Span<const Type> parameters() const {
auto parameters = OpaqueType::parameters();
- ABSL_DCHECK_EQ(parameters.size(), 1);
+ ABSL_DCHECK_EQ(parameters.size(), static_cast<size_t>(1));
return parameters;
}
diff --git a/internal/strings.cc b/internal/strings.cc
index dc5a118..24457ab 100644
--- a/internal/strings.cc
+++ b/internal/strings.cc
@@ -53,12 +53,12 @@ bool CheckForClosingString(absl::string_view source,
if (closing_str.empty()) return true;

const char* p = source.data();
- const char* end = source.end();
+ const char* end = p + source.size();

bool is_closed = false;
while (p + closing_str.length() <= end) {
if (*p != '\\') {
- size_t cur_pos = p - source.begin();
+ size_t cur_pos = p - source.data();
bool is_closing =
absl::StartsWith(absl::ClippedSubstr(source, cur_pos), closing_str);
if (is_closing && p + closing_str.length() < end) {
@@ -132,7 +132,7 @@ bool UnescapeInternal(absl::string_view source, absl::string_view closing_str,
dest->reserve(source.size());
@@ -147,7 +147,7 @@ class OptionalTypeView final : public OpaqueTypeView {

const char* p = source.data();
- const char* end = source.end();
+ const char* end = p + source.size();
const char* last_byte = end - 1;

while (p < end) {
@@ -446,7 +446,9 @@ std::string EscapeInternal(absl::string_view src, bool escape_all_bytes,
// byte.
dest.reserve(src.size() * 4);
bool last_hex_escape = false; // true if last output char was \xNN.
- for (const char* p = src.begin(); p < src.end(); ++p) {
+ const char* p = src.data();
+ const char* end = p + src.size();
+ for (; p < end; ++p) {
unsigned char c = static_cast<unsigned char>(*p);
bool is_hex_escape = false;
switch (c) {
@@ -552,7 +554,9 @@ std::string EscapeString(absl::string_view str) {
std::string EscapeBytes(absl::string_view str, bool escape_all_bytes,
char escape_quote_char) {
std::string escaped_bytes;
- for (const char* p = str.begin(); p < str.end(); ++p) {
+ const char* p = str.data();
+ const char* end = p + str.size();
+ for (; p < end; ++p) {
unsigned char c = *p;
if (escape_all_bytes || !absl::ascii_isprint(c)) {
escaped_bytes += "\\x";
diff --git a/tools/flatbuffers_backed_impl.cc b/tools/flatbuffers_backed_impl.cc
index 10c0b1c..45ba72f 100644
--- a/tools/flatbuffers_backed_impl.cc
+++ b/tools/flatbuffers_backed_impl.cc
@@ -130,6 +130,7 @@ class ObjectStringIndexedMapImpl : public CelMap {
return absl::nullopt;
absl::Span<const Type> parameters() const {
auto parameters = OpaqueTypeView::parameters();
- ABSL_DCHECK_EQ(parameters.size(), 1);
+ ABSL_DCHECK_EQ(parameters.size(), static_cast<size_t>(1));
return parameters;
}

+ using CelMap::ListKeys;
absl::StatusOr<const CelList*> ListKeys() const override { return &keys_; }

private:
4 changes: 2 additions & 2 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1221,8 +1221,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 = "9f9e5941161b8f996fdd2b848f406b6188dcba5f",
sha256 = "d163805320a782c5194b7496cdd5e8c9d9604eeffc1e531770cf6b130bc182fe",
version = "68c8ca3b7ed87d953d8cdaffb20b1468a48b1d83",
sha256 = "9189656524aecbce0d635ba27a0917730c9a6bb114e9785298b46cf6fca5ba45",
strip_prefix = "cel-cpp-{version}",
urls = ["https://github.com/google/cel-cpp/archive/{version}.tar.gz"],
use_category = ["dataplane_ext"],
Expand Down

0 comments on commit 25119dd

Please sign in to comment.