[BUILD] Fix build without vcpkg on Windows when gRPC is disabled#3016
Merged
ThomsonTan merged 1 commit intoopen-telemetry:mainfrom Aug 2, 2024
Merged
[BUILD] Fix build without vcpkg on Windows when gRPC is disabled#3016ThomsonTan merged 1 commit intoopen-telemetry:mainfrom
ThomsonTan merged 1 commit intoopen-telemetry:mainfrom
Conversation
|
|
4f76968 to
96334b9
Compare
Currently, if support for gRPC is disabled by configuring the build with `-DWITH_OTLP_GRPC=OFF`, you are on Windows and do not use a toolchain file then the build will always use all third-party dependencies from vcpkg, regardless of whether nlohmann-json, abseil and protobuf were found or not. The root cause for this behavior is a bug in the condition meant to check that all dependencies have been found, which unconditionally checks for `NOT gRPC_FOUND`, but the corresponding `find_package` call is only performed if `WITH_OTLP_GRPC` is true, and thus causing that condition to always evaluate to `true` if `WITH_OTLP_GRPC` is false.
96334b9 to
8aac60c
Compare
Member
|
Thanks for the PR. I hope I got the title right, waiting for @lalitb or @ThomsonTan to review (Windows). |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3016 +/- ##
==========================================
+ Coverage 87.12% 87.59% +0.47%
==========================================
Files 200 190 -10
Lines 6109 5870 -239
==========================================
- Hits 5322 5141 -181
+ Misses 787 729 -58 |
ThomsonTan
approved these changes
Aug 2, 2024
msiddhu
added a commit
to msiddhu/opentelemetry-cpp
that referenced
this pull request
Aug 20, 2024
* [EXPORTER] Ignore exception when create thread in OTLP file exporter. (open-telemetry#3012) * [BUILD] Update MODULE.bazel (open-telemetry#3015) * [BUILD] Fix build without vcpkg on Windows when gRPC is disabled (open-telemetry#3016) * [BUILD] Add abi_version_no bazel flag. (open-telemetry#3020) * [Code health] Expand iwyu coverage to include unit tests. (open-telemetry#3022) * [BUILD] Version opentelemetry_proto/proto_grpc shared libraries (open-telemetry#2992) * [SEMANTIC CONVENTIONS] Upgrade semantic conventions to 1.27.0 (open-telemetry#3023) * [SDK] Support empty histogram buckets (open-telemetry#3027) * support empty buckets * Update histogram_test.cc * Update histogram_test.cc * test for negative values * fix count * [TEST] Fix sync problems in OTLP File exporter tests. (open-telemetry#3031) --------- Co-authored-by: WenTao Ou <owentou@tencent.com> Co-authored-by: Carbo Kuo <BYVoid@users.noreply.github.com> Co-authored-by: Manuel Bergler <m.bergler@tum.de> Co-authored-by: Marc Alff <marc.alff@oracle.com> Co-authored-by: Troels Hoffmeyer <Troels.d.hoffmeyer@gmail.com> Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>
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.
Currently, if support for gRPC is disabled by configuring the build with
-DWITH_OTLP_GRPC=OFF, you are on Windows and do not use a toolchain file then the build will always use all third-party dependencies from vcpkg, regardless of whether nlohmann-json, abseil and protobuf were found or not.The root cause for this behavior is a bug in the condition meant to check that all dependencies have been found, which unconditionally checks for
NOT gRPC_FOUND, but the correspondingfind_packagecall is only performed ifWITH_OTLP_GRPCis true, and thus causing that condition to always evaluate totrueifWITH_OTLP_GRPCis false.