Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update cel, absl, googleapis #32962

Closed
wants to merge 14 commits into from
6 changes: 3 additions & 3 deletions api/bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "Google APIs",
project_desc = "Public interface definitions of Google APIs",
project_url = "https://github.com/googleapis/googleapis",
version = "114a745b2841a044e98cdbb19358ed29fcf4a5f1",
sha256 = "9b4e0d0a04a217c06b426aefd03b82581a9510ca766d2d1c70e52bb2ad4a0703",
release_date = "2023-01-10",
version = "8df1cd698e2fe0b7d1c298dabafdf13aa01c4d39",
sha256 = "9f529984f4602e7067037ff69f262245c774883f191a90a8c1cc5bbc759ce6a6",
release_date = "2024-02-23",
strip_prefix = "googleapis-{version}",
urls = ["https://github.com/googleapis/googleapis/archive/{version}.tar.gz"],
use_category = ["api"],
Expand Down
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:
12 changes: 6 additions & 6 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "Abseil",
project_desc = "Open source collection of C++ libraries drawn from the most fundamental pieces of Google’s internal codebase",
project_url = "https://abseil.io/",
version = "20230802.1",
sha256 = "987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed",
version = "20240116.1",
sha256 = "3c743204df78366ad2eaf236d6631d83f6bc928d1705dd0000b872e53b73dc6a",
strip_prefix = "abseil-cpp-{version}",
urls = ["https://github.com/abseil/abseil-cpp/archive/{version}.tar.gz"],
use_category = ["dataplane_core", "controlplane"],
release_date = "2023-09-18",
release_date = "2024-02-12",
cpe = "N/A",
license = "Apache-2.0",
license_url = "https://github.com/abseil/abseil-cpp/blob/{version}/LICENSE",
Expand Down 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 = "0abd738f9f54388452e6ebb0955eb039f9162b3d",
sha256 = "d163805320a782c5194b7496cdd5e8c9d9604eeffc1e531770cf6b130bc182fd",
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 All @@ -1243,7 +1243,7 @@ REPOSITORY_LOCATIONS_SPEC = dict(
"envoy.matching.inputs.cel_data_input",
"envoy.matching.matchers.cel_matcher",
],
release_date = "2023-12-20",
release_date = "2024-03-18",
cpe = "N/A",
),
com_github_google_flatbuffers = dict(
Expand Down
4 changes: 2 additions & 2 deletions mobile/third_party/rbe_configs/cc/cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ def _impl(ctx):
user_compile_flags_feature,
sysroot_feature,
unfiltered_compile_flags_feature,
] + layering_check_features(ctx.attr.compiler)
]
else:
features = [
supports_pic_feature,
Expand All @@ -1251,7 +1251,7 @@ def _impl(ctx):
user_compile_flags_feature,
sysroot_feature,
unfiltered_compile_flags_feature,
] + layering_check_features(ctx.attr.compiler)
]

return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
Expand Down
13 changes: 12 additions & 1 deletion test/extensions/path/uri_template_lib/uri_template_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@

#include "gtest/gtest.h"

// NOLINT(namespace-envoy)
// Overload functions in std library.
namespace std {

std::ostream& operator<<(std::ostream& os,
const Envoy::Extensions::UriTemplate::RewriteSegment& seg) {
absl::visit([&os](auto&& arg) { os << arg; }, seg);
return os;
}

} // namespace std

namespace Envoy {
namespace Extensions {
namespace UriTemplate {

namespace {

using ::Envoy::StatusHelpers::IsOkAndHolds;
Expand Down
8 changes: 5 additions & 3 deletions test/server/hot_restarting_child_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,11 @@ TEST_F(HotRestartingChildTest, ForwardsPacketToRegisteredListenerOnMatch) {
packet->set_payload(udp_contents);
packet->set_receive_time_epoch_microseconds(packet_timestamp);
Network::MockUdpListenerWorkerRouter mock_worker_router;
EXPECT_CALL(*mock_udp_listener_config,
listenerWorkerRouter(WhenDynamicCastTo<const Network::Address::Ipv4Instance&>(
Eq(dynamic_cast<const Network::Address::Ipv4Instance&>(*test_listener_addr)))))
EXPECT_CALL(*mock_udp_listener_config, listenerWorkerRouter(testing::ResultOf(
[](const Network::Address::Instance& instance) {
return instance.asStringView();
},
Eq(test_listener_addr->asStringView()))))
.WillOnce(ReturnRef(mock_worker_router));
EXPECT_CALL(mock_worker_router,
deliver(worker_index, IsUdpWith(test_listener_addr, test_remote_addr, udp_contents,
Expand Down
Loading