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

Switch from MPark variant to absl::variant as default #771

Merged
merged 59 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
076effa
Add curl via vcpkg to WIndows builds
maxgolov May 11, 2021
0f13e20
Merge branch 'main' of http://github.com/open-telemetry/opentelemetry…
maxgolov May 13, 2021
0540d32
Merge branch 'main' of http://github.com/open-telemetry/opentelemetry…
maxgolov May 19, 2021
c437cef
Merge branch 'main' of http://github.com/open-telemetry/opentelemetry…
maxgolov May 20, 2021
54903e8
Attempt to gracefully switch over from MPark variant to absl::variant
maxgolov May 20, 2021
5c7c70c
Fixing markdownlint warning (sigh)
maxgolov May 20, 2021
24ff212
Add CHANGELOG.md entry about variant implementation switch
maxgolov May 20, 2021
8ed8943
Fix static vs extern issue in Abseil. Add Abseil Variant to include d…
maxgolov May 20, 2021
645136f
Isolate to local abseil paths to avoid picking up external Abseil lib…
maxgolov May 20, 2021
8a0b7f4
No need to specify include path to nostd since now local Abseil would…
maxgolov May 20, 2021
bdb22c6
HAVE_ABSEIL_VARIANT option is gone because by default we know build A…
maxgolov May 20, 2021
dfae1ba
Issue with GMOCK on Windows
maxgolov May 20, 2021
963ccf1
Reinstate the magic of C-string (both std and abseil variant want thi…
maxgolov May 20, 2021
fd5e041
Fix Zipkin exporter to support const char * AttributeValue
maxgolov May 20, 2021
e235db2
Make sure that our local snapshot of Abseil Variant on API surface do…
maxgolov May 20, 2021
41293fd
attribute_utils.h had wrong order for the enum and missing initialize…
maxgolov May 20, 2021
4accbbe
Adjust Resource to store const char * as std::string
maxgolov May 20, 2021
63f0b63
Fix build warning that turns an error in Bazel build
maxgolov May 20, 2021
8047102
Fix for Bazel error with no-exceptions build
maxgolov May 20, 2021
206c63c
Fix Bazel tsan build
maxgolov May 20, 2021
4f0910e
Can't declare a class using exceptions in a build with no-exceptions
maxgolov May 20, 2021
e9e2e85
Add full set of features to nostd::variant
maxgolov May 20, 2021
a8dfb7d
Variant test SHOULD NOT make assumptions about how compilers work, wh…
maxgolov May 20, 2021
9785f16
Re-enable Variant Test that was disabled in CMake build for some reason
maxgolov May 20, 2021
e389f66
Merge branch 'main' into maxgolov/absl_variant_default
maxgolov May 20, 2021
ab34030
Merge branch 'main' into maxgolov/absl_variant_default
maxgolov May 20, 2021
8811b13
Merge branch 'main' of http://github.com/open-telemetry/opentelemetry…
maxgolov May 21, 2021
2abdc1a
Can't use GSL if it's not found
maxgolov May 22, 2021
1ea289f
Add those definitions back globally since we are still building proje…
maxgolov May 22, 2021
9d8754d
Clan on Mac requires this to be inline
maxgolov May 22, 2021
a6c41bd
Add missing classes to STDLIB build
maxgolov May 22, 2021
4d10b28
Merge branch 'maxgolov/absl_variant_default' of http://github.com/ope…
maxgolov May 22, 2021
12231f6
Code formatting
maxgolov May 22, 2021
8037c8a
Add proper dependency on json.hpp
maxgolov May 22, 2021
8e2a481
Fix an issue with not finding json.hpp
maxgolov May 22, 2021
c9b56d5
Add overload with attributes as initializer list + options, no links
maxgolov May 22, 2021
2dc6cce
Make finding json.hpp quiet
maxgolov May 22, 2021
1d487fd
Minor formatting
maxgolov May 22, 2021
ec6b88d
Update server.cc
maxgolov May 24, 2021
c067783
Code formatting
maxgolov May 24, 2021
b1f127d
Merge branch 'main' into maxgolov/absl_variant_default
maxgolov May 24, 2021
8044d02
Merge branch 'main' of http://github.com/open-telemetry/opentelemetry…
maxgolov May 24, 2021
f3020a5
Merge branch 'maxgolov/absl_variant_default' of http://github.com/ope…
maxgolov May 24, 2021
fb5393b
Merge branch 'main' into maxgolov/absl_variant_default
maxgolov May 25, 2021
8c95419
Merge branch 'main' of http://github.com/open-telemetry/opentelemetry…
maxgolov May 28, 2021
719cc2d
Merge branch 'maxgolov/absl_variant_default' of http://github.com/ope…
maxgolov May 28, 2021
c478c17
Code formatting change
maxgolov May 28, 2021
ab2c5a9
Update .codecov.yaml
maxgolov May 28, 2021
8d37349
Merge branch 'maxgolov/codecov_settings' of http://github.com/open-te…
maxgolov May 28, 2021
7303c95
Merge branch 'main' of http://github.com/open-telemetry/opentelemetry…
maxgolov Jun 1, 2021
d6f5d32
Merge branch 'main' of http://github.com/open-telemetry/opentelemetry…
maxgolov Jun 1, 2021
ebdf934
Keep logs preview building
maxgolov Jun 2, 2021
692259c
Allow Resource Attributes initialized from common::AttributeValue
maxgolov Jun 2, 2021
553628b
Apply code formatting
maxgolov Jun 2, 2021
752c525
Merge branch 'main' into maxgolov/absl_variant_default
maxgolov Jun 2, 2021
26961fd
Update CMakeLists.txt
maxgolov Jun 3, 2021
6d56e41
Merge branch 'main' into maxgolov/absl_variant_default
maxgolov Jun 3, 2021
8646892
Remove unused template
maxgolov Jun 3, 2021
1cd471f
Merge branch 'main' into maxgolov/absl_variant_default
maxgolov Jun 4, 2021
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
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,19 @@ if(WITH_ABSEIL)
add_definitions(-DHAVE_ABSEIL)
find_package(absl CONFIG REQUIRED)

# Abseil headers-only lib is needed for absl::variant to work vs2015.
# `nostd::mpark::variant` is not compiling in vs2015.
set(CORE_RUNTIME_LIBS absl::any absl::base absl::bits absl::city)

# target_link_libraries(main PRIVATE absl::any absl::base absl::bits
# absl::city)
endif()

if(WITH_STL)
# These definitions are needed for test projects that do not link against
# opentelemetry-api library directly. We ensure that variant implementation
# (absl::variant or std::variant) in variant unit test code is consistent with
# the global project build definitions.
add_definitions(-DHAVE_CPP_STDLIB)
add_definitions(-DHAVE_GSL)
# Require at least C++17. C++20 is needed to avoid gsl::span
if(CMAKE_MINOR_VERSION VERSION_GREATER "3.18")
# Ask for 20, may get anything below
Expand Down Expand Up @@ -125,13 +129,13 @@ option(
OFF)
option(WITH_EXAMPLES "Whether to build examples" ON)

option(WITH_METRICS_PREVIEW "Whether to build metrics preview" OFF)
option(WITH_METRICS_PREVIEW "Whether to build metrics preview" ON)
maxgolov marked this conversation as resolved.
Show resolved Hide resolved

if(WITH_METRICS_PREVIEW)
add_definitions(-DENABLE_METRICS_PREVIEW)
endif()

option(WITH_LOGS_PREVIEW "Whether to build logs preview" OFF)
option(WITH_LOGS_PREVIEW "Whether to build logs preview" ON)

if(WITH_LOGS_PREVIEW)
add_definitions(-DENABLE_LOGS_PREVIEW)
Expand Down
2 changes: 2 additions & 0 deletions api/include/opentelemetry/common/attribute_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ using AttributeValue =
int64_t,
uint32_t,
double,
const char *,
nostd::string_view,
nostd::span<const bool>,
nostd::span<const int32_t>,
Expand All @@ -64,6 +65,7 @@ enum AttributeType
kTypeInt64,
kTypeUInt,
kTypeDouble,
kTypeCString,
kTypeString,
kTypeSpanBool,
kTypeSpanInt,
Expand Down
10 changes: 0 additions & 10 deletions api/include/opentelemetry/nostd/absl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@

This is a snapshot of Abseil Variant `absl::variant` from Abseil
`v2020-03-03#8`.

This code is required to compile OpenTelemetry code in vs2015 because MPark
Variant implementation is not compatible with vs2015.

Build option `HAVE_ABSEIL_VARIANT` allows to enable the build with
`absl::variant`, `absl::get` and `absl::visit` as defalt implementation for
`nostd::` classes.

Going forward it makes sense to use `absl::variant` as default implementation
for Windows OS and vs2015, vs2017, vs2019 and newer compilers.
Loading