Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions bazel/abseil.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Force internal versions of std classes per
# https://abseil.io/docs/cpp/guides/options
diff --git a/absl/base/options.h b/absl/base/options.h
index 230bf1e..6e1b9e5 100644
--- a/absl/base/options.h
+++ b/absl/base/options.h
@@ -100,7 +100,7 @@
// User code should not inspect this macro. To check in the preprocessor if
// absl::any is a typedef of std::any, use the feature macro ABSL_USES_STD_ANY.

-#define ABSL_OPTION_USE_STD_ANY 2
+#define ABSL_OPTION_USE_STD_ANY 0


// ABSL_OPTION_USE_STD_OPTIONAL
@@ -127,7 +127,7 @@
// absl::optional is a typedef of std::optional, use the feature macro
// ABSL_USES_STD_OPTIONAL.

-#define ABSL_OPTION_USE_STD_OPTIONAL 2
+#define ABSL_OPTION_USE_STD_OPTIONAL 0


// ABSL_OPTION_USE_STD_STRING_VIEW
@@ -154,7 +154,7 @@
// absl::string_view is a typedef of std::string_view, use the feature macro
// ABSL_USES_STD_STRING_VIEW.

-#define ABSL_OPTION_USE_STD_STRING_VIEW 2
+#define ABSL_OPTION_USE_STD_STRING_VIEW 0

// ABSL_OPTION_USE_STD_VARIANT
//
@@ -180,7 +180,7 @@
// absl::variant is a typedef of std::variant, use the feature macro
// ABSL_USES_STD_VARIANT.

-#define ABSL_OPTION_USE_STD_VARIANT 2
+#define ABSL_OPTION_USE_STD_VARIANT 0


