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

Don't require applications using jaeger exporter to know about libcurl #1518

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

astitcher
Copy link
Contributor

Fixes #1517

Changes

Changed link of libcurl (CMake CURL::libcurl) to opentelemetry_http_client_curl to be PRIVATE. This fixes the build issue for me on my Linux system using shared libraries, however I've not tested this anywhere else.

@astitcher astitcher requested a review from a team July 26, 2022 14:44
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 26, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: astitcher / name: Andrew Stitcher (710d483)

@codecov
Copy link

codecov bot commented Jul 26, 2022

Codecov Report

Merging #1518 (60b0262) into main (30b4fcd) will decrease coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1518      +/-   ##
==========================================
- Coverage   84.68%   84.61%   -0.06%     
==========================================
  Files         155      155              
  Lines        4782     4782              
==========================================
- Hits         4049     4046       -3     
- Misses        733      736       +3     
Impacted Files Coverage Δ
ext/src/http/client/curl/http_client_curl.cc 79.93% <0.00%> (-1.13%) ⬇️

@esigo
Copy link
Member

esigo commented Jul 26, 2022

@astitcher thanks for the PR, could you please fix the format as explained here?

@astitcher
Copy link
Contributor Author

@astitcher thanks for the PR, could you please fix the format as explained here?

Hmm, I didn't see anywhere there that referenced the cmake formatting spec or the tool to do it - can you be more specific?

@esigo
Copy link
Member

esigo commented Jul 26, 2022

@astitcher thanks for the PR, could you please fix the format as explained here?

Hmm, I didn't see anywhere there that referenced the cmake formatting spec or the tool to do it - can you be more specific?

This part I mean:

git checkout -b feature
# edit files
tools/format.sh
git commit
git push fork feature

so running tools/format.sh should do the job.

@astitcher
Copy link
Contributor Author

Thanks - looks like I need to install cmake-format...

@ThomsonTan
Copy link
Contributor

Thanks - looks like I need to install cmake-format...

For one file change, you may also try apply the diff mentioned int he build log (see below link) which should fix the format.

https://github.com/open-telemetry/opentelemetry-cpp/runs/7522769448?check_suite_focus=true

Copy link
Member

@esigo esigo left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for the PR :)

@esigo esigo merged commit 3a8f913 into open-telemetry:main Jul 26, 2022
@astitcher astitcher deleted the cmake-curl branch July 26, 2022 19:43
@owent
Copy link
Member

owent commented Jul 27, 2022

If we build opentelemetry_http_client_curl as static library, we still required to let the linker knows and links curl before opentelemetry_http_client_curl if any library use it. This PR breaks this dependency, I wonder if is there any better solution to solve this problem?

@astitcher
Copy link
Contributor Author

Are you sure this is a problem? I built opentelemetry-cpp with the jaeger exporter as a static library on my Linux machine and CMake did the right thing (CMake is documented to treat static and shared transitive dependencies differently).
The import module that cmake generated added libcurl and libthrift to the libraries l;inked for the final executable which is the previous behavior requiring the application to add find_package(CURL ...) and find_package(thrift ...).
@owent could you try building/installing with main and seeing if you actually have a problem compared to the previous situation - because for me static libraries are unchanged.

@owent
Copy link
Member

owent commented Jul 27, 2022

Are you sure this is a problem? I built opentelemetry-cpp with the jaeger exporter as a static library on my Linux machine and CMake did the right thing (CMake is documented to treat static and shared transitive dependencies differently). The import module that cmake generated added libcurl and libthrift to the libraries l;inked for the final executable which is the previous behavior requiring the application to add find_package(CURL ...) and find_package(thrift ...). @owent could you try building/installing with main and seeing if you actually have a problem compared to the previous situation - because for me static libraries are unchanged.

You are right, sorry for my mistake and please ignore my reply.
But where is the document about the transitive dependencies of linking?I only find the document about definitions.

yxue pushed a commit to yxue/opentelemetry-cpp that referenced this pull request Dec 5, 2022
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.

CMake users using jaeger exporter are forced to know about internal opentelemetry details
4 participants