Skip to content

Support conditional use of Abseil's string_view and optional, for Envoy.#7

Merged
dgoffredo merged 5 commits into
mainfrom
david.goffredo/abseil-for-bazel-build
Dec 6, 2022
Merged

Support conditional use of Abseil's string_view and optional, for Envoy.#7
dgoffredo merged 5 commits into
mainfrom
david.goffredo/abseil-for-bazel-build

Conversation

@dgoffredo
Copy link
Copy Markdown
Contributor

envoyproxy/envoy#23958 revealed that Envoy's linter doesn't like std::string_view or std::optional, preferring the Abseil absl::* versions instead.

For std::string_view, there is a NOLINT exception, but for std::optional there is not.

This pull request adds a level of indirection for each of string view and optional, namely src/datadog/{string_view,optional}.h, which define the type and type template datadog::tracing::StringView and datadog::tracing::Optional, respectively.

The default behavior, when the DD_USE_ABSEIL_FOR_ENVOY preprocessor macro is not defined, is for the Datadog-specific types to be aliases for the std types.

In Bazel builds, such as Envoy's, DD_USE_ABSEIL_FOR_ENVOY is defined. This make the Datadog-specific types aliases for the absl types.

@dgoffredo dgoffredo merged commit b17aca2 into main Dec 6, 2022
@dgoffredo dgoffredo deleted the david.goffredo/abseil-for-bazel-build branch December 6, 2022 13:38
cataphract pushed a commit to cataphract/dd-trace-cpp that referenced this pull request Mar 28, 2024
* chmod the built .so (not sure if it matters)
* avoid use of ngx_core_conf_t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant