More fixes to build all with Visual Studio 2015#840
Merged
Conversation
…ses. This issue is unique to vc140 and does not affect newer compilers.
Contributor
Author
|
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.logDoesn'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
|
ThomsonTan
approved these changes
Jun 9, 2021
Member
Yes, it's failing frequently now. Need to check if it's coming from any latest merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_VERSIONcheck was not properly working on very OLD cmake lower than 3.3.b3_propagator.htriggers an error about narrowing cast ofkTraceIdHexStrLength. Add explicit static cast tosize_t.nostd::variant_alternative_ttest 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_includefeature. And sinceTraceLoggingDynamic.his 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:
usingbehavior in C++11 triggers ambiguity when the same class name is being aliased asusingvs 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 namespaceinstead of alias, then it all works great.ETW exporter: avoid using
std::copysince 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.__cplusplusflag is not supported by old Visual Studio 2015. Add version check to avoid 'unknown flag` warning.