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

cmake: add Find<package>.cmake find module method for thrift #1020

Merged
merged 2 commits into from
Oct 21, 2021

Conversation

ideepika
Copy link
Contributor

In some cases, when using jaeger-cpp-client, we use thrift provided from
distro packages, these does not contain thriftConfig.cmake.
For such scenarios, we pivot to do not make find_package CONFIG mode as
default, instead we use basic signature[0]. We make use of
CMAKE_MODULE_PATH to search for FindThrift.cmake, which will find and
set all thrift::thrift's target properties.

[0] https://cmake.org/cmake/help/latest/command/find_package.html
The command arguments determine which of the above modes is used. When
the basic signature is used, the command searches in Module mode first.
If the package is not found, the search falls back to Config mode.

Signed-off-by: Deepika Upadhyay [email protected]

Fixes # (issue)

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@ideepika ideepika requested a review from a team October 19, 2021 14:02
@ideepika ideepika changed the title cmake: add cmake Find<package>.cmake for thrift cmake: add Find<package>.cmake find module method for thrift Oct 19, 2021
@@ -32,7 +32,7 @@ target_include_directories(
target_link_libraries(
opentelemetry_exporter_jaeger_trace
PUBLIC opentelemetry_resources http_client_curl
PRIVATE thrift::thrift)
INTERFACE thrift::thrift)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary to change the dependency to INTERFACE?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still in testing phase, not seems to be a problem for now, I have removed this change, thanks!

@codecov
Copy link

codecov bot commented Oct 19, 2021

Codecov Report

Merging #1020 (c50fed7) into main (cc065f7) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1020   +/-   ##
=======================================
  Coverage   94.85%   94.85%           
=======================================
  Files         151      151           
  Lines        5972     5972           
=======================================
  Hits         5664     5664           
  Misses        308      308           

In some cases, when using jaeger-cpp-client, we use thrift provided from
distro packages, these does not contain thriftConfig.cmake.
For such scenarios, we pivot to do not make find_package CONFIG mode as
default, instead we use basic signature[0]. We make use of
`CMAKE_MODULE_PATH` to search for FindThrift.cmake, which will find and
set all thrift::thrift's target properties.

This appends cmake/modules dir to CMAKE_MODULE_PATH, which is used
as all modules requiring find_package mode with basic_signature.

[0] https://cmake.org/cmake/help/latest/command/find_package.html
The command arguments determine which of the above modes is used. When
the basic signature is used, the command searches in Module mode first.
If the package is not found, the search falls back to Config mode.

Signed-off-by: Deepika Upadhyay <[email protected]>
@lalitb
Copy link
Member

lalitb commented Oct 20, 2021

In some cases, when using jaeger-cpp-client, we use thrift provided from
distro packages, these does not contain thriftConfig.cmake.

Out of curiosity, which are these distributions providing thrift package without cmake config files?

@ideepika
Copy link
Contributor Author

Out of curiosity, which are these distributions providing thrift package without cmake config files?

Sure, I can help there, I think most does, you can check them here: https://pkgs.org/search/?q=thrift
for eg (Ubuntu 20.04/Centos/Fedora): https://ubuntu.pkgs.org/20.04/ubuntu-universe-arm64/libthrift-dev_0.13.0-2build2_arm64.deb.html

@ThomsonTan ThomsonTan merged commit 23476e3 into open-telemetry:main Oct 21, 2021
@ideepika ideepika deleted the wip-thrift branch October 21, 2021 04:40
ideepika pushed a commit to ideepika/ceph that referenced this pull request Jun 22, 2022
We were using git fetch and an unofficial remote to fetch
opentelemetry-cpp, as it needed additional patch to include boost
headers, with the merge of

open-telemetry/opentelemetry-cpp#1100
open-telemetry/opentelemetry-cpp#1020

we do not require to maintain our own patched version.

This removes compile time fetch for opentelemetry-cpp instead use
official opentelemetry-cpp lib as a submodule.

Signed-off-by: Deepika Upadhyay <[email protected]>
ideepika pushed a commit to ideepika/ceph that referenced this pull request Jun 22, 2022
We were using git fetch and an unofficial remote to fetch
opentelemetry-cpp, as it needed additional patch to include boost
headers, with the merge of

open-telemetry/opentelemetry-cpp#1100
open-telemetry/opentelemetry-cpp#1020

we do not require to maintain our own patched version. Also, we were
using git fetch as a temporary change, now that tracing is always on, it
should be right time to adapt to using opentelemetry-cpp as a submodule.

This removes compile time fetch for opentelemetry-cpp instead use
official opentelemetry-cpp lib as a submodule.

Signed-off-by: Deepika Upadhyay <[email protected]>
ideepika pushed a commit to ceph/ceph-ci that referenced this pull request Jun 27, 2022
We were using git fetch and an unofficial remote to fetch
opentelemetry-cpp, as it needed additional patch to include boost
headers, with the merge of

open-telemetry/opentelemetry-cpp#1100
open-telemetry/opentelemetry-cpp#1020

we do not require to maintain our own patched version. Also, we were
using git fetch as a temporary change, now that tracing is always on, it
should be right time to adapt to using opentelemetry-cpp as a submodule.

This removes compile time fetch for opentelemetry-cpp instead use
official opentelemetry-cpp lib as a submodule.

Signed-off-by: Deepika Upadhyay <[email protected]>
Pegonzal pushed a commit to ceph/ceph that referenced this pull request Oct 13, 2022
We were using git fetch and an unofficial remote to fetch
opentelemetry-cpp, as it needed additional patch to include boost
headers, with the merge of

open-telemetry/opentelemetry-cpp#1100
open-telemetry/opentelemetry-cpp#1020

we do not require to maintain our own patched version. Also, we were
using git fetch as a temporary change, now that tracing is always on, it
should be right time to adapt to using opentelemetry-cpp as a submodule.

This removes compile time fetch for opentelemetry-cpp instead use
official opentelemetry-cpp lib as a submodule.

Signed-off-by: Deepika Upadhyay <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants