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

Fix Curl Linking #466

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft

Fix Curl Linking #466

wants to merge 4 commits into from

Conversation

stefankiesz
Copy link
Contributor

@stefankiesz stefankiesz commented Dec 20, 2024

This PR corresponds to the Remove Unused Curl Library #1218 PR of the Producer Cpp SDK.


What was changed?

  • Replaced pkg_check_modules with find_package for finding the Curl dependency library.

Why was it changed?

  • We already use find_package for the OpenSSL libraries which points the linker to the correct location for these libraries /open-source/local/lib.
  • Since the Curl being linked was -lcurl, it was searched for in the default linker search paths which was finding a different instance of the Curl library installed on the machine.
  • It appears we incorrectly have a hot-fix for this in the Producer Cpp SDK by calling find_package on Curl there (even though that project does not build Curl), which is why it has previously worked. The Producer Cpp PR corresponding with these changes removes such Curl related operations from the Cpp end, which caused builds to fail since we do not do this here in Producer C.

How was it changed?

  • Replaced the usage of pkg_check_modules with find_package for the Curl library we build from source with this SDK.

What testing was done for the changes?

  • Used make VERBOSE=1 when building Producer Cpp to see the paths used for linking libraries.
    • Prior to this change:
      -lcurl -lz ../open-source/local/lib/libssl.a ../open-source/local/lib/libcrypto.a
    • After this change:
      ../open-source/local/lib/libcurl.a -lz ../open-source/local/lib/libssl.a ../open-source/local/lib/libcrypto.a

Note

Zlib is still in the default -l search path because we do not build that library from source.



By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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.

1 participant