// ABSL_OPTION_USE_INLINE_NAMESPACE
6 changes: 5 additions & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,11 @@ def _com_google_googletest():
# pull in more bits of abseil as needed, and is now the preferred
# method for pure Bazel deps.
def _com_google_absl():
external_http_archive("com_google_absl")
external_http_archive(
name = "com_google_absl",
patches = ["@envoy//bazel:abseil.patch"],
patch_args = ["-p1"],
)
native.bind(
name = "abseil_any",
actual = "@com_google_absl//absl/types:any",
Expand Down
4 changes: 2 additions & 2 deletions source/common/config/context_provider_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ class ContextProviderImpl : public ContextProvider {
void setDynamicContextParam(absl::string_view resource_type_url, absl::string_view key,
absl::string_view value) override {
ASSERT(Thread::MainThread::isMainThread());
(*dynamic_context_[resource_type_url].mutable_params())[key] = value;
(*dynamic_context_[resource_type_url].mutable_params())[std::string(key)] = std::string(value);
update_cb_helper_.runCallbacks(resource_type_url);
}
void unsetDynamicContextParam(absl::string_view resource_type_url,
absl::string_view key) override {
ASSERT(Thread::MainThread::isMainThread());
dynamic_context_[resource_type_url].mutable_params()->erase(key);
dynamic_context_[resource_type_url].mutable_params()->erase(std::string(key));
update_cb_helper_.runCallbacks(resource_type_url);
}
ABSL_MUST_USE_RESULT Common::CallbackHandlePtr
Expand Down
2 changes: 1 addition & 1 deletion source/common/json/json_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class ObjectHandler : public nlohmann::json_sax<nlohmann::json> {
"documentation in case error string changed.");
} else {
// Extract portion after ": " to get error string.
error_ = error.substr(end + 2);
error_ = std::string(error.substr(end + 2));
// Extract position information if present.
auto start = error.find("at ");
if (start != std::string::npos && (start + 3) < end) {
Expand Down
2 changes: 1 addition & 1 deletion source/common/local_info/local_info_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class LocalInfoImpl : public LocalInfo {
zone_stat_name_(zone_stat_name_storage_.statName()),
dynamic_update_callback_handle_(context_provider_.addDynamicContextUpdateCallback(
[this](absl::string_view resource_type_url) {
(*node_.mutable_dynamic_parameters())[resource_type_url].CopyFrom(
(*node_.mutable_dynamic_parameters())[std::string(resource_type_url)].CopyFrom(
context_provider_.dynamicContext(resource_type_url));
})) {}

Expand Down
2 changes: 1 addition & 1 deletion source/common/quic/envoy_quic_client_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ EnvoyQuicClientStream::EnvoyQuicClientStream(
static_cast<uint32_t>(GetReceiveWindow().value()), *filterManagerConnection(),
[this]() { runLowWatermarkCallbacks(); }, [this]() { runHighWatermarkCallbacks(); },
stats, http3_options) {
ASSERT(GetReceiveWindow() > 8 * 1024, "Send buffer limit should be larger than 8KB.");
ASSERT(GetReceiveWindow() > 8UL * 1024, "Send buffer limit should be larger than 8KB.");
}

EnvoyQuicClientStream::EnvoyQuicClientStream(
Expand Down
2 changes: 1 addition & 1 deletion source/common/quic/envoy_quic_server_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ EnvoyQuicServerStream::EnvoyQuicServerStream(
[this]() { runLowWatermarkCallbacks(); }, [this]() { runHighWatermarkCallbacks(); },
stats, http3_options),
headers_with_underscores_action_(headers_with_underscores_action) {
ASSERT(GetReceiveWindow() > 8 * 1024, "Send buffer limit should be larger than 8KB.");
ASSERT(GetReceiveWindow() > 8UL * 1024, "Send buffer limit should be larger than 8KB.");
}

EnvoyQuicServerStream::EnvoyQuicServerStream(
Expand Down
6 changes: 3 additions & 3 deletions source/common/stats/tag_extractor_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ bool TagExtractorStdRegexImpl::extractTag(TagExtractionContext& context, std::ve

TagExtractorRe2Impl::TagExtractorRe2Impl(absl::string_view name, absl::string_view regex,
absl::string_view substr)
: TagExtractorImplBase(name, regex, substr), regex_(regex) {}
: TagExtractorImplBase(name, regex, substr), regex_(std::string(regex)) {}

bool TagExtractorRe2Impl::extractTag(TagExtractionContext& context, std::vector<Tag>& tags,
IntervalSet<size_t>& remove_characters) const {
Expand Down Expand Up @@ -186,7 +186,7 @@ TagExtractorTokensImpl::TagExtractorTokensImpl(absl::string_view name, absl::str
if (!tokens_.empty()) {
const absl::string_view first = tokens_[0];
if (first != "$" && first != "*" && first != "**") {
prefix_ = first;
prefix_ = std::string(first);
}
}
}
Expand Down Expand Up @@ -236,7 +236,7 @@ bool TagExtractorTokensImpl::extractTag(TagExtractionContext& context, std::vect
} else if (start > 0) {
--start; // Remove the dot prior to the lat token, e.g. ".ef"
}
addTag(tags) = tag_value;
addTag(tags) = std::string(tag_value);
remove_characters.insert(start, end);

PERF_RECORD(perf, "tokens-match", name_);
Expand Down
2 changes: 1 addition & 1 deletion source/common/stream_info/stream_info_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ struct StreamInfoImpl : public StreamInfo {
absl::optional<uint64_t> connectionID() const override { return connection_id_; }

void setFilterChainName(absl::string_view filter_chain_name) override {
filter_chain_name_ = filter_chain_name;
filter_chain_name_ = std::string(filter_chain_name);
}

const std::string& filterChainName() const override { return filter_chain_name_; }
Expand Down
2 changes: 1 addition & 1 deletion test/common/stream_info/test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class TestStreamInfo : public StreamInfo::StreamInfo {
absl::optional<uint64_t> connectionID() const override { return connection_id_; }

void setFilterChainName(absl::string_view filter_chain_name) override {
filter_chain_name_ = filter_chain_name;
filter_chain_name_ = std::string(filter_chain_name);
}

const std::string& filterChainName() const override { return filter_chain_name_; }
Expand Down
5 changes: 3 additions & 2 deletions test/mocks/stream_info/mocks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ MockStreamInfo::MockStreamInfo()
response_code_details_ = std::string(details);
}));
ON_CALL(*this, setConnectionTerminationDetails(_))
.WillByDefault(
Invoke([this](absl::string_view details) { connection_termination_details_ = details; }));
.WillByDefault(Invoke([this](absl::string_view details) {
connection_termination_details_ = std::string(details);
}));
ON_CALL(*this, startTime()).WillByDefault(ReturnPointee(&start_time_));
ON_CALL(*this, startTimeMonotonic()).WillByDefault(ReturnPointee(&start_time_monotonic_));
ON_CALL(*this, lastDownstreamRxByteReceived())
Expand Down
2 changes: 1 addition & 1 deletion test/test_common/file_system_for_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MemfileImpl : public FileSharedImpl {
if (!flags_.test(File::Operation::Append)) {
info_->data_.clear();
}
info_->data_.append(buffer);
info_->data_.append(std::string(buffer));
const ssize_t size = info_->data_.size();
return resultSuccess(size);
}
Expand Down