-
Notifications
You must be signed in to change notification settings - Fork 423
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
[BUILD] Fix build without vcpkg on Windows when gRPC is disabled #3016
[BUILD] Fix build without vcpkg on Windows when gRPC is disabled #3016
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
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 |
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.
Thanks.
* [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>
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_package
call is only performed ifWITH_OTLP_GRPC
is true, and thus causing that condition to always evaluate totrue
ifWITH_OTLP_GRPC
is false.