-
Notifications
You must be signed in to change notification settings - Fork 440
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
More fixes to build all with Visual Studio 2015 #840
Conversation
…ses. This issue is unique to vc140 and does not affect newer compilers.
Appears like this test is occasionally tripping: //exporters/otlp:otlp_grpc_exporter_test FAILED in 0.3s
/home/runner/.cache/bazel/e6b8d6759295e14b76bc8cb98b604748/execroot/io_opentelemetry_cpp/bazel-out/k8-tsan-fastbuild/testlogs/exporters/otlp/otlp_grpc_exporter_test/test.log Doesn't appear to be related to my change. Rerunning it. |
Codecov Report
@@ Coverage Diff @@
## main #840 +/- ##
==========================================
- Coverage 95.50% 95.50% -0.00%
==========================================
Files 156 156
Lines 6619 6614 -5
==========================================
- Hits 6321 6316 -5
Misses 298 298
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Yes, it's failing frequently now. Need to check if it's coming from any latest merge. |
These are all the changes needed to compile OpenTelemetry C++ SDK with Visual Studio 2015.
I manually tested ad-hoc that the entire SDK works well with all optional component included.
Fixing warnings, errors, and warnings treated as errors.
Fixes #756
Partially addresses #215 , manually tested ad-hoc. No CI yet. CI loop (scripts, no code changes) will be added in #839
Changes
CMAKE_VERSION
check was not properly working on very OLD cmake lower than 3.3.b3_propagator.h
triggers an error about narrowing cast ofkTraceIdHexStrLength
. Add explicit static cast tosize_t
.nostd::variant_alternative_t
test does not compile in Visual Studio 2015. I suspect we are missing one of the headers. The rest of it works. And it's a lower priority - since we do not use any comparison of variant type in SDK, there should be no decrease in code coverage by disabling that test.ETW exporter: vs2015/C++ has no
__has_include
feature. And sinceTraceLoggingDynamic.h
is now always available - Microsoft open-sourced it under friendly license, we unconditionally include it. It's the best and standard compact binary protocol we should use on Windows for ETW, that can be easily decoded out-of-proc by .NET listener, for example.ETW exporter:
using
behavior in C++11 triggers ambiguity when the same class name is being aliased asusing
vs something else that is imported viausing namespace
. That doesn't happen on more recent versions of compilers. Explicitly assume that the ETW-specific wrapper classes (Properties,PropertyValue,PropertyValueMap) get imported viausing namespace
instead of alias, then it all works great.ETW exporter: avoid using
std::copy
since older compilers were picky about this due to Secure Lifecycle Development process. New compilers are more relaxed. But, unfortunately, we strive to run with zero compliance warnings on old compiler.__cplusplus
flag is not supported by old Visual Studio 2015. Add version check to avoid 'unknown flag` warning.